Skip to content

ci: Skip test suite when no code files changed#5889

Draft
stephanie-anderson wants to merge 3 commits intomasterfrom
chore/skip-tests-with-code-unchanged
Draft

ci: Skip test suite when no code files changed#5889
stephanie-anderson wants to merge 3 commits intomasterfrom
chore/skip-tests-with-code-unchanged

Conversation

@stephanie-anderson
Copy link
Contributor

@stephanie-anderson stephanie-anderson commented Mar 26, 2026

Summary

  • Adds a changes detection job (using dorny/paths-filter) to all 16 test workflows and ci.yml
  • Test jobs are conditional on code-relevant files being modified: *.py, *.cfg, *.toml, *.ini, sentry_sdk/**, tests/**, scripts/**, Makefile, requirements*.txt, .github/workflows/**
  • PRs and pushes that only touch non-code files (e.g. README.md, LICENSE, CHANGELOG.md) skip the full test matrix
  • Gate jobs ("All X tests passed") now accept skipped as a valid result so required status checks still pass
  • Gate jobs also fail if the change detection job itself fails, preventing untested code from passing CI

Changes

  • Templates (base.jinja, test_group.jinja, check_required.jinja): Added changes job, conditional test execution, and skipped-aware gate checks
  • ci.yml: Same pattern applied to lint, build, and docs jobs
  • 15 generated test workflows: Regenerated from updated templates

Test plan

  • Open a test PR that only changes README.md → verify tests are skipped and gate jobs pass
  • Open a test PR that changes a .py file → verify tests run normally

Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com

Add a `changes` detection job using dorny/paths-filter to all test
workflows and ci.yml. Tests are only triggered when code-relevant
files are modified (*.py, *.cfg, *.toml, *.ini, sentry_sdk/**, tests/**,
scripts/**, Makefile, .github/workflows/**).

PRs that only touch non-code files (e.g. README.md) will skip the
full test matrix, saving CI resources. Pushes to master/release
branches always run the full suite.

The gate jobs ("All X tests passed") now accept `skipped` as a valid
result so required status checks still pass when tests are skipped.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Contributor

github-actions bot commented Mar 26, 2026

Semver Impact of This PR

🟢 Patch (bug fixes)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

Langchain

  • Set gen_ai.operation.name and gen_ai.pipeline.name on LLM spans by ericapisani in #5849
  • Broaden AI provider detection beyond OpenAI and Anthropic by ericapisani in #5707
  • Update LLM span operation to gen_ai.generate_text by ericapisani in #5796

Bug Fixes 🐛

Ci

  • Use gh CLI to convert PR to draft by stephanie-anderson in #5874
  • Use GitHub App token for draft PR enforcement by stephanie-anderson in #5871

Openai

  • Always set gen_ai.response.streaming for Responses by alexander-alderman-webb in #5697
  • Simplify Responses input handling by alexander-alderman-webb in #5695
  • Use max_output_tokens for Responses API by alexander-alderman-webb in #5693
  • Always set gen_ai.response.streaming for Completions by alexander-alderman-webb in #5692
  • Simplify Completions input handling by alexander-alderman-webb in #5690
  • Simplify embeddings input handling by alexander-alderman-webb in #5688

Other

  • (google-genai) Guard response extraction by alexander-alderman-webb in #5869
  • (workflow) Fix permission issue with github app and PR draft graphql endpoint by Jeffreyhung in #5887

Internal Changes 🔧

Langchain

  • Add text completion test by alexander-alderman-webb in #5740
  • Add tool execution test by alexander-alderman-webb in #5739
  • Add basic agent test with Responses call by alexander-alderman-webb in #5726
  • Replace mocks with httpx types by alexander-alderman-webb in #5724
  • Consolidate span origin assertion by alexander-alderman-webb in #5723
  • Consolidate available tools assertion by alexander-alderman-webb in #5721

Openai

  • Replace mocks with httpx types for streaming Responses by alexander-alderman-webb in #5882
  • Replace mocks with httpx types for streaming Completions by alexander-alderman-webb in #5879
  • Move input handling code into API-specific functions by alexander-alderman-webb in #5687

Other

  • (ai) Rename generate_text to text_completion by ericapisani in #5885
  • (asyncpg) Normalize query whitespace in integration by ericapisani in #5855
  • Skip test suite when no code files changed by stephanie-anderson in #5889
  • Exclude compromised litellm versions by alexander-alderman-webb in #5876
  • Reactivate litellm tests by alexander-alderman-webb in #5853
  • Add note to coordinate with assignee before PR submission by sentrivana in #5868
  • Temporarily stop running litellm tests by alexander-alderman-webb in #5851

Other

  • ci+docs: Add draft PR enforcement by stephanie-anderson in #5867

🤖 This preview updates automatically when you update the PR.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 26, 2026

Codecov Results 📊

13 passed | Total: 13 | Pass Rate: 100% | Execution Time: 7.88s

All tests are passing successfully.

✅ Patch coverage is 100.00%. Project has 14412 uncovered lines.


Generated by Codecov Action

stephanie-anderson and others added 2 commits March 26, 2026 19:44
- Add requirements*.txt to path filters so dependency changes trigger CI
- Gate job now also fails if the changes detection job itself fails,
  preventing untested code from passing CI when change detection errors

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Direct pushes to master are not allowed, so there's no need to
force-run the full suite on push events. The paths-filter action
now runs unconditionally for both push and pull_request events.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- '.github/workflows/**'
test-ai:
needs: changes
if: needs.changes.outputs.has_code_changes == 'true'
Copy link

Choose a reason for hiding this comment

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

Tests on master/release/major branches can be incorrectly skipped

The PR description states 'Pushes to master/release//major/ branches always run the full suite', but the test job's if condition (line 51) only checks needs.changes.outputs.has_code_changes == 'true' without considering the branch. This means pushes to protected branches that contain only non-code changes (e.g., a merge commit touching only docs) will skip tests, violating the stated requirement. The condition should include a bypass for push events to these protected branches.

Verification

Read the full workflow file (test-integrations-ai.yml) and both templates (base.jinja and test_group.jinja). Confirmed the if condition on line 51 is needs.changes.outputs.has_code_changes == 'true' with no branch-based exception. Cross-referenced with PR description which explicitly requires push events to master/release//major/ to always run tests. The dorny/paths-filter action does not automatically exempt certain branches from filtering.

Also found at 14 additional locations
  • .github/workflows/ci.yml:44-44
  • .github/workflows/test-integrations-agents.yml:51-51
  • .github/workflows/test-integrations-cloud.yml:51-51
  • .github/workflows/test-integrations-common.yml:51-51
  • .github/workflows/test-integrations-dbs.yml:51-51
  • .github/workflows/test-integrations-gevent.yml:51-51
  • .github/workflows/test-integrations-graphql.yml:51-51
  • .github/workflows/test-integrations-mcp.yml:51-51
  • .github/workflows/test-integrations-network.yml:51-51
  • .github/workflows/test-integrations-tasks.yml:51-51
  • .github/workflows/test-integrations-web-1.yml:51-51
  • .github/workflows/test-integrations-web-2.yml:51-51
  • .github/workflows/test-integrations-flags.yml:51-51
  • scripts/split_tox_gh_actions/templates/base.jinja:36-56

Identified by Warden code-review · G7J-P8F

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.

1 participant