Skip to content

Commit 2b301a7

Browse files
authored
fix: respect profiles in inline configs (#8514)
* exclude internal fns tests for test-isolate * fix: respect profiles when merging inline configs
1 parent 781fe52 commit 2b301a7

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

crates/config/src/inline/conf_parser.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,14 @@ where
3737
/// - `Err(InlineConfigParserError)` in case of wrong configuration.
3838
fn try_merge(&self, configs: &[String]) -> Result<Option<Self>, InlineConfigParserError>;
3939

40-
/// Validates and merges the natspec configs into the current config.
40+
/// Validates and merges the natspec configs for current profile into the current config.
4141
fn merge(&self, natspec: &NatSpec) -> Result<Option<Self>, InlineConfigError> {
4242
let config_key = Self::config_key();
4343

44-
let configs =
45-
natspec.config_lines().filter(|l| l.contains(&config_key)).collect::<Vec<String>>();
44+
let configs = natspec
45+
.current_profile_configs()
46+
.filter(|l| l.contains(&config_key))
47+
.collect::<Vec<String>>();
4648

4749
self.try_merge(&configs).map_err(|e| {
4850
let line = natspec.debug_context();

crates/forge/tests/cli/test_cmd.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -904,6 +904,7 @@ forgetest_init!(should_not_show_logs_when_fuzz_test_inline_config, |prj, cmd| {
904904
});
905905

906906
// tests internal functions trace
907+
#[cfg(not(feature = "isolate-by-default"))]
907908
forgetest_init!(internal_functions_trace, |prj, cmd| {
908909
prj.wipe_contracts();
909910
prj.clear();
@@ -971,6 +972,7 @@ Traces:
971972
});
972973

973974
// tests internal functions trace with memory decoding
975+
#[cfg(not(feature = "isolate-by-default"))]
974976
forgetest_init!(internal_functions_trace_memory, |prj, cmd| {
975977
prj.wipe_contracts();
976978
prj.clear();

0 commit comments

Comments
 (0)