Skip to content

Commit 55b7e88

Browse files
authored
Convert TestBundleValidate to an acceptance test (#3059)
## Why <!-- Why are these changes needed? Provide the context that the reviewer might be missing. For example, were there any decisions behind the change that are not reflected in the code itself? --> One change in the series of changes for converting integration tests into acceptance tests. This will allow for easier testing of various backing solutions for bundle deployment
1 parent d68a18a commit 55b7e88

5 files changed

Lines changed: 88 additions & 66 deletions

File tree

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
bundle:
2+
name: "foobar"
3+
4+
resources:
5+
jobs:
6+
outer_loop:
7+
name: outer loop
8+
tasks:
9+
- task_key: my task
10+
run_job_task:
11+
job_id: ${resources.jobs.inner_loop.id}
12+
13+
inner_loop:
14+
name: inner loop
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
2+
>>> [CLI] bundle validate --output json
3+
{
4+
"bundle": {
5+
"environment": "default",
6+
"git": {
7+
"bundle_root_path": "."
8+
},
9+
"name": "foobar",
10+
"target": "default",
11+
"terraform": {
12+
"exec_path": "[TERRAFORM]"
13+
}
14+
},
15+
"resources": {
16+
"jobs": {
17+
"inner_loop": {
18+
"deployment": {
19+
"kind": "BUNDLE",
20+
"metadata_file_path": "/Workspace/Users/[USERNAME]/.bundle/foobar/default/state/metadata.json"
21+
},
22+
"edit_mode": "UI_LOCKED",
23+
"format": "MULTI_TASK",
24+
"max_concurrent_runs": 1,
25+
"name": "inner loop",
26+
"permissions": [],
27+
"queue": {
28+
"enabled": true
29+
}
30+
},
31+
"outer_loop": {
32+
"deployment": {
33+
"kind": "BUNDLE",
34+
"metadata_file_path": "/Workspace/Users/[USERNAME]/.bundle/foobar/default/state/metadata.json"
35+
},
36+
"edit_mode": "UI_LOCKED",
37+
"format": "MULTI_TASK",
38+
"max_concurrent_runs": 1,
39+
"name": "outer loop",
40+
"permissions": [],
41+
"queue": {
42+
"enabled": true
43+
},
44+
"tasks": [
45+
{
46+
"run_job_task": {
47+
"job_id": "${resources.jobs.inner_loop.id}"
48+
},
49+
"task_key": "my task"
50+
}
51+
]
52+
}
53+
}
54+
},
55+
"sync": {
56+
"paths": [
57+
"."
58+
]
59+
},
60+
"targets": null,
61+
"workspace": {
62+
"artifact_path": "/Workspace/Users/[USERNAME]/.bundle/foobar/default/artifacts",
63+
"current_user": {
64+
"id": "[USERID]",
65+
"short_name": "[USERNAME]",
66+
"userName": "[USERNAME]"
67+
},
68+
"file_path": "/Workspace/Users/[USERNAME]/.bundle/foobar/default/files",
69+
"resource_path": "/Workspace/Users/[USERNAME]/.bundle/foobar/default/resources",
70+
"root_path": "/Workspace/Users/[USERNAME]/.bundle/foobar/default",
71+
"state_path": "/Workspace/Users/[USERNAME]/.bundle/foobar/default/state"
72+
}
73+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
trace $CLI bundle validate --output json

integration/bundle/helpers_test.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,6 @@ func writeConfigFile(t testutil.TestingT, config map[string]any) string {
6262
return filepath
6363
}
6464

65-
func validateBundle(t testutil.TestingT, ctx context.Context, path string) ([]byte, error) {
66-
ctx = env.Set(ctx, "BUNDLE_ROOT", path)
67-
c := testcli.NewRunner(t, ctx, "bundle", "validate", "--output", "json")
68-
stdout, _, err := c.Run()
69-
return stdout.Bytes(), err
70-
}
71-
7265
func deployBundle(t testutil.TestingT, ctx context.Context, path string) {
7366
ctx = env.Set(ctx, "BUNDLE_ROOT", path)
7467
c := testcli.NewRunner(t, ctx, "bundle", "deploy", "--force-lock", "--auto-approve")

integration/bundle/validate_test.go

Lines changed: 0 additions & 59 deletions
This file was deleted.

0 commit comments

Comments
 (0)