Skip to content

conformance: do not fail on report generation failure#419

Merged
vbatts merged 1 commit intoopencontainers:mainfrom
rogpeppe-contrib:001-no-fail-on-no-report
Jun 23, 2023
Merged

conformance: do not fail on report generation failure#419
vbatts merged 1 commit intoopencontainers:mainfrom
rogpeppe-contrib:001-no-fail-on-no-report

Conversation

@rogpeppe
Copy link
Copy Markdown
Contributor

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

Signed-off-by: Roger Peppe <rogpeppe@gmail.com>
@rogpeppe rogpeppe force-pushed the 001-no-fail-on-no-report branch from 93f57a6 to caded17 Compare May 25, 2023 17:03
@vbatts vbatts merged commit f49a193 into opencontainers:main Jun 23, 2023
@jdolitsky jdolitsky mentioned this pull request Jun 27, 2023
8 tasks
@jdolitsky jdolitsky mentioned this pull request Jul 6, 2023
8 tasks
@sudo-bmitch sudo-bmitch mentioned this pull request Feb 1, 2024
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants