Skip to content

Commit

Permalink
Wire test variables through e2e lib code
Browse files Browse the repository at this point in the history
Files without the `_test.go` suffix are compiled as "normal" go code in
IDEs like VSCode. This can lead to spurious compile errors if the normal
code references variables in test code.

Updating the library code in `samples.go` and `validators.go` to accept
test variables as arguments in function calls. Wired test arguments
through to library functions.
  • Loading branch information
adambkaplan committed Oct 15, 2020
1 parent 5d89593 commit b2e76b4
Show file tree
Hide file tree
Showing 4 changed files with 182 additions and 58 deletions.
10 changes: 5 additions & 5 deletions test/e2e/e2e_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ var _ = SynchronizedBeforeSuite(func() []byte {

// initialize cluster resources
Logf("Initializing cluster resources")
err = globalCtx.InitializeClusterResources(cleanupOptions(globalCtx))
err = globalCtx.InitializeClusterResources(cleanupOptions(globalCtx, cleanupTimeout, cleanupRetryInterval))
Expect(err).ToNot(HaveOccurred(), "unable to initialize cluster resources")

// get the namespace
Expand Down Expand Up @@ -116,11 +116,11 @@ var _ = SynchronizedBeforeSuite(func() []byte {

// create the pipeline service account
Logf("Creating the pipeline service account")
createPipelineServiceAccount(globalCtx, f, namespace)
createPipelineServiceAccount(globalCtx, f, namespace, cleanupTimeout, cleanupRetryInterval)

// create the container registry secret
Logf("Creating the container registry secret")
createContainerRegistrySecret(globalCtx, f, namespace)
createContainerRegistrySecret(globalCtx, f, namespace, cleanupTimeout, cleanupRetryInterval)

if os.Getenv(EnvVarCreateGlobalObjects) == "true" {
// create cluster build strategies
Expand All @@ -131,7 +131,7 @@ var _ = SynchronizedBeforeSuite(func() []byte {
Expect(err).ToNot(HaveOccurred())
cbs.SetNamespace(namespace)

createClusterBuildStrategy(globalCtx, f, cbs)
createClusterBuildStrategy(globalCtx, f, cbs, cleanupTimeout, cleanupRetryInterval)
}

// create namespace build strategies
Expand All @@ -141,7 +141,7 @@ var _ = SynchronizedBeforeSuite(func() []byte {
nbs, err := buildStrategyTestData(namespace, namespaceBuildStrategy)
Expect(err).ToNot(HaveOccurred())

createNamespacedBuildStrategy(globalCtx, f, nbs)
createNamespacedBuildStrategy(globalCtx, f, nbs, cleanupTimeout, cleanupRetryInterval)
}
} else {
Logf("Build strategy creation skipped.")
Expand Down
Loading

0 comments on commit b2e76b4

Please sign in to comment.