Skip to content

Commit

Permalink
Make integration tests run in parallel.
Browse files Browse the repository at this point in the history
This cuts the e2e test time from ~10m to ~5m on my test cluster (3 n1-standard4 nodes on GKE 1.11.x).
  • Loading branch information
dlorenc authored and knative-prow-robot committed Jan 29, 2019
1 parent f9dac68 commit ed1b898
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions test/cancel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import (
func TestTaskRunPipelineRunCancel(t *testing.T) {
logger := logging.GetContextLogger(t.Name())
c, namespace := setup(t, logger)
t.Parallel()

knativetest.CleanupOnInterrupt(func() { tearDown(t, logger, c, namespace) }, logger)
defer tearDown(t, logger, c, namespace)
Expand Down
1 change: 1 addition & 0 deletions test/cluster_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ func TestClusterResource(t *testing.T) {

logger := logging.GetContextLogger(t.Name())
c, namespace := setup(t, logger)
t.Parallel()

knativetest.CleanupOnInterrupt(func() { tearDown(t, logger, c, namespace) }, logger)
defer tearDown(t, logger, c, namespace)
Expand Down
1 change: 1 addition & 0 deletions test/gcs_taskrun_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ func TestStorageTaskRun(t *testing.T) {
t.Skip("KANIKO_SECRET_CONFIG_FILE variable is not set.")
}
logger := logging.GetContextLogger(t.Name())
t.Parallel()

c, namespace := setup(t, logger)
knativetest.CleanupOnInterrupt(func() { tearDown(t, logger, c, namespace) }, logger)
Expand Down
3 changes: 2 additions & 1 deletion test/helm_task_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ func TestHelmDeployPipelineRun(t *testing.T) {
logger := logging.GetContextLogger(t.Name())
c, namespace := setup(t, logger)
setupClusterBindingForHelm(c, t, namespace, logger)
t.Parallel()

knativetest.CleanupOnInterrupt(func() { tearDown(t, logger, c, namespace) }, logger)
defer tearDown(t, logger, c, namespace)
Expand Down Expand Up @@ -173,7 +174,7 @@ func getHelmDeployTask(namespace string) *v1alpha1.Task {
tb.TaskInputs(
tb.InputsResource("gitsource", v1alpha1.PipelineResourceTypeGit),
tb.InputsParam("pathToHelmCharts", tb.ParamDescription("Path to the helm charts")),
tb.InputsParam("image"), tb.InputsParam("chartname"),
tb.InputsParam("image"), tb.InputsParam("chartname", tb.ParamDefault("")),
),
tb.Step("helm-init", "alpine/helm", tb.Args("init", "--wait")),
tb.Step("helm-deploy", "alpine/helm", tb.Args(
Expand Down
1 change: 1 addition & 0 deletions test/kaniko_task_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ func getTaskRun(namespace string) *v1alpha1.TaskRun {
func TestKanikoTaskRun(t *testing.T) {
logger := logging.GetContextLogger(t.Name())
c, namespace := setup(t, logger)
t.Parallel()

repo, err := getDockerRepo()
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions test/pipelinerun_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ var (
)

func TestPipelineRun(t *testing.T) {
t.Parallel()
type tests struct {
name string
testSetup func(c *clients, namespace string, index int)
Expand Down
1 change: 1 addition & 0 deletions test/status_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (
func TestTaskRunPipelineRunStatus(t *testing.T) {
logger := logging.GetContextLogger(t.Name())
c, namespace := setup(t, logger)
t.Parallel()

knativetest.CleanupOnInterrupt(func() { tearDown(t, logger, c, namespace) }, logger)
defer tearDown(t, logger, c, namespace)
Expand Down
1 change: 1 addition & 0 deletions test/taskrun_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import (
func TestTaskRun(t *testing.T) {
logger := logging.GetContextLogger(t.Name())
c, namespace := setup(t, logger)
t.Parallel()

knativetest.CleanupOnInterrupt(func() { tearDown(t, logger, c, namespace) }, logger)
defer tearDown(t, logger, c, namespace)
Expand Down

0 comments on commit ed1b898

Please sign in to comment.