Skip to content

Fix minimal default scope in extract-test-databases.sh for efficient running of client integration tests#228

Merged
data-douser merged 2 commits intomainfrom
dd/optimize-test-db-extraction
Apr 7, 2026
Merged

Fix minimal default scope in extract-test-databases.sh for efficient running of client integration tests#228
data-douser merged 2 commits intomainfrom
dd/optimize-test-db-extraction

Conversation

@data-douser
Copy link
Copy Markdown
Collaborator

Closes #226.

Summary of Changes

This pull request introduces improvements to how test databases are extracted for integration and unit tests, making the process more efficient and configurable. The main change is the addition of a --scope option to the extract-test-databases.sh script, allowing selective extraction of only the databases needed for integration tests by default, or all databases if desired. Additionally, the integration test runner now ensures stale output is cleaned up before running certain tests.

Outline of Changes

Test database extraction improvements:

  • Added a --scope option to server/scripts/extract-test-databases.sh, allowing users to specify whether to extract only the databases needed for client integration tests (integration, now the default) or all test databases (all). The --language option now implies --scope all for the specified language. The script's usage documentation and argument parsing were updated accordingly. [1] [2] [3] [4] [5] [6]

  • Updated the GitHub Actions workflow (.github/workflows/client-integration-tests.yml) to clarify in comments that only integration-scope databases are extracted by default, and that query unit tests handle their own extraction.

Integration test runner reliability:

  • Added logic to the IntegrationTestRunner (client/src/lib/integration-test-runner.js) to clean up any stale interpretedOutput directories before running a test, ensuring that directory comparisons only consider output from the current invocation.

@data-douser data-douser self-assigned this Apr 7, 2026
Copilot AI review requested due to automatic review settings April 7, 2026 00:58
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 7, 2026

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Snapshot Warnings

⚠️: No snapshots were found for the head SHA 64a3651.
Ensure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice.

Scanned Files

None

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves integration-test efficiency and reliability by making CodeQL test database extraction more selective by default and by ensuring stale query interpretation outputs don’t interfere with output comparisons.

Changes:

  • Added a --scope flag to server/scripts/extract-test-databases.sh to default to minimal extraction for client integration tests, with an option to extract all test databases.
  • Updated the JS integration test runner to delete any pre-existing interpretedOutput path before running codeql_query_run, avoiding stale-output comparisons.
  • Clarified CI workflow comments to reflect the new default extraction behavior.
Show a summary per file
File Description
server/scripts/extract-test-databases.sh Adds --scope argument and changes default extraction behavior to a minimal integration-test-focused set.
client/src/lib/integration-test-runner.js Removes stale interpretedOutput before codeql_query_run to make comparisons deterministic.
.github/workflows/client-integration-tests.yml Comment-only clarification about extraction defaults and unit-test extraction behavior.

Copilot's findings

  • Files reviewed: 3/3 changed files
  • Comments generated: 2

@data-douser data-douser marked this pull request as ready for review April 7, 2026 02:14
@data-douser data-douser requested review from a team and enyil as code owners April 7, 2026 02:14
Copilot AI review requested due to automatic review settings April 7, 2026 02:14
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR optimizes how CodeQL test databases are extracted for MCP integration/unit testing and improves integration-test output determinism in the client/** test runner.

Changes:

  • Add a --scope option to server/scripts/extract-test-databases.sh, making “integration” (minimal) extraction the default while preserving “all” extraction.
  • Add pre-run cleanup of interpretedOutput in the JS IntegrationTestRunner to avoid stale directory/file comparisons.
  • Update the client integration tests GitHub Actions workflow comments to reflect the new default extraction behavior.
Show a summary per file
File Description
server/scripts/extract-test-databases.sh Introduces --scope and switches the default extraction behavior to a minimal integration-focused set.
client/src/lib/integration-test-runner.js Adds cleanup of stale interpretedOutput and adjusts .testproj path splitting to match fixture conventions.
.github/workflows/client-integration-tests.yml Updates comments clarifying default extraction scope and unit test behavior.

Copilot's findings

  • Files reviewed: 3/3 changed files
  • Comments generated: 2

@data-douser data-douser merged commit 5f88dc2 into main Apr 7, 2026
21 checks passed
@data-douser data-douser deleted the dd/optimize-test-db-extraction branch April 7, 2026 02:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

extract-test-databases.sh extracts databases for all languages but client integration tests only need JavaScript/examples

2 participants