Skip to content

Write 54 verify scripts as assertions - #1421

Merged
slachiewicz merged 1 commit into
masterfrom
agent/verify-assert
Oct 10, 2026
Merged

slachiewicz merged 1 commit into
masterfrom
agent/verify-assert

Conversation

@slachiewicz

Copy link
Copy Markdown
Member

Part of #1414. 54 verify scripts read a file, looked for a string with indexOf and on a mismatch printed a message and returned false, inside a try that turned any exception into false as well. They are now one assert per check with the original message, so a failure shows the expression and the value, and an exception surfaces with its stack trace instead of a bare false. The checks and their encodings are unchanged; indexOf(x) < 0 became contains(x) and indexOf(x) >= 0 or > 0 became !contains(x).

The conversion was scripted and only touched scripts that consist of nothing else. The remaining 36 old-style scripts use regular expressions, the build log or the HTML reports and get a separate PR.

Verified: the 54 ITs with mvn -P run-its verify -Dinvoker.test=โ€ฆ โ†’ all pass (it-rules-via-classpath-003 together with setup-provide-rules-in-jar); changing the expected value in it-resolve-ranges-002 fails with AssertionError: Version of api not resolved to 2.0. Expression: buf.contains(<api>9.9</api>)

They read a file and checked indexOf, printing a message and returning
false on a mismatch. An assert with the same message also reports the
expression and the value that failed. Part of #1414.
@slachiewicz slachiewicz added the maintenance Cleanup, refactoring or other internal change label Oct 10, 2026
@slachiewicz
slachiewicz marked this pull request as ready for review October 10, 2026 15:59
@slachiewicz
slachiewicz merged commit 9effdd9 into master Oct 10, 2026
15 checks passed
@slachiewicz
slachiewicz deleted the agent/verify-assert branch October 10, 2026 16:34
@github-actions github-actions Bot added this to the 2.22.1 milestone Oct 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Cleanup, refactoring or other internal change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant