Skip to content

test(ministack): cover scale-set controller integration - #5416

Closed
edersonbrilhante wants to merge 54 commits into
mainfrom
test-scale-set-integration
Closed

edersonbrilhante wants to merge 54 commits into
mainfrom
test-scale-set-integration

Conversation

@edersonbrilhante

@edersonbrilhante edersonbrilhante commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Description

Add reusable MiniStack fixture support for the multi-runner-scale-set example in the standard Terraform/OpenTofu lifecycle matrix.

  • Document the scale-set example in tests/ministack/README.md.
  • Add scale-set-specific test inputs and synthetic AMI fixture names.
  • Extend tests/ministack/run-example.sh to initialize, apply, and destroy the scale-set example.
  • Disable runner-binary setup where the scale-set controller does not need the regular runner-binary fixtures.

This PR owns the generic example-fixture and lifecycle-harness support. The ECS controller, ECR image, MockServer protocol, runner registration, and scale-up/scale-down lifecycle smoke test are kept in PR #5375.

Test Plan

  • sh -n tests/ministack/run-example.sh
  • shellcheck tests/ministack/run-example.sh
  • Terraform initialization and validation for the affected MiniStack example inputs.
  • Workflow/example lifecycle validation through the MiniStack matrix.

Related Issues

Depends on #5405. The controller lifecycle smoke test is in #5375.

@github-actions

Copy link
Copy Markdown
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@edersonbrilhante
edersonbrilhante added this pull request to stack #5406 September 11, 2026 17:47
@edersonbrilhante
edersonbrilhante force-pushed the feat-scale-set-example-followup branch 3 times, most recently from cb70e66 to 3bf4b05 Compare September 15, 2026 09:53
@edersonbrilhante
edersonbrilhante force-pushed the test-scale-set-integration branch from beac2d7 to b0b79c7 Compare September 15, 2026 09:58
@edersonbrilhante
edersonbrilhante marked this pull request as ready for review September 15, 2026 09:59
@edersonbrilhante
edersonbrilhante requested review from a team as code owners September 15, 2026 09:59
@edersonbrilhante
edersonbrilhante force-pushed the feat-scale-set-example-followup branch 2 times, most recently from 9bc003c to 21edd38 Compare September 15, 2026 13:49
@edersonbrilhante
edersonbrilhante force-pushed the test-scale-set-integration branch from 67513ac to 3b48adb Compare September 15, 2026 13:51
@edersonbrilhante
edersonbrilhante removed this pull request from stack #5406 September 15, 2026 13:54
@edersonbrilhante
edersonbrilhante added this pull request to stack #5431 September 15, 2026 13:55
@edersonbrilhante
edersonbrilhante force-pushed the feat-scale-set-example-followup branch from 486be9f to 4f05336 Compare September 15, 2026 13:59
@edersonbrilhante
edersonbrilhante force-pushed the test-scale-set-integration branch from fbb6ed3 to c423df2 Compare September 15, 2026 14:00
@edersonbrilhante
edersonbrilhante force-pushed the feat-scale-set-example-followup branch from 4f05336 to edd0ab7 Compare September 15, 2026 14:02
@edersonbrilhante
edersonbrilhante force-pushed the test-scale-set-integration branch from c423df2 to f97bc8c Compare September 15, 2026 14:02
@edersonbrilhante
edersonbrilhante force-pushed the feat-scale-set-example-followup branch from edd0ab7 to 77bce9f Compare September 15, 2026 14:10
@edersonbrilhante
edersonbrilhante force-pushed the test-scale-set-integration branch from f97bc8c to da79830 Compare September 15, 2026 14:11
@edersonbrilhante
edersonbrilhante force-pushed the feat-scale-set-example-followup branch from 75343a9 to 274a43b Compare September 15, 2026 14:36
@edersonbrilhante
edersonbrilhante force-pushed the test-scale-set-integration branch from 50113c5 to 9e12e90 Compare September 15, 2026 14:36
@edersonbrilhante
edersonbrilhante force-pushed the feat-scale-set-example-followup branch from 274a43b to f940ee5 Compare September 15, 2026 15:35
@edersonbrilhante
edersonbrilhante force-pushed the test-scale-set-integration branch from 2829395 to 8110df5 Compare September 15, 2026 15:35
@edersonbrilhante
edersonbrilhante force-pushed the feat-scale-set-example-followup branch from f940ee5 to c5bb223 Compare September 15, 2026 17:58
@edersonbrilhante
edersonbrilhante force-pushed the test-scale-set-integration branch from 8110df5 to b558fd7 Compare September 15, 2026 17:58
@edersonbrilhante
edersonbrilhante force-pushed the feat-scale-set-example-followup branch from c5bb223 to a602f6e Compare September 15, 2026 18:36
@edersonbrilhante
edersonbrilhante force-pushed the test-scale-set-integration branch from b558fd7 to 0b8c717 Compare September 15, 2026 18:36
@edersonbrilhante
edersonbrilhante force-pushed the feat-scale-set-example-followup branch from 895a0a9 to 32f4393 Compare September 17, 2026 15:20
@edersonbrilhante
edersonbrilhante force-pushed the feat-scale-set-example-followup branch from 20e7a80 to 6b419fb Compare September 17, 2026 17:24
@edersonbrilhante
edersonbrilhante force-pushed the feat-scale-set-example-followup branch from 238c0bc to 5fa47cd Compare September 17, 2026 18:20
@edersonbrilhante
edersonbrilhante removed this pull request from stack #5437 September 17, 2026 18:20
@edersonbrilhante
edersonbrilhante changed the base branch from feat-scale-set-example-followup to main September 17, 2026 18:25
@edersonbrilhante
edersonbrilhante deleted the test-scale-set-integration branch September 17, 2026 18:44
edersonbrilhante added a commit that referenced this pull request Sep 18, 2026
## Description

Add the scale-set service-container smoke test and the ECS/MockServer
scale-set lifecycle test on top of the scale-set Terraform wiring.

- Build the scale-set service image from
`lambdas/services/scale-set/Dockerfile`, push it to a MiniStack ECR
repository, and allow the MiniStack account to pull it.
- Run the controller through its real ECS container entrypoint with a
read-only filesystem, dropped capabilities, and `no-new-privileges`.
- Configure the scale-set example with the MockServer GitHub App/Actions
endpoints and the required SSM-backed GitHub App values.
- Verify the controller resolves the runner group and scale set, updates
labels, creates a session, and reaches a converged state.
- Start at `minRunners = 1`, verify MiniStack creates and registers the
EC2 runner, then register a new ECS task definition with `minRunners =
0` and verify the controller removes the mocked GitHub runner and
terminates the EC2 instance.
- Keep the MockServer protocol fixture deterministic, including dynamic
agent-name matching and runner/session cleanup.

The workflow uses MiniStack 1.5.12 and a pinned MockServer image. The
scale-set lifecycle integration remains in this PR; PR #5416 provides
only the reusable example-fixture support.

## Test Plan

- Full local MiniStack 1.5.12 lifecycle test passed: image build/ECR
push, Terraform apply of 272 resources, ECS controller startup, scale-up
runner registration, ECS redeployment with `minRunners = 0`, EC2 runner
termination, MockServer session cleanup, and Terraform destroy.
- `sh -n tests/ministack/run-scale-set-integration.sh`
- `shellcheck -S warning tests/ministack/run-scale-set-integration.sh`
- `python3 -m json.tool mockserver/initializerJson.json`
- `terraform fmt -check examples/multi-runner-scale-set/main.tf
examples/multi-runner-scale-set/variables.tf`
- `git diff --check`

## Related Issues

Depends on #5347. The Terraform wiring is provided by the scale-set
stack beginning at #5350; the example is restored in #5405.

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Guilherme Caulada <guilherme.caulada@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant