Go: move extractor smoke test into integration tests - #22371
Merged
Conversation
The standalone `go/extractor-smoke-test` (run only from `go/Makefile`'s `test` target) was redundant: its core invariant, that traced and untraced extraction produce the same result, is already asserted by the `test-extraction` integration test, whose traced and autobuild cases share a single `test.expected`. The control-flow query it ran is covered far more thoroughly by the CFG library test. The only combination not reproduced was autobuild under build tracing, so add a `test_autobuild_traced` case to `test-extraction` and delete the smoke test. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Moves Go extractor smoke coverage into integration tests while removing the redundant standalone harness.
Changes:
- Adds traced-autobuild extraction coverage.
- Removes the standalone smoke test and related references.
Show a summary per file
| File | Description |
|---|---|
go/ql/integration-tests/test-extraction/test.py |
Adds traced-autobuild coverage. |
go/Makefile |
Removes smoke-test invocation. |
CODEOWNERS |
Removes obsolete ownership entry. |
go/extractor-smoke-test/test.sh |
Deletes standalone test script. |
go/extractor-smoke-test/main.go |
Deletes smoke-test source. |
go/extractor-smoke-test/go.mod |
Deletes smoke-test module. |
go/extractor-smoke-test/expected.csv |
Deletes expected results. |
go/extractor-smoke-test/.gitignore |
Deletes obsolete ignore rules. |
Review details
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 8/8 changed files
- Comments generated: 0
- Review effort level: Balanced
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.
Why
The standalone
go/extractor-smoke-testwas only ever run fromgo/Makefile'stesttarget and is redundant with the existing integration tests. Its real invariant, that traced and untraced extraction produce the same database, is already asserted by thetest-extractionintegration test (itstest_tracedandtest_autobuildcases share a singletest.expected). The control-flow query it ran (ControlFlowNode_getASuccessor.ql) is covered far more thoroughly by the CFG library test.What
The one combination the integration tests did not reproduce was autobuild running under build tracing (
CODEQL_EXTRACTOR_GO_BUILD_TRACING=onwith no explicit build command). To preserve that coverage:test_autobuild_tracedcase totest-extraction, which runs autobuild under build tracing (via_env) and is checked against the sametest.expectedas the untraced-autobuild and explicit-traced cases. This asserts all three extraction paths agree.go/extractor-smoke-test/and its references ingo/MakefileandCODEOWNERS.Validation
Ran both extraction modes on
test-extraction/src: traced-autobuild and untraced-autobuild produce byte-identical query output (7 files, 5 calls, 0 extraction errors), matching the checked-intest.expected.