Skip to content

test: fix vacuous tests in tests/compiler_tests.rs#702

Merged
jamesadevine merged 1 commit into
mainfrom
test-reducer/compiler-tests-vacuous-985ce7a2052167fd
May 22, 2026
Merged

test: fix vacuous tests in tests/compiler_tests.rs#702
jamesadevine merged 1 commit into
mainfrom
test-reducer/compiler-tests-vacuous-985ce7a2052167fd

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

Test Suite Reduction: tests/compiler_tests.rs

What was wrong

  • test_compile_pipeline_basic: Never invoked the compiler binary. It wrote a .md file to a temp directory, then only asserted that fs::write() and fs::create_dir_all() had done their jobs — exercising zero production code. The test's own comments acknowledged this ("For now, verify that test setup works"). test_compiled_output_no_unreplaced_markers already covers real compilation.

  • test_filename_edge_cases: Never called any sanitize function. It iterated over hard-coded (input, expected) string pairs and asserted that each expected string was non-empty and contained no spaces — assertions that trivially pass for the hard-coded test data regardless of any implementation change. The input values were never used.

  • test_network_allow_valid_wildcard_compiles: Only asserted output.status.success(). While running the compiler is better than not running it, an exit-code-only check cannot detect regressions where the custom domains are silently dropped from the allow-list output.

Changes

Test Action Reason
test_compile_pipeline_basic Removed Vacuous — only exercised std::fs, not the compiler
test_filename_edge_cases Removed Vacuous — assertions on hard-coded expected strings, not function output
test_network_allow_valid_wildcard_compiles Strengthened Added assertions that *.mycompany.com and api.external-service.com appear in the compiled YAML allow-list

Verification

  • 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:

  • dev.azure.com

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

network:
  allowed:
    - defaults
    - "dev.azure.com"

See Network Configuration for more information.

Generated by Test Reducer · ● 20M ·

- Remove test_compile_pipeline_basic: never invoked the compiler; only
  asserted that fs::write() and fs::create_dir_all() worked, exercising
  no production code.
- Remove test_filename_edge_cases: never called any sanitize function;
  iterated over hard-coded (input, expected) pairs and asserted trivial
  properties of the expected strings, which can never fail.
- Strengthen test_network_allow_valid_wildcard_compiles: previously only
  checked exit-code success; now also reads the compiled YAML and asserts
  that both custom domains (*.mycompany.com, api.external-service.com)
  appear in the allow-list output.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@jamesadevine jamesadevine marked this pull request as ready for review May 22, 2026 18:19
@jamesadevine jamesadevine merged commit 2a0c042 into main May 22, 2026
@jamesadevine jamesadevine deleted the test-reducer/compiler-tests-vacuous-985ce7a2052167fd branch May 22, 2026 18:19
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