Skip to content

Go: move extractor smoke test into integration tests - #22371

Merged
redsun82 merged 1 commit into
mainfrom
redsun82-go-move-extractor-smoke-test-to-integrat
Aug 18, 2026
Merged

Go: move extractor smoke test into integration tests#22371
redsun82 merged 1 commit into
mainfrom
redsun82-go-move-extractor-smoke-test-to-integrat

Conversation

@redsun82

Copy link
Copy Markdown
Contributor

Why

The standalone go/extractor-smoke-test was only ever run from go/Makefile's test target and is redundant with the existing integration tests. Its real invariant, that traced and untraced extraction produce the same database, is already asserted by the test-extraction integration test (its test_traced and test_autobuild cases share a single test.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=on with no explicit build command). To preserve that coverage:

  • Add a test_autobuild_traced case to test-extraction, which runs autobuild under build tracing (via _env) and is checked against the same test.expected as the untraced-autobuild and explicit-traced cases. This asserts all three extraction paths agree.
  • Delete go/extractor-smoke-test/ and its references in go/Makefile and CODEOWNERS.

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-in test.expected.

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>
Copilot AI balanced review requested due to automatic review settings August 18, 2026 10:37
@redsun82
redsun82 requested review from a team as code owners August 18, 2026 10:37
@github-actions github-actions Bot added the Go label Aug 18, 2026
@redsun82
redsun82 requested a review from owen-mc August 18, 2026 10:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@owen-mc owen-mc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems plausible.

@redsun82
redsun82 merged commit 05c40ea into main Aug 18, 2026
16 checks passed
@redsun82
redsun82 deleted the redsun82-go-move-extractor-smoke-test-to-integrat branch August 18, 2026 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants