Skip to content
Open
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ test-update:
@# at the moment second pass is required because some tests show diff against output of another test for easier review
-go test ./acceptance -run '^TestAccept$$' -update -timeout=${LOCAL_TIMEOUT}

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

# Updates acceptance test output for template tests only
test-update-templates:
-go test ./acceptance -run '^TestAccept/bundle/templates' -update -timeout=${LOCAL_TIMEOUT}
Expand Down Expand Up @@ -147,4 +151,4 @@ generate:
$(GENKIT_BINARY) update-sdk


.PHONY: lint lintfull tidy lintcheck fmt fmtfull test cover showcover build snapshot snapshot-release schema integration integration-short acc-cover acc-showcover docs ws links checks test-update test-update-templates test-update-aws test-update-all generate-validation
.PHONY: lint lintfull tidy lintcheck fmt fmtfull test cover showcover build snapshot snapshot-release schema integration integration-short acc-cover acc-showcover docs ws links checks test-update test-update-templates test-update-aws test-update-all generate-validation test-generate-out-test-toml
32 changes: 20 additions & 12 deletions acceptance/acceptance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,18 @@ import (
)

var (
KeepTmp bool
NoRepl bool
VerboseTest bool = os.Getenv("VERBOSE_TEST") != ""
Tail bool
Forcerun bool
LogRequests bool
LogConfig bool
SkipLocal bool
UseVersion string
WorkspaceTmpDir bool
TerraformDir string
KeepTmp bool
NoRepl bool
VerboseTest bool = os.Getenv("VERBOSE_TEST") != ""
Tail bool
Forcerun bool
LogRequests bool
LogConfig bool
SkipLocal bool
UseVersion string
WorkspaceTmpDir bool
TerraformDir string
OnlyOutTestTomlMode bool
)

// In order to debug CLI running under acceptance test, search for TestInprocessMode and update
Expand Down Expand Up @@ -78,6 +79,8 @@ 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(&OnlyOutTestTomlMode, "only-out-test-toml", false, "Only regenerate out.test.toml files without running tests")
}

const (
Expand Down Expand Up @@ -295,14 +298,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 || OnlyOutTestTomlMode {
// 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 OnlyOutTestTomlMode {
t.Skip("Skipping test execution (only regenerating out.test.toml)")
}

if skipReason != "" {
skippedDirs += 1
t.Skip(skipReason)
Expand Down
5 changes: 5 additions & 0 deletions acceptance/auth/bundle_and_profile/out.test.toml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions acceptance/auth/credentials/basic/out.test.toml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions acceptance/auth/credentials/oauth/out.test.toml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions acceptance/auth/credentials/pat/out.test.toml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions acceptance/bundle/apps/app_yaml/out.test.toml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions acceptance/bundle/artifacts/build_and_files/out.test.toml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions acceptance/bundle/artifacts/glob_exact_whl/out.test.toml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions acceptance/bundle/artifacts/globs_in_files/out.test.toml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions acceptance/bundle/artifacts/globs_invalid/out.test.toml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions acceptance/bundle/artifacts/issue_3109/out.test.toml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions acceptance/bundle/artifacts/nil_artifacts/out.test.toml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions acceptance/bundle/artifacts/shell/bash/out.test.toml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions acceptance/bundle/artifacts/shell/basic/out.test.toml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions acceptance/bundle/artifacts/shell/cmd/out.test.toml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions acceptance/bundle/artifacts/shell/default/out.test.toml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions acceptance/bundle/artifacts/shell/err-bash/out.test.toml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions acceptance/bundle/artifacts/shell/err-sh/out.test.toml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions acceptance/bundle/artifacts/shell/invalid/out.test.toml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading