opencontainers / distribution-spec

OCI Distribution Specification
https://opencontainers.org
Apache License 2.0
792 stars 199 forks source link

conformance: do not fail on report generation failure #419

Closed rogpeppe closed 1 year ago

rogpeppe commented 1 year ago

When the conformance test package cannot write to the current directory, it calls log.Fatal and exits immediately, making it look like the tests have failed even when they haven't.

This can happen when the conformance tests are run without checking out the repository, as in:

    go test github.com/opencontainers/distribution-spec/conformance

which is possible (and useful) when using the conformance tests as a dependency in some other module. In this case, the files are in a read-only directory inside $GOMODCACHE.

This change makes the failure soft, so it will print a warning, but not actually fail the tests. This matches the behaviour of reporters.NewJUnitReporter.