Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ test-update:
test-update-templates:
-go test ./acceptance -run '^TestAccept/bundle/templates' -update -timeout=${LOCAL_TIMEOUT}

# Regenerate out.test.toml files without running tests
generate-out-test-toml:
go test ./acceptance -run '^TestAccept$$' -only-out-test-toml -timeout=${LOCAL_TIMEOUT}

# Updates acceptance test output (integration tests, requires access)
test-update-aws:
deco env run -i -n aws-prod-ucws -- go test ./acceptance -run ^TestAccept$$ -update -timeout=1h -skiplocal -v
Expand Down Expand Up @@ -167,7 +171,7 @@ generate:
$(GENKIT_BINARY) update-sdk


.PHONY: lint lintfull tidy lintcheck fmt fmtfull test test-unit test-acc test-slow test-slow-unit test-slow-acc cover showcover build snapshot snapshot-release schema integration integration-short acc-cover acc-showcover docs ws wsfix links checks test-update test-update-templates test-update-aws test-update-all generate-validation
.PHONY: lint lintfull tidy lintcheck fmt fmtfull test test-unit test-acc test-slow test-slow-unit test-slow-acc cover showcover build snapshot snapshot-release schema integration integration-short acc-cover acc-showcover docs ws wsfix links checks test-update test-update-templates generate-out-test-toml test-update-aws test-update-all generate-validation

test-exp-aitools:
make test TEST_PACKAGES="./experimental/aitools/..." ACCEPTANCE_TEST_FILTER="TestAccept/idontexistyet/aitools"
Expand Down
9 changes: 8 additions & 1 deletion acceptance/acceptance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ var (
UseVersion string
WorkspaceTmpDir bool
TerraformDir string
OnlyOutTestToml bool
)

// In order to debug CLI running under acceptance test, search for TestInprocessMode and update
Expand Down Expand Up @@ -78,6 +79,7 @@ func init() {
// creates these symlinks when a file_mirror is used for a provider (in .terraformrc). This flag
// allows us to download the provider to the workspace file system on DBR enabling DBR integration testing.
flag.StringVar(&TerraformDir, "terraform-dir", "", "Directory to download the terraform provider to")
flag.BoolVar(&OnlyOutTestToml, "only-out-test-toml", false, "Only regenerate out.test.toml files without running tests")
}

const (
Expand Down Expand Up @@ -307,14 +309,19 @@ func testAccept(t *testing.T, inprocessMode bool, singleTest string) int {
config, configPath := internal.LoadConfig(t, dir)
skipReason := getSkipReason(&config, configPath)

if testdiff.OverwriteMode {
if testdiff.OverwriteMode || OnlyOutTestToml {
// Generate materialized config for this test
// We do this before skipping the test, so the configs are generated for all tests.
materializedConfig, err := internal.GenerateMaterializedConfig(config)
require.NoError(t, err)
testutil.WriteFile(t, filepath.Join(dir, internal.MaterializedConfigFile), materializedConfig)
}

// If only regenerating out.test.toml, skip the actual test execution
if OnlyOutTestToml {
t.Skip("Skipping test execution (only regenerating out.test.toml)")
}

if skipReason != "" {
skippedDirs += 1
t.Skip(skipReason)
Expand Down