Skip to content

Add more tests#670

Merged
MatthewMckee4 merged 11 commits intomainfrom
test/consolidated-audit
Apr 12, 2026
Merged

Add more tests#670
MatthewMckee4 merged 11 commits intomainfrom
test/consolidated-audit

Conversation

@MatthewMckee4
Copy link
Copy Markdown
Member

@MatthewMckee4 MatthewMckee4 commented Apr 11, 2026

Summary

Adds integration tests for CLI flag parsing, configuration discovery, test discovery edge cases, --last-failed interactions, and filter expressions. Also adds unit tests to karva_metadata, karva_cache, karva_project, and karva_logging. Removes a handful of tests that duplicated existing snapshot coverage.

Test Plan

  • just test
  • uvx prek run -a

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Apr 11, 2026

Merging this PR will degrade performance by 12.49%

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

❌ 1 regressed benchmark

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
WallTime karva_benchmark 22.4 s 25.6 s -12.49%

Comparing test/consolidated-audit (1761045) with main (816cf55)

Open in CodSpeed

@MatthewMckee4 MatthewMckee4 force-pushed the test/consolidated-audit branch from c312ef1 to ccee0f2 Compare April 11, 2026 19:29
@MatthewMckee4 MatthewMckee4 changed the title test: expand integration and unit coverage Add more tests Apr 12, 2026
@MatthewMckee4 MatthewMckee4 removed the rust Pull requests that update rust code label Apr 12, 2026
…r coverage

Removes two non-snapshot fail-fast tests in basic.rs that duplicated the
existing snapshot-based coverage, deletes trivial unit tests in
function_kind.rs and a helper-formula test module in orchestration.rs that
was testing a copy of the production logic, and adds an integration test
covering the last-failed plus filterset workflow.
Adds 32 new integration tests covering CLI flag combinations and
orchestration behaviours that were either untested or only had a happy
path. The additions are spread across basic, last_failed, configuration,
and a new discovery/edge_cases module.
Follow-up to the consolidated audit: converts hand-written assert_eq!
assertions in the newly added karva_logging, karva_project, karva_metadata,
and karva_cache unit tests to insta inline snapshots where snapshots add
value. Single-value primitive checks (booleans, matches!, length counts)
and filesystem existence checks are left as-is.
Converts `filter_traceback`, `parse_traceback_line`,
`get_traceback_location`, and `calculate_line_range` unit tests to
inline snapshots. These assert on multi-line strings and
`Option<TracebackLocation>` / `Option<TextRange>` structs where seeing
the full parsed shape is much easier to review than hand-built
expected values.
The cherry-picked karva_diagnostic insta dev-dep needed a Cargo.lock
update that didn't carry across. Path snapshots in karva_project also
need to be normalized to forward slashes via a small posix() helper
since Windows formats Utf8PathBuf with backslashes.
Clap embeds the binary name in help/error output. On Windows this
includes the .exe suffix, causing snapshot mismatches. The test
infrastructure already normalizes other platform differences (backslash
paths, ANSI codes), so adding one more filter is the natural fix.
@MatthewMckee4 MatthewMckee4 force-pushed the test/consolidated-audit branch from cb6800f to 8badc5e Compare April 12, 2026 23:16
@MatthewMckee4 MatthewMckee4 merged commit e9a53b1 into main Apr 12, 2026
10 checks passed
@MatthewMckee4 MatthewMckee4 deleted the test/consolidated-audit branch April 12, 2026 23:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal An internal refactor or improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant