Skip to content

[SDTEST-4061] [SDTEST-4062] Add Swift test automation exclusions - #329

Merged
calvinbayer merged 7 commits into
mainfrom
codex/critical-test-annotations-swift
Nov 2, 2026
Merged

calvinbayer merged 7 commits into
mainfrom
codex/critical-test-annotations-swift

Conversation

@calvinbayer

@calvinbayer calvinbayer commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

What and why?

Allow XCTest and Swift Testing tests to opt out of Datadog automatic retries and failure suppression, per the Shepherd exclusion contract.

  • Non-retriable tests (existing retriable tag set to false / .dd.nonretriable) are excluded from Auto Test Retries, Early Flake Detection and Attempt to Fix. Quarantine and disabling still apply to them.
  • Prevent failure suppression (new tag) stops quarantine and disabling from controlling a test: a disabled test runs and its failure stays blocking. Retries remain available.

Both can be declared on a suite (type) and overridden on a single test.

Implements SDTEST-4061 and SDTEST-4062.

How?

  • Reuse the existing RetriableTag instead of a separate retry opt-out tag. Non-retriable tests report test.test_management.no_auto_retry: true.
  • Add PreventFailureSuppressionTag:
    • XCTest: TypeTag.preventFailureSuppression and InstanceMethodTag.preventFailureSuppression (a method tag overrides the type tag), with ObjC bridges DDTag.preventFailureSuppressionType / DDTag.preventFailureSuppressionInstanceMethod.
    • Swift Testing: .dd.preventFailureSuppression and .dd.allowFailureSuppression, so a test or nested suite can re-allow suppression.
    • Reports test.test_management.prevent_failure_suppression: true.
  • Swift Testing tags are now resolved in declaration order (outer suite first, test last), so the most specific declaration wins. Previously the positive tag always won, so a test-level .dd.nonretriable / .dd.tia.unskippable could not override a suite-level .dd.retriable / .dd.tia.skippable. That now works too.
  • Test Management applies the tags to the backend assignment in one place (Test.applying(tags:)): Attempt to Fix is dropped for non-retriable tests before disabled/quarantined are resolved, and protected tests are excluded from disabling and quarantine. Backend-assigned is_quarantined / is_test_disabled / is_attempt_to_fix tags are still reported.
  • Fix DDTag.retriableType / DDTag.retriableInstanceMethod, which returned the TIA skippable tags.
  • Add Xcode 27.1 / 27.2 Swift versions to RuntimeInfo.
  • Document both frameworks in the README.

Unit tests (DatadogSDKTestingTests, macOS) pass locally.

Review checklist

  • Feature or bugfix MUST have appropriate tests (unit, integration)
  • Make sure each commit and the PR mention the Issue number or JIRA reference

🤖 Generated with Claude Code

@calvinbayer
calvinbayer requested review from a team and ypopovych as code owners November 2, 2026 10:52
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-02T14:46:44.231027Z 2ea6118 New commits
🔒 Security Review ✅ Completed 2026-11-02T14:44:15.104472Z 2ea6118 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@calvinbayer

Copy link
Copy Markdown
Contributor Author

@autotest Review

@datadog-datadog-prod-us1 datadog-datadog-prod-us1 Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bits Code Review: FAIL

The new ATR exclusion guard removes Swift’s implicit return, causing a missing-return compilation error that prevents SDK source builds.

Open Bits AI session

🤖 Bits Code Review · Commit d55ae74

@datadog-datadog-prod-us1 datadog-datadog-prod-us1 Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bits Code Review: FAIL

The ATR configuration hook no longer compiles because the new exclusion guard requires an explicit return on the retry path. This blocks SDK builds even when no test uses the new annotations.

Open Bits AI session

🤖 Bits Code Review · Commit d55ae74

@calvinbayer

Copy link
Copy Markdown
Contributor Author

@autotest Review

@datadog-datadog-prod-us1 datadog-datadog-prod-us1 Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bits Code Review: PASS

More details

The exclusion paths preserve framework-native behavior and backend assignment tags while overriding Datadog retry and failure-suppression policies. Apple-platform compilation and runtime behavior remain unverified.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit c208768

ypopovych and others added 4 commits November 2, 2026 14:35
…DTEST-4061)

DDTag.retriableType and DDTag.retriableInstanceMethod returned the TIA
skippable tags, so Objective-C tests couldn't declare retriable tags.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ion tags (SDTEST-4061, SDTEST-4062)

- Drop the separate noAutoRetry tag: non-retriable tests are the
  `no_auto_retry` annotation. Report `test.test_management.no_auto_retry`
  for them and exclude them from Attempt to Fix before resolving
  disabled/quarantined properties.
- Add type-level `preventFailureSuppression` tag for XCTest (Swift and ObjC)
  with method-level override, same as `retriable`.
- Add `.dd.allowFailureSuppression` Swift Testing tag to override
  `.dd.preventFailureSuppression` of a parent suite.
- Resolve Swift Testing tags in declaration order so the most specific
  declaration wins. Test-level `.dd.nonretriable` and `.dd.tia.unskippable`
  now override suite-level positive tags too.
- Apply test annotations to Test Management properties in one place.
- Fix README examples (internal Selector-based tagger API) and document
  suite-level declarations and overrides.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…61, SDTEST-4062)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ypopovych

Copy link
Copy Markdown
Contributor

@autotest review

@datadog-datadog-prod-us1 datadog-datadog-prod-us1 Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bits Code Review: PASS

More details

The retry and failure-suppression exclusions remain independent, and backend assignment tags are preserved. Runtime behavior remains unverified because macOS/Xcode tests could not run in the Linux sandbox.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit 2ea6118

@calvinbayer
calvinbayer merged commit 45fea1c into main Nov 2, 2026
16 checks passed
@calvinbayer
calvinbayer deleted the codex/critical-test-annotations-swift branch November 2, 2026 15:21
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.

2 participants