Repository navigation
fix(test): seed TestGuardOwedAbsoluteMeasuredCommand with CheckContext (#3008) - #3017
Open
Gaoshou101 wants to merge 2 commits into
Open
Gaoshou101 wants to merge 2 commits into
Gaoshou101 wants to merge 2 commits into
Conversation
Fixes Agent-Field#3008 TestGuardOwedAbsoluteMeasuredCommand hardcoded Context: make([]string, 8) on the inherited synthetic check while executing the portable rerun through the live bash check observer, which records the runner's checkContextNames (GOOS, GOARCH, GOFLAGS, CGO_ENABLED, GOWORK, GORACE, NODE_ENV, PYTEST_ADDOPTS). When any of those variables was set in the environment, the context mismatch kept the saved absolute failure owed even after a matching portable rerun. Export verification.CheckContext() (also reused by CoversUnrun), use it to seed the inherited check, and add TestGuardOwedAbsoluteMeasuredCommandContext to verify both matching non-empty context clearing and cross-context holding.
|
|
Member
|
Hey, thanks for the PR. Could you sign the CLA when you get a chance so we can review it? |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3008
What changed
TestGuardOwedAbsoluteMeasuredCommandpreviously seeded the inherited synthetic check (old) withContext: make([]string, 8)(all empty strings), while running the subsequentgo test ./...through the live bash observer (_codeaf_check), which populatesnext.ContextfromcheckContextNames(GOOS,GOARCH,GOFLAGS,CGO_ENABLED,GOWORK,GORACE,NODE_ENV,PYTEST_ADDOPTS). Whenever any of those variables was exported in the runner environment,next.identity != old.identitykept the saved absolute failure owed even after a matching portable rerun.verification.CheckContext()ininternal/factory/verification/receipts.go(and reused it inCoversUnrunininternal/factory/verification/go_requirements.goto avoid duplicating thecheckContextNamesloop), and seededold.ContextinTestGuardOwedAbsoluteMeasuredCommandwithverification.CheckContext().TestGuardOwedAbsoluteMeasuredCommandContextincmd/codeaf/factory_guard_stale_test.goto pin both sides of the contract witht.Setenv: a rerun under a differentGOOSkeeps the saved failure owed, while a portable rerun under the matching non-emptyGOOS+GOWORKcontext clears it.How it was checked
dev(a5499811) withGOOS=linuxandGOWORK=off:GOOS=linux go test -v -count=1 -run '^TestGuardOwedAbsoluteMeasuredCommand$' ./cmd/codeaf-> FAIL atfactory_guard_stale_test.go:270: portable rerun did not clear saved absolute failure: repair is incomplete; owed: 'go' 'test' './...' ...GOWORK=off go test -v -count=1 -run '^TestGuardOwedAbsoluteMeasuredCommand$' ./cmd/codeaf-> FAIL atfactory_guard_stale_test.go:270go test -v -count=1 -run '^TestGuard' ./cmd/codeaf-> PASS (1.144s, all 10TestGuard*tests)GOOS=linux go test -v -count=1 -run '^TestGuardOwedAbsoluteMeasuredCommand' ./cmd/codeaf-> PASS (0.252s)GOWORK=off go test -v -count=1 -run '^TestGuardOwedAbsoluteMeasuredCommand' ./cmd/codeaf-> PASS (0.191s)CGO_ENABLED=0 GOFLAGS=-v go test -v -count=1 -run '^TestGuardOwedAbsoluteMeasuredCommand' ./cmd/codeaf-> PASS (0.195s)go test -race -count=1 ./internal/factory/verification-> PASS (4.930s)go test -count=1 ./internal/namelaw ./cmd/codeaf-changes ./internal/factory/verification-> PASSgo vet ./internal/factory/verification ./cmd/codeaf-> clean (exit 0)gofmt -landgit diff --check-> clean-raceoncmd/codeafdue to container link time; addeddocs/changes/unreleased/3017-guard-owed-absolute-context.mdand validated viamake changelog-check.Checklist
git add -A.docs/changes/unreleased/3017-guard-owed-absolute-context.mdadded and validated withmake changelog-check.internal/manual/chat/unaffected).