Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(forge test): install missing dependencies before creating Project #9379

Merged
merged 2 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions crates/config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -904,6 +904,9 @@ impl Config {
) -> Result<BTreeMap<PathBuf, RestrictionsWithVersion<MultiCompilerRestrictions>>, SolcError>
{
let mut map = BTreeMap::new();
if self.compilation_restrictions.is_empty() {
return Ok(BTreeMap::new());
}

let graph = Graph::<MultiCompilerParsedSource>::resolve(paths)?;
let (sources, _) = graph.into_sources();
Expand Down
7 changes: 3 additions & 4 deletions crates/forge/bin/cmd/test/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,16 +291,15 @@ impl TestArgs {
config.invariant.gas_report_samples = 0;
}

// Set up the project.
let mut project = config.project()?;

// Install missing dependencies.
if install::install_missing_dependencies(&mut config) && config.auto_detect_remappings {
// need to re-configure here to also catch additional remappings
config = self.load_config();
project = config.project()?;
}

// Set up the project.
let project = config.project()?;

let mut filter = self.filter(&config);
trace!(target: "forge::test", ?filter, "using filter");

Expand Down
Loading