Skip to content

Smoke testing #66

Description

@joonas-fi

Problem

How do we know after building a container that it results in an image that starts properly and that it does not have some stupid showstopper problem?

Solution

Smoke testing

Smoke testing implementation

After container has been built, if smoke test defined for DockerImageSpec (add new field):

type DockerImageSpec struct {
Image string `json:"image"`
DockerfilePath string `json:"dockerfile_path"`
AuthType *string `json:"auth_type"` // creds_from_env
Platforms []string `json:"platforms,omitempty"` // if set, uses buildx
TagLatest bool `json:"tag_latest"`
}

Then run smoke test. Smoke test could be:

  • start container, expect it to stay up for at least 5 seconds (server-type containers that don't exit in the happy path can only be asserted as "looks like it stays up")
  • for expected-to-exit containers => run container, expect ~immediate successful exit

Features:

  • Ability to give command line parameters
  • Ability to assert stdout to contain something

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions