Skip to content

Report framework-confirmed empty test executions as skipped - #321

Closed
juan-fernandez wants to merge 4 commits into
mainfrom
juan-fernandez/swift-confirmed-empty-sessions
Closed

juan-fernandez wants to merge 4 commits into
mainfrom
juan-fernandez/swift-confirmed-empty-sessions

Conversation

@juan-fernandez

Copy link
Copy Markdown
Contributor

What and why?

Successful executions with no selected tests can leave their module and session reported as passed. Report framework-confirmed empty executions as skipped, with an explanation, without treating missing SDK events alone as proof that no tests ran.

How?

  • Swift Testing confirms emptiness when a suite scope completes normally without entering test scopes, including when all children are disabled. XCTest uses a completed, successful run with zero executions.
  • Skip a module only when all its suites are confirmed empty. Skip a session only when all its modules are skipped. Preserve failures and passing or incomplete siblings.
  • Add test.skip_reason to confirmed-empty modules and sessions, and test.session.empty_reason:zero_tests to confirmed-empty sessions. Empty suite events remain suppressed.
  • Add synthetic regression tests for both framework paths, scope failures, mixed modules, incomplete suites, and missing test events without framework confirmation.

Validation: Swift syntax parsing and git diff --check passed. Native SDK tests could not run locally because only Command Line Tools are installed; full Xcode is required. Runtime verification remains pending.

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

@juan-fernandez

Copy link
Copy Markdown
Contributor Author

/datadog autotest review
@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 29, 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-09-29T13:30:47.152184Z b6a4b06 Manual request
ℹ️ 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.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: d6fc63d513

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@datadog-datadog-us1-prod datadog-datadog-us1-prod 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

A registered Swift Testing suite that never enters its scope is invisible to the module’s emptiness tally, allowing teardown to report an incomplete module and session as skipped with zero_tests.

Open Bits AI session

🤖 Bits Code Review · Commit d6fc63d · @DataDog review to ask questions

@juan-fernandez

Copy link
Copy Markdown
Contributor Author

/datadog autotest review
@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: b6a4b0682a

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@datadog-datadog-us1-prod datadog-datadog-us1-prod 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

Empty classification requires completed framework evidence—zero XCTest executions or normal Swift Testing scope completion without tests—while failures, incomplete suites, and mixed modules remain non-empty.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit b6a4b06 · @DataDog review to ask questions

@juan-fernandez
juan-fernandez marked this pull request as ready for review September 29, 2026 13:33
@juan-fernandez
juan-fernandez requested review from a team and ypopovych as code owners September 29, 2026 13:33

@datadog-datadog-us1-prod datadog-datadog-us1-prod 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

Framework-confirmed emptiness gates skip propagation while failed, passing, and incomplete siblings retain their existing status; no reportable regression was identified.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit b6a4b06 · @DataDog review to ask questions

Share the skip/empty reason values as DDTagValues constants, read module
state once at teardown, and deduplicate helpers in the new tests.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@ypopovych

ypopovych commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

It has more edge cases: crash will create empty suites after the restart for all already passed suites, Swift Testing can have suite hierarchy with wrapper suites with zero tests in them. It needs more complex solution. Created SDTEST-3983 to track the problem.

@ypopovych ypopovych closed this Oct 1, 2026
@ypopovych
ypopovych deleted the juan-fernandez/swift-confirmed-empty-sessions branch October 1, 2026 11:53
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