feat: Rust testing framework with mix test integration ($350 bounty #102)#643
Open
JirA44 wants to merge 1 commit into
Open
feat: Rust testing framework with mix test integration ($350 bounty #102)#643JirA44 wants to merge 1 commit into
JirA44 wants to merge 1 commit into
Conversation
Implements Lux.Rust.Testing for running cargo tests from Elixir, test output parsing, coverage support, and a mix rust.test task that integrates with the existing mix test pipeline. Resolves Spectral-Finance#102
|
/opire try Claiming this bounty. Will deliver a complete implementation. |
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.
Summary
Lux.Rust.Testing— a structured Elixir interface for runningcargo test, parsing output, measuring coverage, and managing temporary Rust fixturesMix.Tasks.Rust.Test(mix rust.test) that discovers everyCargo.tomlin the repo, runs tests in each project, and exits non-zero on failures — integrating cleanly with CI pipelinestest/unit/lux/rust/testing_test.exs) that covers output parsing with sample strings (no real Cargo needed), fixture lifecycle, and result struct shapeWhat's in each file
lib/lux/rust/testing.exrun_tests/2cargo test→{:ok, result_map}run_tests!/2run_test/3with_coverage/2cargo llvm-cov, falls back tocargo testparse_test_output/1generate_report/2cargo llvm-covsetup_test_fixture/2cleanup_fixture/1Result map shape:
lib/mix/tasks/rust.test.exCargo.tomlfiles (skippingtarget/and workspace-only manifests)--dir,--release,--featuresflagstest/unit/lux/rust/testing_test.exsparse_test_output/1— 7 tests covering all-pass, failures, ignored, fractional duration, empty input, unparseable inputsetup_test_fixture/2— 5 tests (directory created, Cargo.toml present, source written, name embedded, uniqueness)cleanup_fixture/1— 2 tests (removes dir, idempotent on missing dir)run_tests/2— skipped when cargo is absent, exercises result map shape when availableTest plan
mix test test/unit/lux/rust/testing_test.exspasses on machines without Cargo installed (parser tests are pure Elixir)mix rust.testexits 0 on a repo with no Rust projects (prints yellow notice)mix rust.testcorrectly finds and runs any Cargo projects that existmix rust.test --releaseforwards the flag tocargo testsetup_test_fixture+run_testsround-trip producespassed >= 1, failed == 0/opire try #102