test: fix vacuous tests in tests/compiler_tests.rs#702
Merged
jamesadevine merged 1 commit intoMay 22, 2026
Conversation
- 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>
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:
tests/compiler_tests.rsWhat was wrong
test_compile_pipeline_basic: Never invoked the compiler binary. It wrote a.mdfile to a temp directory, then only asserted thatfs::write()andfs::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_markersalready covers real compilation.test_filename_edge_cases: Never called any sanitize function. It iterated over hard-coded(input, expected)string pairs and asserted that eachexpectedstring was non-empty and contained no spaces — assertions that trivially pass for the hard-coded test data regardless of any implementation change. Theinputvalues were never used.test_network_allow_valid_wildcard_compiles: Only assertedoutput.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_compile_pipeline_basicstd::fs, not the compilertest_filename_edge_casestest_network_allow_valid_wildcard_compiles*.mycompany.comandapi.external-service.comappear in the compiled YAML allow-listVerification
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.comSee Network Configuration for more information.