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

feat: allow accessing the test environments env config #451

Merged
merged 1 commit into from
Aug 31, 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
6 changes: 6 additions & 0 deletions pkg/env/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,12 @@ func (e *testEnv) Finish(funcs ...Func) types.Environment {
return e
}

// EnvConf returns the test environment's environment configuration
func (e *testEnv) EnvConf() *envconf.Config {
cfg := *e.cfg
return &cfg
}

// Run is to launch the test suite from a TestMain function.
// It will run m.Run() and exercise all test functions in the
// package. This method will all Env.Setup operations prior to
Expand Down
3 changes: 3 additions & 0 deletions pkg/types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ type Environment interface {

// Run Launches the test suite from within a TestMain
Run(*testing.M) int

// EnvConf returns the test environment's environment configuration
EnvConf() *envconf.Config
}

type Labels = flags.LabelsMap
Expand Down