Skip to content

test(workflows): name the condition-rejection tests for the real boundary - #3808

Open
jawwad-ali wants to merge 1 commit into
github:mainfrom
jawwad-ali:test/condition-rejection-test-names
Open

test(workflows): name the condition-rejection tests for the real boundary#3808
jawwad-ali wants to merge 1 commit into
github:mainfrom
jawwad-ali:test/condition-rejection-test-names

Conversation

@jawwad-ali

Copy link
Copy Markdown
Contributor

Small follow-up to #3706 (merged in a9c9905), addressing the last Copilot note on it. Test names only — no behaviour change.

Problem

#3706 landed a pair of tests in each of the three conditional step classes, and their names contradict each other:

def test_validate_rejects_non_string_condition(self, bad):        # [["a","b"], {"k":"v"}, 5, 1.5]
def test_validate_accepts_string_or_bool_condition(self, good):   # ["true", "false", "{{ ... }}", True, False]

A bool is a non-string, so the first name claims something the second one disproves. Copilot flagged exactly this on #3706 (three suppressed low-confidence notes on tests/test_workflows.py), but the review landed close to the merge, so it wasn't picked up:

This name says every non-string value is rejected, but the adjacent contract test verifies that booleans are accepted. Rename it to describe the actual non-string/non-boolean boundary so test reports do not contradict the behavior.

That's my leftover: when I updated the contract to accept booleans I renamed the acceptance test and missed its sibling.

Fix

test_validate_rejects_non_string_condition
  -> test_validate_rejects_non_string_non_bool_condition

in TestIfThenStep, TestWhileStep and TestDoWhileStep — matching the validator's own message, 'condition' must be a string or boolean, got <type>.

3 insertions, 3 deletions, one file. Parametrized values untouched; no source changes.

Why it's worth a PR

The names appear in every test report and in -k selections, so rejects_non_string reads as a contract the code deliberately does not implement — accepting bool is intentional (condition: false resolves correctly today, and two of the three steps default condition to the bool False themselves, so rejecting it would be a breaking change).

Verification


Written with assistance from Claude Code.

…dary

`test_validate_rejects_non_string_condition` contradicts its sibling
`test_validate_accepts_string_or_bool_condition` in the same class: a
bool *is* a non-string, so the two names disagree about the contract the
validator actually implements.

Rename to `test_validate_rejects_non_string_non_bool_condition` in all
three step classes, matching the validator's own message: "'condition'
must be a string or boolean, got <type>".

Test names only — no behaviour change, and the parametrized values are
untouched.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Renames three workflow validation tests to accurately describe the accepted string-or-boolean boundary.

Changes:

  • Clarifies rejection test names for if, while, and do-while steps.
  • Makes no behavioral changes.
Show a summary per file
File Description
tests/test_workflows.py Corrects three condition-validation test names.

Review details

Tip

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

  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Medium

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.

3 participants