conformance validation: add new helper to `testutil` (#4532)

Adds a new helper function to make TestHelper initialization more relaxed for linkerd2-conformance and other test use-cases.
This commit is contained in:
Mayank Shah 2020-06-12 10:45:42 +05:30 committed by GitHub
parent 7a9527bf00
commit 6174b194fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 33 additions and 0 deletions

View File

@ -61,6 +61,39 @@ var LinkerdDeployReplicas = map[string]deploySpec{
"linkerd-proxy-injector": {1, []string{"proxy-injector"}},
}
// NewGenericTestHelper returns a new *TestHelper from the options provided as function parameters.
// This helper was created to be able to reuse this package without hard restrictions
// as seen in `NewTestHelper()` which is primarily used with integration tests
// See - https://github.com/linkerd/linkerd2/issues/4530
func NewGenericTestHelper(
linkerd,
namespace,
upgradeFromVersion,
clusterDomain,
helmPath,
helmChart,
helmStableChart,
helmReleaseName string,
externalIssuer,
uninstall bool,
) *TestHelper {
return &TestHelper{
linkerd: linkerd,
namespace: namespace,
upgradeFromVersion: upgradeFromVersion,
helm: helm{
path: helmPath,
chart: helmChart,
stableChart: helmStableChart,
releaseName: helmReleaseName,
upgradeFromVersion: upgradeFromVersion,
},
clusterDomain: clusterDomain,
externalIssuer: externalIssuer,
uninstall: uninstall,
}
}
// NewTestHelper creates a new instance of TestHelper for the current test run.
// The new TestHelper can be configured via command line flags.
func NewTestHelper() *TestHelper {