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.
This commit is contained in:
Pieter Noordhuis 2024-12-17 18:16:58 +01:00 committed by GitHub
parent 2fa3b48083
commit 23ddee8023
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 23 additions and 3 deletions

View File

@ -30,7 +30,12 @@ vendor:
@echo "✓ Filling vendor folder with library code ..." @echo "✓ Filling vendor folder with library code ..."
@go mod vendor @go mod vendor
integration: INTEGRATION = gotestsum --format github-actions --rerun-fails --jsonfile output.json --packages "./integration/..." -- -parallel 4 -timeout=2h
gotestsum --format github-actions --rerun-fails --jsonfile output.json --packages "./integration/..." -- -parallel 4 -timeout=2h
.PHONY: lint lintcheck test testonly coverage build snapshot vendor integration integration:
$(INTEGRATION)
integration-short:
$(INTEGRATION) -short
.PHONY: lint lintcheck test testonly coverage build snapshot vendor integration integration-short

View File

@ -44,6 +44,11 @@ func TestDeployBundleWithCluster(t *testing.T) {
require.NoError(t, err) require.NoError(t, err)
require.NotNil(t, cluster) require.NotNil(t, cluster)
if testing.Short() {
t.Log("Skip the job run in short mode")
return
}
out, err := runResource(t, ctx, root, "foo") out, err := runResource(t, ctx, root, "foo")
require.NoError(t, err) require.NoError(t, err)
require.Contains(t, out, "Hello World!") require.Contains(t, out, "Hello World!")

View File

@ -29,6 +29,11 @@ func runPythonWheelTest(t *testing.T, templateName, sparkVersion string, pythonW
destroyBundle(t, ctx, bundleRoot) destroyBundle(t, ctx, bundleRoot)
}) })
if testing.Short() {
t.Log("Skip the job run in short mode")
return
}
out, err := runResource(t, ctx, bundleRoot, "some_other_job") out, err := runResource(t, ctx, bundleRoot, "some_other_job")
require.NoError(t, err) require.NoError(t, err)
require.Contains(t, out, "Hello from my func") require.Contains(t, out, "Hello from my func")

View File

@ -30,6 +30,11 @@ func runSparkJarTestCommon(t *testing.T, ctx context.Context, sparkVersion, arti
destroyBundle(t, ctx, bundleRoot) destroyBundle(t, ctx, bundleRoot)
}) })
if testing.Short() {
t.Log("Skip the job run in short mode")
return
}
out, err := runResource(t, ctx, bundleRoot, "jar_job") out, err := runResource(t, ctx, bundleRoot, "jar_job")
require.NoError(t, err) require.NoError(t, err)
require.Contains(t, out, "Hello from Jar!") require.Contains(t, out, "Hello from Jar!")