- I was facing some caching issues when working on this ticket: https://github.com/dagger/dagger/pull/5149
- TLDR: I ran the
TestContainerWithMountedSecretOwnertest at some point with a broken implementation, the output expected by the test was cached. - After this I ran
./hack dev bashmultiple times, switched branches, did a lot of changes and the test would just keep failing due to the cached output caused by the broken implementation mentioned above. - I renamed the subtest
TestContainerWithMountedSecretOwner/useridtoTestContainerWithMountedSecretOwner/userid-123and testuserid-123ran fine! - When contributing to Dagger how do I ensure that the above doesn't happen when running local tests?
To reproduce this try the following:
- Pull latest
main. - Run
./hack dev bash - Run
go test -v -count=1 -timeout 30s -run ^TestContainerWithMountedSecretOwner/userid$ github.com/dagger/dagger/core/integration. Test should pass. - Introduce some breaking behavior, for example a
panicincmd/shim/main.gomain's function. - Re-run
./hack dev bash - Run the test again:
go test -v -count=1 -timeout 30s -run ^TestContainerWithMountedSecretOwner/userid$ github.com/dagger/dagger/core/integration. Test will still pass. - Rename the test to
userid-111. - Run the renamed test:
go test -v -count=1 -timeout 30s -run ^TestContainerWithMountedSecretOwner/userid-111$ github.com/dagger/dagger/core/integration. Renamed test will fail due to thepanicintroduced in step 4.
I would expect the test to fail in step #6, any feedback?