test: reduce and improve tests in fuzzy_schedule and dotnet#906
Merged
jamesadevine merged 1 commit intoJun 8, 2026
Merged
Conversation
fuzzy_schedule.rs:
- test_cron_format: add assertions that day-of-month, month, and
day-of-week fields are '*' for a Daily schedule. Without these, a
regression that added a day-of-week or day-of-month constraint would
silently turn a daily schedule into a weekly or monthly one.
- test_generate_schedule_yaml / test_generate_schedule_yaml_with_branches:
add 'assert!(yaml.contains("always: true"))'. The 'always: true' flag
is load-bearing — without it ADO only fires the schedule when the
target branch has new commits, silently skipping unconditional runs.
Removing it from the template would pass the old tests undetected.
dotnet/extension.rs:
- Remove test_validate_global_json_sentinel_skips_injection_check.
The assertion 'is_ok()' is vacuous: 'global.json' contains no
injection characters, so validate() returns Ok regardless of whether
the sentinel bypass exists. The stronger
test_validate_global_json_sentinel_accepted_with_file_present already
covers the meaningful scenario (compile_dir contains global.json,
sentinel version resolves the conflict).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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/fuzzy_schedule.rs+src/runtimes/dotnet/extension.rsWhat was wrong
test_cron_format(fuzzy_schedule.rs): only validated the minute (0–59) and hour (0–23) fields of the generated cron expression for aDailyschedule. The last three fields (day-of-month, month, day-of-week) were unchecked — a regression that added a day-of-week or day-of-month constraint would silently convert a daily schedule into a weekly or monthly one without any test failure.test_generate_schedule_yaml(fuzzy_schedule.rs):always: truewas not asserted. That flag is load-bearing: without it, ADO only fires the schedule when the target branch has new commits since the last run. Removing it from the template would cause pipelines to silently skip unconditional runs, and the old test would not catch it.test_generate_schedule_yaml_with_branches(fuzzy_schedule.rs): same missingalways: trueassertion as above.test_validate_global_json_sentinel_skips_injection_check(dotnet/extension.rs): the sole assertion wasis_ok(). Sinceglobal.jsoncontains no injection characters ($(,${{,$[,##vso[,{{, or newlines),validate()returnsOkregardless of whether the sentinel bypass exists. The test would pass even if the sentinel recognition code was deleted. This is a strict subset of the strongertest_validate_global_json_sentinel_accepted_with_file_present, which exercises the meaningful scenario (compile directory contains aglobal.jsonfile and the sentinel version resolves the conflict).Changes
test_cron_formatfuzzy_schedule.rsassert_eq!(parts[2], "*"),assert_eq!(parts[3], "*"),assert_eq!(parts[4], "*")test_generate_schedule_yamlfuzzy_schedule.rsassert!(yaml.contains("always: true"))test_generate_schedule_yaml_with_branchesfuzzy_schedule.rsassert!(yaml.contains("always: true"))test_validate_global_json_sentinel_skips_injection_checkdotnet/extension.rsis_ok()always true; strict subset oftest_validate_global_json_sentinel_accepted_with_file_presentVerification
cargo test: all 1 761 + integration tests pass ✅cargo clippy --all-targets --all-features: no warnings ✅Warning
Firewall blocked 2 domains
The following domains were blocked by the firewall during workflow execution:
spsprodeus21.vssps.visualstudio.comspsprodweu4.vssps.visualstudio.comSee Network Configuration for more information.