-
Notifications
You must be signed in to change notification settings - Fork 4
test(app): add smoke test #541
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
iamquang95
wants to merge
9
commits into
main
Choose a base branch
from
feat/smoke-test
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
e3dc26a
test(app): add smoke test
iamquang95 b42647e
test(smoke): gate smoke tests on firing alerts via generated rules an…
iamquang95 8243b74
Merge remote-tracking branch 'origin/main' into feat/smoke-test
iamquang95 add0471
fix: remove compose cli
iamquang95 1732cb1
fix: flanky 1_4 node down
iamquang95 74c118e
feat(cli): read CHARON_* env vars in create cluster/dkg
iamquang95 f5c5006
fix: address comments
iamquang95 1b18551
Merge remote-tracking branch 'origin/main' into feat/smoke-test
iamquang95 451532f
feat(ci): run smoke test manually
iamquang95 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,88 @@ | ||
| name: Compose smoke tests | ||
|
|
||
| # Manual only: each scenario stands up a full docker-compose cluster (N nodes + | ||
| # relay + prometheus) and observes it for 2-3 minutes, so the full matrix takes | ||
| # ~30 minutes on top of a from-source pluto image build. Too heavy to attach to | ||
| # push or pull_request. | ||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| scenarios: | ||
| description: "Scenario filter (go test -run regex). Empty runs the full matrix." | ||
| type: string | ||
| default: "" | ||
| go_timeout: | ||
| description: "go test -timeout. Must exceed the sum of the selected scenarios." | ||
| type: string | ||
| default: "35m" | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| permissions: | ||
| contents: read | ||
| actions: read | ||
|
|
||
| jobs: | ||
| smoke: | ||
| name: Compose smoke tests | ||
| runs-on: ubuntu-24.04 | ||
| # Covers the pluto image build (release build of pluto-cli inside docker, | ||
| # uncached on a fresh runner) plus the scenario matrix. | ||
| timeout-minutes: 90 | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v6 | ||
|
|
||
| - name: Set up Go | ||
| uses: actions/setup-go@v5 | ||
| with: | ||
| go-version-file: test-infra/compose/go.mod | ||
| cache-dependency-path: test-infra/compose/go.sum | ||
|
|
||
| - name: Run smoke tests | ||
| working-directory: test-infra/compose | ||
| # Inputs are passed as env vars, never interpolated into the script: | ||
| # `${{ inputs.* }}` inside `run:` is substituted before the shell sees | ||
| # it, so a crafted value would execute as shell. | ||
| env: | ||
| # The pluto image is built from this checkout during the define step. | ||
| PLUTO_REPO: ${{ github.workspace }} | ||
| SCENARIOS: ${{ inputs.scenarios }} | ||
| GO_TIMEOUT: ${{ inputs.go_timeout }} | ||
| LOG_DIR: ${{ runner.temp }}/smoke-logs | ||
| run: | | ||
| mkdir -p "$LOG_DIR" | ||
|
|
||
| args=( | ||
| ./smoke -v -integration | ||
| "-timeout=$GO_TIMEOUT" | ||
| "-log-dir=$LOG_DIR" | ||
| # Containers run as root, so the artefacts they leave in the compose | ||
| # dir are root-owned; without this the runner cannot clean them up. | ||
| -sudo-perms | ||
| ) | ||
| if [ -n "$SCENARIOS" ]; then | ||
| args+=(-run "$SCENARIOS") | ||
| fi | ||
|
|
||
| go test "${args[@]}" | ||
|
|
||
| - name: Upload scenario logs | ||
| # Always: a passing run's logs are the baseline for triaging the next | ||
| # failure, and these clusters are expensive to reproduce. | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: smoke-logs-${{ github.run_id }} | ||
| path: ${{ runner.temp }}/smoke-logs | ||
| if-no-files-found: warn | ||
| retention-days: 7 | ||
|
|
||
| - name: Collect container state on failure | ||
| if: failure() | ||
| run: | | ||
| docker ps -a || true | ||
| docker images || true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is too much, drop these tests and all associated ceremony.