Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

conformance: do not fail on report generation failure #419

Merged

Conversation

rogpeppe
Copy link
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>
@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