Skip to content

Commit 43c1bf6

Browse files
authored
acc: add Slow setting; change "make test" no longer run slow tests (#3549)
## Changes - Add Slow settings to acceptance tests; when set test will be skipped in -short mode. - Add -short option to "make test". ## Why I'd like to add some tests that record output in case of real timeout, but don't want to run them every time. ## Tests New self test.
1 parent ad41771 commit 43c1bf6

File tree

7 files changed

+18
-0
lines changed

7 files changed

+18
-0
lines changed

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ links:
4747
checks: tidy ws links
4848

4949
test:
50+
${GOTESTSUM_CMD} -- ${PACKAGES} -timeout=${LOCAL_TIMEOUT} -short
51+
52+
test-slow:
5053
${GOTESTSUM_CMD} -- ${PACKAGES} -timeout=${LOCAL_TIMEOUT}
5154

5255
# Updates acceptance test output (local tests)

acceptance/acceptance_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,10 @@ func getSkipReason(config *internal.TestConfig, configPath string) string {
419419
return ""
420420
}
421421

422+
if isTruePtr(config.Slow) && testing.Short() {
423+
return "Disabled via Slow setting in " + configPath
424+
}
425+
422426
isEnabled, isPresent := config.GOOS[runtime.GOOS]
423427
if isPresent && !isEnabled {
424428
return fmt.Sprintf("Disabled via GOOS.%s setting in %s", runtime.GOOS, configPath)

acceptance/internal/config.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ type TestConfig struct {
3636
// If true, run this test when running locally with a testserver
3737
Local *bool
3838

39+
// If true, this test will not be run in -short mode (which is default for make test / PR)
40+
Slow *bool
41+
3942
// If true, run this test when running with cloud env configured
4043
Cloud *bool
4144

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Local = true
2+
Cloud = false
3+
4+
[EnvMatrix]
5+
DATABRICKS_CLI_DEPLOYMENT = ["terraform", "direct-exp"]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Skipped in -short mode

acceptance/selftest/slow/script

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
echo "Skipped in -short mode"

acceptance/selftest/slow/test.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Slow = true

0 commit comments

Comments
 (0)