Skip to content

test: fix redundant assertions in compiler_tests.rs - #1755

Closed
github-actions[bot] wants to merge 1 commit into
mainfrom
test-reducer/fix-redundant-assertions-431b5c8c922ca048
Closed

test: fix redundant assertions in compiler_tests.rs#1755
github-actions[bot] wants to merge 1 commit into
mainfrom
test-reducer/fix-redundant-assertions-431b5c8c922ca048

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Test Suite Reduction: tests/compiler_tests.rs

What was wrong

  • test_compiled_output_no_unreplaced_markers (assertion 1): !compiled.contains("AWF_VERSION=\"0.27.9\"") is always true while the companion compiled.contains("AWF_VERSION=\"0.27.32\"") passes. AWF_VERSION is a single compile-time constant in src/compile/common.rs — if the correct version is present, the wrong version cannot also be present. The negative check adds no detection value.
  • test_compiled_output_no_unreplaced_markers (assertion 2): The for-loop asserting !line.contains("host.docker.internal") over every --allow-domains line is a strict subset of the global !compiled.contains("host.docker.internal") assertion immediately above it. If the global check passes, the per-line loop is trivially satisfied; if the global check fails the test already aborts.
  • test_example_dogfood_failure_reporter_structure: Reads examples/dogfood-failure-reporter.md and asserts on front-matter string patterns without compiling the file. This exercises no compiler behaviour — the same vacuous pattern as test_example_file_structure, which was removed in a prior test-reducer run.

Changes

Test Action Reason
test_compiled_output_no_unreplaced_markers Removed stale-version negative assertion Redundant — positive version check already excludes any other version
test_compiled_output_no_unreplaced_markers Removed --allow-domains per-line loop Strict subset of global host.docker.internal check above it
test_example_dogfood_failure_reporter_structure Removed Vacuous — reads example file for string patterns, exercises no compiler behaviour

Verification

  • cargo test: all tests pass ✅
  • cargo check --tests: no errors ✅

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • spsprodeus21.vssps.visualstudio.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "spsprodeus21.vssps.visualstudio.com"

See Network Configuration for more information.

Generated by Test Reducer · 336.5 AIC · ⌖ 12.5 AIC · ⊞ 8.8K ·

- Remove !compiled.contains("AWF_VERSION=\"0.27.9\"") assertion in
  test_compiled_output_no_unreplaced_markers: always true while the
  companion positive check on 0.27.32 passes, since AWF_VERSION is a
  single constant in common.rs.
- Remove the for-loop checking !line.contains("host.docker.internal")
  over --allow-domains lines: a strict subset of the global
  !compiled.contains("host.docker.internal") assertion immediately above.
- Remove test_example_dogfood_failure_reporter_structure: reads the
  example file for front-matter strings without compiling it — same
  vacuous pattern as test_example_file_structure (removed in a prior run).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
2 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@jamesadevine

Copy link
Copy Markdown
Collaborator

Triage note (automated-PR sweep): not merging as-is. The AWF/host assertions removed here are genuinely redundant, but the PR also deletes the dogfood-failure-reporter test, which provides real example-content coverage. Please drop that deletion and keep only the redundant-assertion cleanup.

@jamesadevine

Copy link
Copy Markdown
Collaborator

Closing rather than holding open for rework: the redundant-assertion cleanup here is entangled with deletion of the dogfood-failure-reporter test, which is real coverage. Cleaner for the test-reducer workflow to regenerate a scoped PR than to rebase this one.

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.

1 participant