Repository navigation
test: enable local spark e2e on android #1980
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
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
6783ff3
test: wire Android E2E to local Spark
piotr-iohk f201a86
ci: isolate Spark and regular Android dispatches
piotr-iohk 0b86feb
ci: run Spark in the local E2E nightly
piotr-iohk a458991
ci: retry Spark nightly tests and retain attempt artifacts
piotr-iohk 5982d42
ci: restore pinned Spark images before nightly setup
piotr-iohk 74c7d7a
ci: summarize local E2E nightly in Slack
piotr-iohk 946b139
ci: preserve explicit Spark case outcomes
piotr-iohk ac3c8c4
ci: report Spark app setup failures across retries
piotr-iohk 5fb7d15
ci: temporarily dispatch the Spark nightly from the draft branch
piotr-iohk 5945b8d
ci: restore the regular E2E workflow after Spark dispatch
piotr-iohk e7a035d
ci: report local nightly results by job
piotr-iohk bf71399
ci: use reusable E2E retry step names
piotr-iohk 02aeced
test: align local Spark chain access and retain nightly diagnostics
piotr-iohk 4909f8d
test: preserve complete Spark retry logs and reject incomplete fixtur…
piotr-iohk b87435e
style: put the local Spark settings companion first
piotr-iohk 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,213 @@ | ||
| name: Local E2E Nightly (Android) | ||
|
|
||
| on: | ||
| schedule: | ||
| - cron: "35 5 * * *" | ||
| workflow_dispatch: | ||
| inputs: | ||
| e2e_branch: | ||
| description: "Ref in synonymdev/bitkit-e2e-tests" | ||
| type: string | ||
| default: main | ||
| post_to_slack: | ||
| description: "Post Local E2E Nightly summary to Slack (#bitkit-staging-nightly)" | ||
| type: boolean | ||
| default: false | ||
|
|
||
| permissions: | ||
| contents: read | ||
| packages: read | ||
|
|
||
| env: | ||
| TERM: xterm-256color | ||
| FORCE_COLOR: 1 | ||
|
|
||
| concurrency: | ||
| group: bitkit-local-e2e-nightly-${{ github.ref }} | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
| e2e-spark: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 120 | ||
| outputs: | ||
| e2e-sha: ${{ steps.e2e-source.outputs.commit }} | ||
| env: | ||
| COMPOSE_PROJECT_NAME: bitkit-spark-e2e | ||
| steps: | ||
| - name: Reserve regtest host ports | ||
| run: sudo sysctl -w net.ipv4.ip_local_reserved_ports=39388,43782,60001 | ||
|
|
||
| - uses: actions/checkout@v7 | ||
| with: | ||
| path: bitkit-android | ||
| persist-credentials: false | ||
|
|
||
| - uses: actions/checkout@v7 | ||
| id: e2e-source | ||
| with: | ||
| repository: synonymdev/bitkit-e2e-tests | ||
| ref: ${{ inputs.e2e_branch || 'main' }} | ||
| path: bitkit-e2e-tests | ||
| persist-credentials: false | ||
|
|
||
| - name: Check shared E2E branch for cache writes | ||
| id: cache-source | ||
| working-directory: bitkit-e2e-tests | ||
| run: | | ||
| if [[ "$(git symbolic-ref --quiet HEAD)" == refs/heads/main ]]; then | ||
| echo 'save-cache=true' >> "$GITHUB_OUTPUT" | ||
| fi | ||
|
|
||
| - uses: actions/setup-java@v6 | ||
| with: | ||
| java-version: "17" | ||
| distribution: temurin | ||
|
|
||
| - uses: gradle/actions/setup-gradle@v6 | ||
|
|
||
| - uses: actions/setup-node@v7 | ||
| with: | ||
| node-version: 22 | ||
| cache: npm | ||
| cache-dependency-path: bitkit-e2e-tests/package-lock.json | ||
|
|
||
| - name: Install Appium dependencies | ||
| working-directory: bitkit-e2e-tests | ||
| run: npm ci | ||
|
|
||
| - name: Restore pinned Spark images | ||
| id: spark-cache | ||
| uses: actions/cache/restore@v6 | ||
| continue-on-error: true | ||
| with: | ||
| path: ${{ runner.temp }}/bitkit-spark-images.tar | ||
| key: spark-images-v1-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('bitkit-e2e-tests/BITKIT_DOCKER_REVISION') }} | ||
|
|
||
| - name: Start pinned Spark fixture | ||
| id: fixture | ||
| working-directory: bitkit-e2e-tests | ||
| env: | ||
| SPARK_IMAGE_CACHE: ${{ runner.temp }}/bitkit-spark-images.tar | ||
| run: | | ||
| ./scripts/local-backend spark-up | ||
| ./scripts/local-backend spark-env >> "$GITHUB_ENV" | ||
| if [[ -s "$SPARK_IMAGE_CACHE" ]]; then | ||
| echo 'cache-ready=true' >> "$GITHUB_OUTPUT" | ||
| fi | ||
|
|
||
| - name: Save pinned Spark images | ||
| if: >- | ||
| steps.cache-source.outputs.save-cache == 'true' && steps.fixture.outputs.cache-ready == 'true' && | ||
| steps.spark-cache.outputs.cache-hit != 'true' && steps.spark-cache.outputs.cache-primary-key != '' | ||
| uses: actions/cache/save@v6 | ||
| continue-on-error: true | ||
| with: | ||
| path: ${{ runner.temp }}/bitkit-spark-images.tar | ||
| key: ${{ steps.spark-cache.outputs.cache-primary-key }} | ||
|
|
||
| - name: Build Android Spark app | ||
| working-directory: bitkit-e2e-tests | ||
| env: | ||
| GITHUB_ACTOR: ${{ github.actor }} | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| run: ./scripts/build-android-apk.sh | ||
|
|
||
| - name: Enable KVM | ||
| run: | | ||
| echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules | ||
| sudo udevadm control --reload-rules | ||
| sudo udevadm trigger --name-match=kvm | ||
|
|
||
| - name: Run E2E tests (attempt 1) | ||
| continue-on-error: true | ||
| id: test1 | ||
| uses: reactivecircus/android-emulator-runner@v2 | ||
| with: | ||
| profile: pixel_6 | ||
| api-level: 33 | ||
| arch: x86_64 | ||
| avd-name: Pixel_6 | ||
| force-avd-creation: false | ||
| emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-front none | ||
| script: cd bitkit-e2e-tests && ./scripts/run-spark-e2e.sh android | ||
| env: | ||
| RECORD_VIDEO: true | ||
| ATTEMPT: 1 | ||
|
|
||
| - name: Run E2E tests (attempt 2) | ||
| continue-on-error: true | ||
| id: test2 | ||
| if: steps.test1.outcome != 'success' | ||
| uses: reactivecircus/android-emulator-runner@v2 | ||
| with: | ||
| profile: pixel_6 | ||
| api-level: 33 | ||
| arch: x86_64 | ||
| avd-name: Pixel_6 | ||
| force-avd-creation: false | ||
| emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-front none | ||
| script: cd bitkit-e2e-tests && ./scripts/run-spark-e2e.sh android | ||
| env: | ||
| RECORD_VIDEO: true | ||
| ATTEMPT: 2 | ||
|
|
||
| - name: Run E2E tests (attempt 3) | ||
| id: test3 | ||
| if: steps.test1.outcome != 'success' && steps.test2.outcome != 'success' | ||
| uses: reactivecircus/android-emulator-runner@v2 | ||
| with: | ||
| profile: pixel_6 | ||
| api-level: 33 | ||
| arch: x86_64 | ||
| avd-name: Pixel_6 | ||
| force-avd-creation: false | ||
| emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-front none | ||
| script: cd bitkit-e2e-tests && ./scripts/run-spark-e2e.sh android | ||
| env: | ||
| RECORD_VIDEO: true | ||
| ATTEMPT: 3 | ||
|
|
||
| - name: Collect Spark logs | ||
| if: failure() || steps.test1.outcome == 'failure' || steps.test2.outcome == 'failure' | ||
| working-directory: bitkit-e2e-tests | ||
| run: | | ||
| mkdir -p artifacts | ||
| ./scripts/local-backend spark-logs --timestamps > artifacts/spark-docker.log 2>&1 || true | ||
|
|
||
| # Preserve logs and recordings from failed attempts even when a retry passes. | ||
| - uses: actions/upload-artifact@v7 | ||
| if: always() | ||
| with: | ||
| name: spark-android-${{ github.run_number }} | ||
| path: bitkit-e2e-tests/artifacts/ | ||
| retention-days: 7 | ||
|
|
||
| slack-report: | ||
| if: >- | ||
| always() && | ||
| (github.event_name == 'schedule' || | ||
| (github.event_name == 'workflow_dispatch' && inputs.post_to_slack == true)) | ||
| needs: e2e-spark | ||
| runs-on: ubuntu-24.04 | ||
| timeout-minutes: 5 | ||
| permissions: | ||
| contents: read | ||
| steps: | ||
| - name: Checkout shared Slack reporter | ||
| uses: actions/checkout@v7 | ||
| with: | ||
| repository: synonymdev/bitkit-e2e-tests | ||
| ref: main | ||
| persist-credentials: false | ||
|
|
||
| - name: Post Slack summary | ||
| run: python3 scripts/slack_summary.py e2e-local-nightly | ||
| env: | ||
| SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_STAGING }} | ||
| PLATFORM: android | ||
| LOCAL_NIGHTLY_RESULT: ${{ needs.e2e-spark.result }} | ||
| E2E_TESTS_REF: ${{ needs.e2e-spark.outputs.e2e-sha || inputs.e2e_branch || 'main' }} | ||
| E2E_TESTS_RESULT: ${{ needs.e2e-spark.result }} | ||
| RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | ||
| RUN_ATTEMPT: ${{ github.run_attempt }} | ||
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
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
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.
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.
Uh oh!
There was an error while loading. Please reload this page.