Skip to content

Commit

Permalink
Merge pull request #451 from crandles/env-config
Browse files Browse the repository at this point in the history
feat: allow accessing the test environments env config
  • Loading branch information
k8s-ci-robot committed Aug 31, 2024
2 parents 9206e6f + 6f0edff commit f9e1bb8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
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

0 comments on commit f9e1bb8

Please sign in to comment.