test: fix low-value assertions in ado_script github-app-token tests#1553
Merged
jamesadevine merged 1 commit intoJul 21, 2026
Merged
Conversation
- github_app_token_step_rejects_invalid_config: replace bare is_err()
with unwrap_err() + assert error message contains 'app-id' so a
regression that silently accepts invalid config cannot go unnoticed.
- github_app_token_revoke_step_rejects_invalid_config: same treatment;
assert error message contains 'api-url' and 'https://' confirming the
http-only URL is rejected for the right reason.
- github_app_token_eval_path_consistent_with_download_dir: add
ends_with("github-app-token.js") assertion to match the style of the
parallel prepare_pr_base_path_consistent_with_download_dir test;
without it, a filename regression would pass unnoticed.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
jamesadevine
marked this pull request as ready for review
July 21, 2026 13:44
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Test Suite Reduction:
src/compile/extensions/ado_script.rsWhat was wrong
github_app_token_step_rejects_invalid_config: Asserted onlyis_err()— if the validation were accidentally removed, the test would fail with a panic on the subsequentunwrap(), but would give no signal about which invariant was violated. Anis_err()assertion on a function that must reject a specific invalid shape (app_idcontaining a space) should also confirm the error message, to guard against a regression where the wrong validation fires (e.g. the config is rejected for a different reason).github_app_token_revoke_step_rejects_invalid_config: Same problem — bareis_err()with no message check. The config uses an `(redacted) URL; the test should assert the rejection is specifically about the scheme, to prevent a regression where validation is reorganised and the wrong guard rejects the config for an unrelated reason.github_app_token_eval_path_consistent_with_download_dir: Only assertedstarts_with("/tmp/ado-aw-scripts/ado-script/"). The parallel testprepare_pr_base_path_consistent_with_download_dirasserts bothstarts_withandends_with("prepare-pr-base.js"). Without theends_withguard, a rename of the bundle file (e.g.github-app-token.js→gh-app-token.js) would compile and pass all tests while silently breaking the bundle invocation path.Changes
github_app_token_step_rejects_invalid_configis_err()— no error-message guardgithub_app_token_revoke_step_rejects_invalid_configis_err()— no error-message guardgithub_app_token_eval_path_consistent_with_download_dirends_with— filename regression undetectableVerification
cargo test: all tests pass ✅cargo check: no errors ✅Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
spsprodeus21.vssps.visualstudio.comSee Network Configuration for more information.