Skip to content

Commit 669d3b3

Browse files
authored
Add make command to update acceptance tests (#3068)
## Changes - Add 'make test-update' to update local acceptance tests. - Add 'make test-update-aws' to update Cloud acceptance tests that are not already updated local. - Add -skiplocal option to acceptance test runner to support 'test-update-aws' - Add 'make test-update-all' that captures both. ## Why Easier to update tests and ask people to do update on external PRs.
1 parent 86012df commit 669d3b3

2 files changed

Lines changed: 19 additions & 1 deletion

File tree

Makefile

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,18 @@ checks: tidy ws links
4848
test:
4949
${GOTESTSUM_CMD} -- ${PACKAGES}
5050

51+
# Updates acceptance test output (local tests)
52+
test-update:
53+
-go test ./acceptance -run '^TestAccept$$' -update
54+
@# at the moment second pass is required because some tests show diff against output of another test for easier review
55+
-go test ./acceptance -run '^TestAccept$$' -update
56+
57+
# Updates acceptance test output (integration tests, requires access)
58+
test-update-aws:
59+
deco env run -i -n aws-prod-ucws -- go test ./acceptance -run ^TestAccept$$ -update -timeout=1h -skiplocal -v
60+
61+
test-update-all: test-update test-update-aws
62+
5163
slowest:
5264
go tool gotestsum tool slowest --jsonfile test-output.json --threshold 1s --num 50
5365

@@ -94,4 +106,4 @@ generate:
94106
[ ! -f .github/workflows/next-changelog.yml ] || rm .github/workflows/next-changelog.yml
95107
pushd experimental/python && make codegen
96108

97-
.PHONY: lint lintfull tidy lintcheck fmt fmtfull test cover showcover build snapshot schema integration integration-short acc-cover acc-showcover docs ws links checks
109+
.PHONY: lint lintfull tidy lintcheck fmt fmtfull test cover showcover build snapshot schema integration integration-short acc-cover acc-showcover docs ws links checks test-update test-update-aws test-update-all

acceptance/acceptance_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ var (
4343
Forcerun bool
4444
LogRequests bool
4545
LogConfig bool
46+
SkipLocal bool
4647
)
4748

4849
// In order to debug CLI running under acceptance test, search for TestInprocessMode and update
@@ -65,6 +66,7 @@ func init() {
6566
flag.BoolVar(&Forcerun, "forcerun", false, "Force running the specified tests, ignore all reasons to skip")
6667
flag.BoolVar(&LogRequests, "logrequests", false, "Log request and responses from testserver")
6768
flag.BoolVar(&LogConfig, "logconfig", false, "Log merged for each test case")
69+
flag.BoolVar(&SkipLocal, "skiplocal", false, "Skip tests that are enabled to run on Local")
6870
}
6971

7072
const (
@@ -330,6 +332,10 @@ func getTests(t *testing.T) []string {
330332

331333
// Return a reason to skip the test. Empty string means "don't skip".
332334
func getSkipReason(config *internal.TestConfig, configPath string) string {
335+
if SkipLocal && isTruePtr(config.Local) {
336+
return "Disabled via SkipLocal setting in " + configPath
337+
}
338+
333339
if Forcerun {
334340
return ""
335341
}

0 commit comments

Comments
 (0)