Skip to content

Commit 23ddee8

Browse files
authored
Skip job runs during integration testing for PRs (#2024)
## Changes A small subset of tests trigger cluster creation to run jobs. These tests comprise a substantial amount of the total integration test runtime. We can skip them on PRs and only run them on the main branch. ## Tests Confirmed the short runtime is ~20 mins.
1 parent 2fa3b48 commit 23ddee8

File tree

4 files changed

+22
-2
lines changed

4 files changed

+22
-2
lines changed

Makefile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,12 @@ vendor:
3030
@echo "✓ Filling vendor folder with library code ..."
3131
@go mod vendor
3232

33+
INTEGRATION = gotestsum --format github-actions --rerun-fails --jsonfile output.json --packages "./integration/..." -- -parallel 4 -timeout=2h
34+
3335
integration:
34-
gotestsum --format github-actions --rerun-fails --jsonfile output.json --packages "./integration/..." -- -parallel 4 -timeout=2h
36+
$(INTEGRATION)
37+
38+
integration-short:
39+
$(INTEGRATION) -short
3540

36-
.PHONY: lint lintcheck test testonly coverage build snapshot vendor integration
41+
.PHONY: lint lintcheck test testonly coverage build snapshot vendor integration integration-short

integration/bundle/clusters_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ func TestDeployBundleWithCluster(t *testing.T) {
4444
require.NoError(t, err)
4545
require.NotNil(t, cluster)
4646

47+
if testing.Short() {
48+
t.Log("Skip the job run in short mode")
49+
return
50+
}
51+
4752
out, err := runResource(t, ctx, root, "foo")
4853
require.NoError(t, err)
4954
require.Contains(t, out, "Hello World!")

integration/bundle/python_wheel_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ func runPythonWheelTest(t *testing.T, templateName, sparkVersion string, pythonW
2929
destroyBundle(t, ctx, bundleRoot)
3030
})
3131

32+
if testing.Short() {
33+
t.Log("Skip the job run in short mode")
34+
return
35+
}
36+
3237
out, err := runResource(t, ctx, bundleRoot, "some_other_job")
3338
require.NoError(t, err)
3439
require.Contains(t, out, "Hello from my func")

integration/bundle/spark_jar_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ func runSparkJarTestCommon(t *testing.T, ctx context.Context, sparkVersion, arti
3030
destroyBundle(t, ctx, bundleRoot)
3131
})
3232

33+
if testing.Short() {
34+
t.Log("Skip the job run in short mode")
35+
return
36+
}
37+
3338
out, err := runResource(t, ctx, bundleRoot, "jar_job")
3439
require.NoError(t, err)
3540
require.Contains(t, out, "Hello from Jar!")

0 commit comments

Comments
 (0)