Skip to content

Commit

Permalink
feat: promote env variable to ProfilingEnabled option (#3692)
Browse files Browse the repository at this point in the history
* feat: promote env variable to ProfilingEnabled option

* Add simple test to check two ways to set profiling
  • Loading branch information
Bablzz committed Apr 24, 2024
1 parent 666b236 commit 2fd7096
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cmd/config_consolidation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,16 @@ func getConfigConsolidationTestCases() []configConsolidationTestCase {
},
nil,
},
{
opts{
env: []string{"K6_PROFILING_ENABLED=true"},
cli: []string{"--profiling-enabled"},
},
exp{
consolidationError: false,
},
nil,
},
// TODO: test for differences between flagsets
// TODO: more tests in general, especially ones not related to execution parameters...
}
Expand Down
3 changes: 3 additions & 0 deletions cmd/state/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,5 +177,8 @@ func getFlags(defaultFlags GlobalFlags, env map[string]string) GlobalFlags {
if _, ok := env["NO_COLOR"]; ok {
result.NoColor = true
}
if _, ok := env["K6_PROFILING_ENABLED"]; ok {
result.ProfilingEnabled = true
}
return result
}

0 comments on commit 2fd7096

Please sign in to comment.