feat(testing): add baseline comparison for DSL run artifacts#1558
Open
AdityaShome wants to merge 14 commits intomofa-org:mainfrom
Open
feat(testing): add baseline comparison for DSL run artifacts#1558AdityaShome wants to merge 14 commits intomofa-org:mainfrom
AdityaShome wants to merge 14 commits intomofa-org:mainfrom
Conversation
This was referenced Apr 2, 2026
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
This PRis rebased on #1556, #1555 and #1447, adds baseline comparison for DSL run artifacts on top of the canonical artifact path.
mofa test-dslcan now save the current run artifact as a baseline and compare future runs against a saved baseline artifact. This adds the first regression-oriented workflow for the DSL path without expanding into replay or CI gating yet.Context
The previous step introduced a canonical
AgentRunArtifactand optional artifact output via--artifact-out.That established a stable execution artifact, but there was still no way to compare a current run against a saved baseline. This PR adds that comparison layer in a narrow MVP form.
This PR closes that gap by:
mofa test-dslWhat Changed
AgentRunArtifactDiffandArtifactDifferenceAgentRunArtifact::compare_to(&baseline)--baseline-in <file>to compare against a saved baseline artifact--baseline-out <file>to write the current artifact as a baselineFiles Changed
Core Files
tests/src/artifact.rsAgentRunArtifactDiff.ArtifactDifference.compare_tofor MVP artifact comparison.tests/src/lib.rstests/crate.crates/mofa-cli/src/cli.rs--baseline-inand--baseline-outformofa test-dsl.crates/mofa-cli/src/commands/test_dsl.rs--baseline-inis provided.baseline: matchedorbaseline: mismatch.difference: <field>lines when mismatches are detected.--baseline-outis provided.crates/mofa-cli/src/main.rstests/tests/artifact_tests.rsSupporting Files
crates/mofa-cli/tests/test_dsl_integration_tests.rs: Added CLI integration coverage for baseline write and mismatch reporting.Baseline Comparison Scope
The initial comparison is intentionally narrow and compares:
statusoutput_textkindandpassed)This PR does not yet compare:
CLI Usage
Examples:
Execution Flow
flowchart TD A[TOML DSL file] --> B[mofa test-dsl] B --> C[Execute case] C --> D[Build current AgentRunArtifact] E[Saved baseline artifact] --> F[Load baseline] F --> G[Compare artifacts] D --> G G --> H[baseline matched] G --> I[baseline mismatch] I --> J[Difference fields] D --> K[Write artifact or baseline file] G --> L[CLI summary output]Example Output
Tests
cargo test -p mofa-testing --test artifact_testscargo test -p mofa-cli --test test_dsl_integration_testscargo test -p mofa-cli test_test_dsl_Notes
This PR keeps baseline comparison intentionally small and artifact backed. It adds the first regression comparison loop for DSL runs while leaving deeper diff semantics, replay, and CI gating to later steps.