Skip to content

ci: fix integration test skips and centralize core pattern#3401

Open
anubhav756 wants to merge 1 commit into
mainfrom
anubhav-shards
Open

ci: fix integration test skips and centralize core pattern#3401
anubhav756 wants to merge 1 commit into
mainfrom
anubhav-shards

Conversation

@anubhav756

@anubhav756 anubhav756 commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Description

Currently, the integration tests on Cloud Build suffer from regex evaluation and maintainability issues within .ci/integration.cloudbuild.yaml:

  1. Core file and shared utility modifications (such as internal/util/parameters/parameters.go in fix: escape delimiter characters in applyEscape to prevent SQL injection #2811) skip many integration test shards because their PATTERN only looked for specific database source paths.
  2. Shards like mysql and mssql used unanchored substring matching (mysql|), which accidentally triggered them whenever their Cloud SQL counterparts (cloudsqlmysql, cloudsqlmssql) were edited, leading to redundant/incorrect test runs.
  3. Appending a massive core logic regex to 47 different shards creates a massive maintenance burden and violates DRY.

Changes

  • Created a centralized .ci/core_pattern.txt file that contains core path regex (covering internal/server/, internal/util/, internal/auth/, etc.).
    • Every test shard now dynamically reads this via $$(cat .ci/core_pattern.txt), cleaning up the YAML file.
  • Added Path Boundary Anchors (^|/) to all integration-specific regex terms (e.g., mysql is now (^|/)mysql/).
    • This eliminates substring leaks while preserving intentional file sharing (such as base postgres/ changes correctly triggering alloydb, alloydb-pg, and cloud-sql-pg shards).

Checklist

  • Make sure to open an issue as a bug/issue before writing your code!
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)
  • Make sure to add ! if this involves a breaking change

@anubhav756 anubhav756 requested a review from a team as a code owner June 11, 2026 12:35
@anubhav756 anubhav756 self-assigned this Jun 11, 2026

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request updates the file-change detection patterns across all 47 test shards in .ci/integration.cloudbuild.yaml to include additional core directories and files. The review feedback correctly points out a significant amount of duplication introduced by this change and suggests a maintainable, DRY alternative: writing the shared core pattern to a file in an initial step and reading it dynamically in each shard.

Comment thread .ci/integration.cloudbuild.yaml Outdated
@anubhav756 anubhav756 changed the title ci: fix integration test skips for core files ci: fix integration test skips and centralize core pattern Jun 11, 2026
@anubhav756 anubhav756 force-pushed the anubhav-shards branch 3 times, most recently from 0d817cb to 2a4f573 Compare June 12, 2026 04:44
@duwenxin99 duwenxin99 removed their assignment Jun 12, 2026
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.

3 participants