Skip to content

Commit

Permalink
move hook and store test
Browse files Browse the repository at this point in the history
  • Loading branch information
mcalhoun committed Feb 4, 2025
1 parent 2dc79e1 commit 073e2e8
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,24 @@ func TestMainHooksAndStoreIntegration(t *testing.T) {
if err != nil {
t.Fatalf("failed to get current working directory: %v", err)
}
defer os.RemoveAll(path.Join(origDir, "testdata", "fixtures", "hooks-test", ".terraform"))
defer os.RemoveAll(path.Join(origDir, "tests", "fixtures", "scenarios", "hooks-test", ".terraform"))
defer os.Chdir(origDir)

if err := os.Chdir("testdata/fixtures/hooks-test"); err != nil {
if err := os.Chdir("tests/fixtures/scenarios/hooks-test"); err != nil {
t.Fatalf("failed to change directory: %v", err)
}

// Capture the original arguments
origArgs := os.Args
defer func() { os.Args = origArgs }()

// Set the arguments for the first call to main() to deeploy the `random1` component, which uses a `hook` to set a
// Set the arguments for the first call to main() to deploy the `component1` component, which uses a `hook` to set a
// value in Redis
os.Args = []string{"atmos", "terraform", "deploy", "random1", "-s", "test"}
os.Args = []string{"atmos", "terraform", "deploy", "component1", "-s", "test"}
main()

// Set the arguments for the second call to main() to deeploy the `random2` component, which uses a `store` to read a
// Set the arguments for the second call to main() to deeploy the `component2` component, which uses a `store` to read a
// value that was set in the first apply.
os.Args = []string{"atmos", "terraform", "deploy", "random2", "-s", "test"}
os.Args = []string{"atmos", "terraform", "deploy", "component2", "-s", "test"}
main()
}
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
components:
terraform:
random1:
component1:
metadata:
component: random
component: hook-and-store
hooks:
store-outputs:
events:
Expand All @@ -15,9 +15,9 @@ components:
stage: test
random: "random1"

random2:
component2:
metadata:
component: random
component: hook-and-store
vars:
stage: test
random: !store testredis random1 random_id
random: !store testredis component1 random_id

0 comments on commit 073e2e8

Please sign in to comment.