Documentation ¶
Index ¶
- Constants
- Variables
- func KnownFeature(f Feature) bool
- type FakeNTB
- func (t *FakeNTB) Cleanup(f func())
- func (t *FakeNTB) Error(args ...interface{})
- func (t *FakeNTB) Errorf(format string, args ...interface{})
- func (t *FakeNTB) Fail()
- func (t *FakeNTB) FailNow()
- func (t *FakeNTB) Failed() bool
- func (t *FakeNTB) Fatal(args ...interface{})
- func (t *FakeNTB) Fatalf(format string, args ...interface{})
- func (t *FakeNTB) Helper()
- func (t *FakeNTB) Log(args ...interface{})
- func (t *FakeNTB) Logf(format string, args ...interface{})
- func (t *FakeNTB) Name() string
- func (t *FakeNTB) RunCleanup()
- func (t *FakeNTB) Skip(...interface{})
- func (t *FakeNTB) SkipNow()
- func (t *FakeNTB) Skipf(string, ...interface{})
- func (t *FakeNTB) Skipped() bool
- type Feature
- type NTB
- type Wrapper
- func (w *Wrapper) Cleanup(f func())
- func (w *Wrapper) Error(args ...interface{})
- func (w *Wrapper) Errorf(format string, args ...interface{})
- func (w *Wrapper) Fail()
- func (w *Wrapper) FailNow()
- func (w *Wrapper) Failed() bool
- func (w *Wrapper) Fatal(args ...interface{})
- func (w *Wrapper) Fatalf(format string, args ...interface{})
- func (w *Wrapper) Helper()
- func (w *Wrapper) Log(args ...interface{})
- func (w *Wrapper) Logf(format string, args ...interface{})
- func (w *Wrapper) Name() string
- func (w *Wrapper) Skip(args ...interface{})
- func (w *Wrapper) SkipNow()
- func (w *Wrapper) Skipf(format string, args ...interface{})
- func (w *Wrapper) Skipped() bool
Constants ¶
const ( // ACMController verifies features like the resource-group-controller, reconciler-manager, and etc. ACMController Feature = "acm-controller" // NomosCLI verifies the CLI. NomosCLI = "nomos-cli" // ClusterSelector verifies both the ClusterSelector and the cluster-name-selector annotation. ClusterSelector = "cluster-selector" // DriftControl verifies the admission webhook and drift correction. DriftControl = "drift-control" // Hydration verifies the rendering feature in the hydration-controller. Hydration = "hydration" // Lifecycle verifies the lifecycle directives feature. Lifecycle = "lifecycle" // MultiRepos verifies the multiple repos, including multiple root repos, namespace repos and different control modes. MultiRepos = "multi-repos" // OverrideAPI verifies the override API in RSync. OverrideAPI = "override-api" // Reconciliation1 verifies the first part of the reconciliation test. Reconciliation1 = "reconciliation-1" // Reconciliation2 verifies the second part of the reconciliation test. Reconciliation2 = "reconciliation-2" // SyncSource verifies the various source configs, including different source types, sync directory, branch, and etc. SyncSource = "sync-source" // WorkloadIdentity verifies authenticating with workload identity (GKE and Fleet). WorkloadIdentity = "workload-identity" )
Variables ¶
var GCPClusterFromEnv = os.Getenv("GCP_CLUSTER")
GCPClusterFromEnv is the GCP_CLUSTER value from the environment variable
var GCPProjectIDFromEnv = os.Getenv("GCP_PROJECT")
GCPProjectIDFromEnv is the GCP_PROJECT value from the environment variable
var GCPRegionFromEnv = os.Getenv("GCP_REGION")
GCPRegionFromEnv is the GCP_REGION value from the environment variable
var GCPZoneFromEnv = os.Getenv("GCP_ZONE")
GCPZoneFromEnv is the GCP_ZONE value from the environment variable
Functions ¶
func KnownFeature ¶ added in v1.15.1
KnownFeature indicates whether the test verifies a known feature
Types ¶
type FakeNTB ¶
type FakeNTB struct {
// contains filtered or unexported fields
}
FakeNTB implements NTB with standard print out and exit. It is used in `e2e/testcases/main_test.go` when `--share-test-env` is turned on.
func (*FakeNTB) Cleanup ¶
func (t *FakeNTB) Cleanup(f func())
Cleanup registers a cleanup function to call at the end of the test suite.
func (*FakeNTB) Error ¶
func (t *FakeNTB) Error(args ...interface{})
Error is equivalent to Log followed by Fail.
func (*FakeNTB) Fail ¶
func (t *FakeNTB) Fail()
Fail marks the function as having failed but continues execution.
func (*FakeNTB) FailNow ¶
func (t *FakeNTB) FailNow()
FailNow marks the function as having failed and stops its execution by calling runtime.Goexit (which then runs all deferred calls in the current goroutine).
func (*FakeNTB) Fatal ¶
func (t *FakeNTB) Fatal(args ...interface{})
Fatal is equivalent to Log followed by FailNow.
func (*FakeNTB) Log ¶
func (t *FakeNTB) Log(args ...interface{})
Log generates the output. It's always at the same stack depth.
func (*FakeNTB) Logf ¶
Logf formats its arguments according to the format, analogous to Printf, and records the text in the error log.
func (*FakeNTB) RunCleanup ¶ added in v1.15.1
func (t *FakeNTB) RunCleanup()
RunCleanup invokes all registered cleanup functions. this should be called at the end of the shared test quite after all tests have completed.
type Feature ¶ added in v1.15.1
type Feature string
Feature indicates which feature the e2e test verifies
type NTB ¶
type NTB interface { Cleanup(func()) Error(args ...interface{}) Errorf(format string, args ...interface{}) Fail() FailNow() Failed() bool Fatal(args ...interface{}) Fatalf(format string, args ...interface{}) Helper() Log(args ...interface{}) Logf(format string, args ...interface{}) Name() string Skip(args ...interface{}) SkipNow() Skipf(format string, args ...interface{}) Skipped() bool }
NTB partially implements testing.TB It is used by the shared setup steps to invoke the per-test functions.
type Wrapper ¶
type Wrapper struct {
// contains filtered or unexported fields
}
Wrapper implements NTB.
func New ¶
New creates a new instance of the Testing Wrapper that provides additional functionality beyond the standard testing package.
func NewShared ¶ added in v1.15.1
NewShared creates a new instance of the Testing Wrapper that provides additional functionality beyond the standard testing package. It doesn't require the testFeature param.
func (*Wrapper) Cleanup ¶
func (w *Wrapper) Cleanup(f func())
Cleanup registers a function to be called when the test and all its subtests complete. Cleanup functions will be called in last added, first called order.
func (*Wrapper) Error ¶
func (w *Wrapper) Error(args ...interface{})
Error is equivalent to Log followed by Fail.
func (*Wrapper) Fail ¶
func (w *Wrapper) Fail()
Fail marks the function as having failed but continues execution.
func (*Wrapper) FailNow ¶
func (w *Wrapper) FailNow()
FailNow marks the function as having failed and stops its execution by calling runtime.Goexit (which then runs all deferred calls in the current goroutine).
func (*Wrapper) Fatal ¶
func (w *Wrapper) Fatal(args ...interface{})
Fatal is equivalent to Log followed by FailNow.
func (*Wrapper) Helper ¶
func (w *Wrapper) Helper()
Helper marks the calling function as a test helper function. When printing file and line information, that function will be skipped. Helper may be called simultaneously from multiple goroutines.
func (*Wrapper) Log ¶
func (w *Wrapper) Log(args ...interface{})
Log generates the output. It's always at the same stack depth.
func (*Wrapper) Logf ¶
Logf formats its arguments according to the format, analogous to Printf, and records the text in the error log.
func (*Wrapper) Skip ¶
func (w *Wrapper) Skip(args ...interface{})
Skip is equivalent to Log followed by SkipNow.
func (*Wrapper) SkipNow ¶
func (w *Wrapper) SkipNow()
SkipNow marks the test as having been skipped and stops its execution by calling runtime.Goexit.