Skip to content

Conversation

@thaJeztah
Copy link
Member

integration/images: improve some asserts, and add asserts for unhandled errs

Before:

=== FAIL: amd64.integration.image TestImagePullPlatformInvalid (0.01s)
    pull_test.go:37: assertion failed: expression is false: errdefs.IsInvalidParameter(err)

After:

=== RUN   TestImagePullPlatformInvalid
    pull_test.go:37: assertion failed: error is Error response from daemon: "foobar": unknown operating system or architecture: invalid argument (errdefs.errSystem), not errdefs.IsInvalidParameter

integration/build: improve some asserts, and add asserts for unhandled errs

  • add some asserts for unhandled errors
  • use consts for fixed values, and slightly re-format Dockerfile contentt
  • inline one-line Dockerfiles
  • fix some vars to be properly camel-cased
  • improve assert for error-types;

Before:

=== RUN   TestBuildPlatformInvalid
    build_test.go:685: assertion failed: expression is false: errdefs.IsInvalidParameter(err)
--- FAIL: TestBuildPlatformInvalid (0.01s)
FAIL

After:

=== RUN   TestBuildPlatformInvalid
    build_test.go:689: assertion failed: error is Error response from daemon: "foobar": unknown operating system or architecture: invalid argument (errdefs.errSystem), not errdefs.IsInvalidParameter
--- FAIL: TestBuildPlatformInvalid (0.01s)
FAIL

- A picture of a cute animal (not mandatory but encouraged)

…ed errs

Before:

    === FAIL: amd64.integration.image TestImagePullPlatformInvalid (0.01s)
        pull_test.go:37: assertion failed: expression is false: errdefs.IsInvalidParameter(err)

After:

    === RUN   TestImagePullPlatformInvalid
        pull_test.go:37: assertion failed: error is Error response from daemon: "foobar": unknown operating system or architecture: invalid argument (errdefs.errSystem), not errdefs.IsInvalidParameter

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
…d errs

- add some asserts for unhandled errors
- use consts for fixed values, and slightly re-format Dockerfile contentt
- inline one-line Dockerfiles
- fix some vars to be properly camel-cased
- improve assert for error-types;

Before:

    === RUN   TestBuildPlatformInvalid
        build_test.go:685: assertion failed: expression is false: errdefs.IsInvalidParameter(err)
    --- FAIL: TestBuildPlatformInvalid (0.01s)
    FAIL

After:

    === RUN   TestBuildPlatformInvalid
        build_test.go:689: assertion failed: error is Error response from daemon: "foobar": unknown operating system or architecture: invalid argument (errdefs.errSystem), not errdefs.IsInvalidParameter
    --- FAIL: TestBuildPlatformInvalid (0.01s)
    FAIL

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah merged commit 82acb92 into moby:master Jan 22, 2024
@thaJeztah thaJeztah deleted the integration_minor_refactor branch January 22, 2024 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/testing kind/refactor PR's that refactor, or clean-up code status/2-code-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants