Skip to content

feat: add test_step_outcome input to detect silent test failures#169

Closed
jd wants to merge 1 commit intomainfrom
devs/jd/worktree-test-code-exit/Ibab2d1e5546eadafe040e01c4a7483735a8bcce7
Closed

feat: add test_step_outcome input to detect silent test failures#169
jd wants to merge 1 commit intomainfrom
devs/jd/worktree-test-code-exit/Ibab2d1e5546eadafe040e01c4a7483735a8bcce7

Conversation

@jd
Copy link
Copy Markdown
Member

@jd jd commented Apr 2, 2026

Allow users to pass the outcome of their test runner step so the CLI
can detect cases where the runner crashed but the JUnit report looks
clean. Maps success→0, failure/cancelled→1, omitted→empty (ignored).

Allow users to pass the outcome of their test runner step so the CLI
can detect cases where the runner crashed but the JUnit report looks
clean.  Maps success→0, failure/cancelled→1, omitted→empty (ignored).

Change-Id: Ibab2d1e5546eadafe040e01c4a7483735a8bcce7
Copilot AI review requested due to automatic review settings April 2, 2026 14:50
@mergify mergify bot had a problem deploying to Mergify Merge Protections April 2, 2026 14:50 Failure
@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Apr 2, 2026

Merge Protections

Your pull request matches the following merge protections and will not be merged until they are valid.

🔴 🤖 Continuous Integration

This rule is failing.
  • all of:
    • check-success=all-greens

🔴 👀 Review Requirements

This rule is failing.
  • any of:
    • #approved-reviews-by>=1
    • author = dependabot[bot]
    • author = mergify-ci-bot
    • author = renovate[bot]

🔴 🔎 Reviews

This rule is failing.
  • #review-threads-unresolved = 0
  • #changes-requested-reviews-by = 0
  • #review-requested = 0

🟢 Enforce conventional commit

Wonderful, this rule succeeded.

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert)(?:\(.+\))?:

🟢 📕 PR description

Wonderful, this rule succeeded.
  • body ~= (?ms:.{48,})

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new optional action input that lets workflows pass the test runner step outcome so the junit-process CLI invocation can detect “silent” test runner crashes even when JUnit output looks clean.

Changes:

  • Document a new test_step_outcome input in the action docs.
  • Add test_step_outcome input to action.yml.
  • Map the input to MERGIFY_TEST_EXIT_CODE for the junit-process step via a GitHub Actions expression.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
README.md Documents the new test_step_outcome input in the auto-generated Inputs section.
action.yml Adds the test_step_outcome input and derives MERGIFY_TEST_EXIT_CODE from it for junit-process.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

MERGIFY_API_URL: ${{ inputs.mergify_api_url }}
MERGIFY_TOKEN: ${{ inputs.token }}
MERGIFY_JOB_NAME: ${{ inputs.job_name }}
MERGIFY_TEST_EXIT_CODE: ${{ inputs.test_step_outcome == 'success' && '0' || inputs.test_step_outcome && '1' || '' }}
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

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

The expression sets MERGIFY_TEST_EXIT_CODE to 1 for any non-empty test_step_outcome that isn't exactly success. If users pass steps.<id>.outcome, GitHub can return skipped, which would currently be treated as a failure. Consider explicitly mapping only failure/cancelled to 1 and treating skipped (and empty) as '' (ignored), and/or add an input validation check that errors on unexpected values to avoid silent misclassification.

Suggested change
MERGIFY_TEST_EXIT_CODE: ${{ inputs.test_step_outcome == 'success' && '0' || inputs.test_step_outcome && '1' || '' }}
MERGIFY_TEST_EXIT_CODE: ${{ inputs.test_step_outcome == 'success' && '0' || (inputs.test_step_outcome == 'failure' || inputs.test_step_outcome == 'cancelled') && '1' || '' }}

Copilot uses AI. Check for mistakes.
Outcome of the test runner step (e.g. steps.<id>.outcome).
Pass this to detect silent failures where the test runner crashed
but the JUnit report appears clean.
Values: 'success', 'failure', 'cancelled', or omit entirely.
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

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

The documented allowed values omit skipped, but steps.<id>.outcome can be skipped. If skipped is expected to be ignored (similar to omitting the input), it should be documented here and handled consistently by the env var mapping.

Suggested change
Values: 'success', 'failure', 'cancelled', or omit entirely.
Values: 'success', 'failure', 'cancelled', 'skipped', or omit entirely. 'skipped' is treated the same as omitting this input.

Copilot uses AI. Check for mistakes.
# Outcome of the test runner step (e.g. steps.<id>.outcome).
# Pass this to detect silent failures where the test runner crashed
# but the JUnit report appears clean.
# Values: 'success', 'failure', 'cancelled', or omit entirely.
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

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

This input documentation lists success, failure, and cancelled, but steps.<id>.outcome can also be skipped. If users pass steps.<id>.outcome directly, skipped would currently be treated as a failure by the action’s mapping. Please document how skipped should be handled and keep it consistent with action.yml.

Suggested change
# Values: 'success', 'failure', 'cancelled', or omit entirely.
# Values: 'success', 'failure', 'cancelled', 'skipped', or omit entirely.
# 'skipped' is supported when passing steps.<id>.outcome directly.

Copilot uses AI. Check for mistakes.
@jd jd closed this Apr 2, 2026
@jd jd deleted the devs/jd/worktree-test-code-exit/Ibab2d1e5546eadafe040e01c4a7483735a8bcce7 branch April 2, 2026 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants