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.
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:
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
.