Skip to content

Add test: dry-run quarantines failing tests without uploading - #1155

Merged
trunk-io[bot] merged 1 commit into
mainfrom
test-dry-run-quarantining
Aug 10, 2026
Merged

Add test: dry-run quarantines failing tests without uploading#1155
trunk-io[bot] merged 1 commit into
mainfrom
test-dry-run-quarantining

Conversation

@dfrankland

Copy link
Copy Markdown
Member

Summary

Adds dry_run_quarantines_failing_test_without_uploading to cli/tests/upload.rs, covering a previously untested combination: upload --dry-run with quarantining enabled.

The only existing dry-run test (upload_bundle_using_dry_run) explicitly disables quarantining and uses all-passing fixtures, so nothing pinned down the behavior of using dry-run to quarantine without uploading.

What it verifies

  • A failing test that the server marks as quarantined results in exit code 0 under --dry-run (the same failing JUnit produces a failure exit code in uses_failure_exit_code_if_unquarantined_tests_fail when nothing is quarantined).
  • The quarantine-config query still runs under dry-run — the mock server records exactly one request, and it is GetQuarantineConfig.
  • No CreateBundleUpload, S3Upload, or TelemetryUploadMetrics requests are made.
  • The locally written bundle's meta.json records the quarantined test by name.

The mock quarantine handler records its request into state.requests (the stock closure handlers used elsewhere don't), so the test can assert the quarantine query is the only network call.

Test plan

  • cargo test -p trunk-analytics-cli --test upload dry_run_quarantines_failing_test_without_uploading passes locally.

🤖 Generated with Claude Code

Covers the combination of --dry-run with quarantining enabled: a failing
test marked for quarantine by the server overrides the exit code to 0,
the quarantine-config endpoint is the only request made (no bundle
upload or telemetry), and the locally written meta.json records the
quarantined test.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@trunk-io

trunk-io Bot commented Aug 10, 2026

Copy link
Copy Markdown

😎 Merged directly without going through the merge queue, as the queue was empty and the PR was up to date with the target branch - details.

@codecov-commenter

codecov-commenter commented Aug 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.33%. Comparing base (da95686) to head (2a15d3a).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1155      +/-   ##
==========================================
+ Coverage   82.97%   83.33%   +0.36%     
==========================================
  Files          71       71              
  Lines       16044    16044              
==========================================
+ Hits        13312    13371      +59     
+ Misses       2732     2673      -59     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@trunk-staging-io

trunk-staging-io Bot commented Aug 10, 2026

Copy link
Copy Markdown

Static BadgeStatic BadgeStatic Badge

Failed Test Failure Summary Logs
pending_quarantine_test should be quarantined when run with variant A test marked as pending was expected to fail but unexpectedly passed. Logs ↗︎
variant_quarantine_test should be quarantined when run with variant A test expected the sum of 2 + 2 to be 5, but it was actually 4, indicating a failing assertion. Logs ↗︎

View Full Report ↗︎Docs

@trunk-io

trunk-io Bot commented Aug 10, 2026

Copy link
Copy Markdown

Static BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

@trunk-io
trunk-io Bot merged commit 64052e5 into main Aug 10, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants