Skip to content

Commit

Permalink
fix(forge): Don't ignore config.toml when running invariant tests for…
Browse files Browse the repository at this point in the history
… coverage (#6566)

* fix(forge): Coverage for invariant tests no longer take default config

* chore: fmt/merge

---------

Co-authored-by: 0xmp <>
Co-authored-by: Enrique Ortiz <[email protected]>
  • Loading branch information
0xmp and Evalir committed Dec 19, 2023
1 parent 73fb616 commit b9d9a5c
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions crates/forge/bin/cmd/coverage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -301,16 +301,21 @@ impl CoverageArgs {
.sender(evm_opts.sender)
.with_fork(evm_opts.get_fork(&config, env.clone()))
.with_cheats_config(CheatsConfig::new(&config, evm_opts.clone()))
.with_test_options(TestOptions { fuzz: config.fuzz, ..Default::default() })
.with_test_options(TestOptions {
fuzz: config.fuzz,
invariant: config.invariant,
..Default::default()
})
.set_coverage(true)
.build(root.clone(), output, env, evm_opts)?;

// Run tests
let known_contracts = runner.known_contracts.clone();
let filter = self.filter;
let (tx, rx) = channel::<(String, SuiteResult)>();
let handle =
tokio::task::spawn(async move { runner.test(&filter, tx, Default::default()).await });
let handle = tokio::task::spawn(async move {
runner.test(&filter, tx, runner.test_options.clone()).await
});

// Add hit data to the coverage report
let data = rx
Expand Down

0 comments on commit b9d9a5c

Please sign in to comment.