Skip to content

Commit 5fa47cd

Browse files
test(ministack): move scale-set fixtures to example PR
1 parent 91d24e8 commit 5fa47cd

5 files changed

Lines changed: 69 additions & 8 deletions

File tree

.github/workflows/ministack.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ jobs:
7272
- ephemeral
7373
- multi-runner
7474
- multi-runner-v2
75+
- multi-runner-scale-set
7576
- migration-test
7677
- termination-watcher
7778
services:

tests/ministack/README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# MiniStack example tests
22

33
The MiniStack workflow runs the `base`, `prebuilt`, `default`, `ephemeral`,
4-
`multi-runner`, `multi-runner-v2`, and `termination-watcher` examples directly
4+
`multi-runner`, `multi-runner-v2`, `multi-runner-scale-set`, and
5+
`termination-watcher` examples directly
56
with Terraform 1.5.6 and the latest Terraform release, and with OpenTofu 1.11
67
and the latest OpenTofu release.
78
The examples with input variables get their inputs from their own tfvars files
@@ -10,8 +11,8 @@ and uses the configuration checked into the example itself. No override files,
1011
setup module, or Terraform fixture configuration is checked in. The helper
1112
creates and removes a temporary AMI override for `default` and
1213
`ephemeral`, temporary SSM parameters for `multi-runner`, and temporary AMI
13-
fixtures for `multi-runner-v2`. The migration test uses its dedicated
14-
`run-migration-test.sh` lifecycle script.
14+
fixtures for `multi-runner-v2` and `multi-runner-scale-set`. The migration test
15+
uses its dedicated `run-migration-test.sh` lifecycle script.
1516

1617
Start MiniStack, set the AWS endpoint and test credentials, then run:
1718

@@ -28,6 +29,8 @@ tests/ministack/run-example.sh apply multi-runner
2829
# or
2930
tests/ministack/run-example.sh apply multi-runner-v2
3031
# or
32+
tests/ministack/run-example.sh apply multi-runner-scale-set
33+
# or
3134
tests/ministack/run-example.sh apply termination-watcher
3235
```
3336

@@ -36,8 +39,8 @@ ZIP fixtures in the paths expected by the modules when they are absent, and
3639
removes only the files it created. For `prebuilt`, it seeds AMI metadata through
3740
MiniStack's AWS-compatible EC2 API, then removes only the resources it created
3841
during cleanup. MiniStack v1.5.11 provides the EC2 image behavior needed by the
39-
`default`, `ephemeral`, and `multi-runner` examples, so they are included in
40-
the same lifecycle matrix.
42+
`default`, `ephemeral`, `multi-runner`, and `multi-runner-scale-set` examples,
43+
so they are included in the same lifecycle matrix.
4144

4245
## Webhook and runner lifecycle smoke test
4346

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
environment = "ministack-scale-set"
2+
aws_region = "eu-west-1"
3+
4+
github_app = {
5+
id = "0"
6+
key_base64 = "ministack-invalid-key"
7+
installation_id = "1"
8+
}
9+
10+
runner_binaries_enabled = false
11+
12+
ami = {
13+
"linux-arm64" = {
14+
filter = {
15+
name = ["ministack-scale-set-linux-arm64"]
16+
state = ["available"]
17+
}
18+
owners = ["self"]
19+
}
20+
"linux-x64" = {
21+
filter = {
22+
name = ["ministack-scale-set-linux-x64"]
23+
state = ["available"]
24+
}
25+
owners = ["self"]
26+
}
27+
"linux-scale-set" = {
28+
filter = {
29+
name = ["ministack-scale-set-linux-x64"]
30+
state = ["available"]
31+
}
32+
owners = ["self"]
33+
}
34+
"windows-x64" = {
35+
filter = {
36+
name = ["ministack-scale-set-windows-x64"]
37+
state = ["available"]
38+
}
39+
owners = ["self"]
40+
}
41+
}
42+
43+
scale_set = {
44+
config_url = "https://github.com/example"
45+
name = "ministack-scale-set"
46+
id = 1
47+
runner_group_id = 1
48+
runner_owner = "example"
49+
runner_registration_level = "organization"
50+
}

tests/ministack/multi-runner-v2.tfvars

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ github_app = {
66
key_base64 = "ministack-invalid-key"
77
}
88

9+
runner_binaries_enabled = false
10+
911
ami = {
1012
"linux-arm64" = {
1113
filter = {

tests/ministack/run-example.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ case "$iac_binary" in
2323
esac
2424

2525
case "$example" in
26-
base | prebuilt | default | ephemeral | multi-runner | multi-runner-v2)
26+
base | prebuilt | default | ephemeral | multi-runner | multi-runner-v2 | multi-runner-scale-set)
2727
use_tfvars=true
2828
;;
2929
migration-test)
@@ -33,15 +33,15 @@ case "$example" in
3333
use_tfvars=false
3434
;;
3535
*)
36-
echo "Supported examples for the runner are: base, prebuilt, default, ephemeral, multi-runner, multi-runner-v2, migration-test, termination-watcher" >&2
36+
echo "Supported examples for the runner are: base, prebuilt, default, ephemeral, multi-runner, multi-runner-v2, multi-runner-scale-set, migration-test, termination-watcher" >&2
3737
exit 64
3838
;;
3939
esac
4040

4141
case "$action" in
4242
init | plan | apply | destroy) ;;
4343
*)
44-
echo "Usage: $0 {init|plan|apply|destroy} {base|prebuilt|default|ephemeral|multi-runner|multi-runner-v2|migration-test|termination-watcher} [TFVARS_FILE]" >&2
44+
echo "Usage: $0 {init|plan|apply|destroy} {base|prebuilt|default|ephemeral|multi-runner|multi-runner-v2|multi-runner-scale-set|migration-test|termination-watcher} [TFVARS_FILE]" >&2
4545
exit 64
4646
;;
4747
esac
@@ -325,6 +325,11 @@ $lambda_zip"
325325
create_ami_fixture "ministack-v2-linux-x64" x86_64 >/dev/null
326326
create_ami_fixture "ministack-v2-windows-x64" x86_64 >/dev/null
327327
;;
328+
multi-runner-scale-set)
329+
create_ami_fixture "ministack-scale-set-linux-x64" x86_64 >/dev/null
330+
create_ami_fixture "ministack-scale-set-linux-arm64" arm64 >/dev/null
331+
create_ami_fixture "ministack-scale-set-windows-x64" x86_64 >/dev/null
332+
;;
328333
esac
329334
}
330335

0 commit comments

Comments
 (0)