Skip to content

Commit 8ea9658

Browse files
committed
Fix integration test to properly demonstrate package exclusion bug
The test was extracting from the entire workspace, which caused both modules to be treated as input packages. This meant their ModDirs were added to wantedRoots even without the fix, so the bug never manifested. Changed test.py to extract only mainmodule packages using a specific command pattern. This ensures: - Only mainmodule is in the initial input packages - configmodule is visited as a dependency - Without the fix, configmodule's ModDir is NOT in wantedRoots - The relative path check produces ".." and incorrectly excludes it Test results: - WITHOUT fix: 2 files extracted (configmodule missing) ❌ - WITH fix: 4 files extracted (all present) ✅ This addresses the reviewer's feedback that the test was passing without any code changes.
1 parent 438eac7 commit 8ea9658

File tree

1 file changed

+3
-1
lines changed
  • go/ql/integration-tests/package-exclusion-fix

1 file changed

+3
-1
lines changed

go/ql/integration-tests/package-exclusion-fix/test.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,6 @@
1515
#
1616
# Fix: Adds all dependency ModDirs to wantedRoots and prioritizes checking them first.
1717
def test(codeql, go):
18-
codeql.database.create(source_root="src")
18+
# Extract only mainmodule packages to reproduce the bug scenario
19+
# Without the fix, configmodule won't be in wantedRoots and will be excluded
20+
codeql.database.create(command=["go", "list", "./mainmodule/..."], source_root="src")

0 commit comments

Comments
 (0)