Skip to content

Generate debug output for all regression tests#1307

Open
AdrianDAlessandro wants to merge 1 commit into
mainfrom
debug-test-output
Open

Generate debug output for all regression tests#1307
AdrianDAlessandro wants to merge 1 commit into
mainfrom
debug-test-output

Conversation

@AdrianDAlessandro
Copy link
Copy Markdown
Collaborator

Description

This PR changes the regression tests so that they always run with --debug-model turned on. Therefore the output includes the debug files, which should help with inspecting failing tests.

This change means there are not regression tests running without the debug flag. To ensure the code still runs without it, I have included an additional test check_example_run_command that just confirms the simple model runs without failure.

Fixes #1198

Type of change

  • Bug fix (non-breaking change to fix an issue)
  • New feature (non-breaking change to add functionality)
  • Refactoring (non-breaking, non-functional change to improve maintainability)
  • Optimization (non-breaking change to speed up the code)
  • Breaking change (whatever its nature)
  • Documentation (improve or add documentation)

Key checklist

  • All tests pass: $ cargo test
  • The documentation builds and looks OK: $ cargo doc
  • Update release notes for the latest release if this PR adds a new feature or fixes a bug
    present in the previous release

Further checks

  • Code is commented, particularly in hard-to-understand areas
  • Tests added that prove fix is effective or that feature works

@codecov
Copy link
Copy Markdown

codecov Bot commented May 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.65%. Comparing base (97ffb30) to head (397a270).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1307   +/-   ##
=======================================
  Coverage   89.65%   89.65%           
=======================================
  Files          57       57           
  Lines        8441     8441           
  Branches     8441     8441           
=======================================
  Hits         7568     7568           
  Misses        565      565           
  Partials      308      308           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Rust integration/regression test suite to always generate model debug outputs during regression runs, making CI artifacts more useful for diagnosing failures, while adding a separate CLI test to ensure example run still succeeds without debug enabled.

Changes:

  • Always invoke muse2 example run with --debug-model in regression tests, but only compare debug_*.csv outputs when explicitly enabled for a given case.
  • Extend regression-test macros to pass an explicit debug_model boolean into the runner.
  • Add a CLI integration test that runs example run simple with no additional flags to keep non-debug execution covered.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
tests/regression.rs Always includes --debug-model in regression runs; uses a boolean to decide whether to compare debug CSV outputs.
tests/common.rs Updates regression test macros to pass a debug_model boolean to the runner (and adjusts debug-files macro accordingly).
tests/cli.rs Adds a non-debug example run smoke test to retain coverage for running without debug enabled.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/regression.rs
Comment on lines 40 to +44
/// Run a regression test for the given example with optional extra arguments to `muse2 run`.
fn run_regression_test(example: &str, extra_args: &[&str]) {
///
/// The `debug-model` flag is always used so the debug files are available to examine. The debug
/// files are only tested when the `debug_model` flag is true.
fn run_regression_test(example: &str, extra_args: &[&str], debug_model: bool) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also true. Worth fixing up

Comment thread tests/common.rs
Comment on lines +35 to 40
($example:ident, $extra_args:expr, $debug_model:literal) => {
#[test]
fn $example() {
run_regression_test(stringify!($example), $extra_args, $debug_model);
}
};
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed!

Comment thread tests/cli.rs
Comment on lines +99 to +104
assert_muse2_runs(&[
"example",
"run",
"simple",
"--output-dir",
&tempdir().unwrap().path().to_path_buf().to_string_lossy(),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd do this for clarity, regardless of the point about relying on brittle lifetime rules ☝️

Copy link
Copy Markdown
Member

@alexdewar alexdewar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot has suggested some tweaks that I think are worth doing, but otherwise LGTM 😄

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.

Generate debug output files for all regression tests, even if they're not checked

3 participants