|
1 | 1 | name: E2E (plugwright) |
2 | 2 |
|
3 | | -# In-game end-to-end tests via plugwright (boots a real Paper server + Mineflayer bot). |
4 | | -# Advisory / opt-in for now: run manually from the Actions tab. It is intentionally NOT wired |
5 | | -# to every push/PR yet (a full run boots a server + generates worlds, ~1-2 min, and is heavier |
6 | | -# and flakier than the Maven unit tests). Add a `pull_request` trigger once it's proven stable. |
| 3 | +# In-game end-to-end tests via plugwright (boots a real Paper server + Mineflayer bot) — |
| 4 | +# the layer the Maven/MockBukkit unit tests can't reach. Run ON DEMAND as a regression check. |
| 5 | +# |
| 6 | +# Trigger it from the GitHub UI (Actions tab -> "E2E (plugwright)" -> "Run workflow", pick the |
| 7 | +# branch/tag) or from the CLI: gh workflow run e2e.yml --ref <branch-or-tag> |
| 8 | +# |
| 9 | +# It is deliberately NOT wired to every push/PR: a run boots a server and generates worlds |
| 10 | +# (~1-2 min) and is heavier/flakier than the unit tests. For a nightly regression, add: |
| 11 | +# schedule: |
| 12 | +# - cron: "0 3 * * *" |
7 | 13 | on: |
8 | 14 | workflow_dispatch: |
| 15 | + inputs: |
| 16 | + test_names: |
| 17 | + description: "Only run tests whose name contains this (comma-separated substrings). Blank = all." |
| 18 | + required: false |
| 19 | + default: "" |
9 | 20 |
|
10 | 21 | jobs: |
11 | 22 | e2e: |
12 | 23 | name: E2E tests |
13 | 24 | runs-on: ubuntu-latest |
| 25 | + timeout-minutes: 25 |
14 | 26 | steps: |
15 | 27 | - uses: actions/checkout@v4 |
16 | 28 |
|
|
25 | 37 | with: |
26 | 38 | node-version: 20 |
27 | 39 |
|
| 40 | + - name: Set up Gradle (with caching) |
| 41 | + uses: gradle/actions/setup-gradle@v4 |
| 42 | + |
| 43 | + # Reuse the Paper jar + downloaded libraries and the BentoBox/BSkyBlock jars across runs. |
| 44 | + # plugwright's clean step preserves server.jar / cache / libraries, and build.gradle.kts |
| 45 | + # caches the dependency jars in .deps, so this avoids re-downloading ~60 MB every run. |
| 46 | + - name: Cache Paper + dependency jars |
| 47 | + uses: actions/cache@v4 |
| 48 | + with: |
| 49 | + path: | |
| 50 | + e2e/.deps |
| 51 | + e2e/run/server.jar |
| 52 | + e2e/run/cache |
| 53 | + e2e/run/libraries |
| 54 | + key: plugwright-${{ hashFiles('e2e/build.gradle.kts') }} |
| 55 | + |
| 56 | + - name: Cache npm modules |
| 57 | + uses: actions/cache@v4 |
| 58 | + with: |
| 59 | + path: e2e/src/test/e2e/node_modules |
| 60 | + key: e2e-npm-${{ hashFiles('e2e/src/test/e2e/package.json') }} |
| 61 | + |
28 | 62 | - name: Build Challenges jar (Maven) |
29 | 63 | run: mvn -B -DskipTests package |
30 | 64 |
|
31 | 65 | - name: Run E2E tests |
32 | 66 | working-directory: e2e |
33 | | - run: ./gradlew plugwrightTest --no-daemon |
| 67 | + env: |
| 68 | + PLUGWRIGHT_DEBUG: "1" |
| 69 | + run: | |
| 70 | + ARGS="" |
| 71 | + if [ -n "${{ inputs.test_names }}" ]; then |
| 72 | + ARGS="-PtestNames=${{ inputs.test_names }}" |
| 73 | + fi |
| 74 | + ./gradlew plugwrightTest $ARGS --no-daemon |
| 75 | +
|
| 76 | + # Always upload the server log + any plugwright report so a regression is debuggable. |
| 77 | + - name: Upload server log & report |
| 78 | + if: always() |
| 79 | + uses: actions/upload-artifact@v4 |
| 80 | + with: |
| 81 | + name: e2e-logs |
| 82 | + path: | |
| 83 | + e2e/run/logs/** |
| 84 | + e2e/run/plugwright-report/** |
| 85 | + if-no-files-found: ignore |
| 86 | + retention-days: 14 |
0 commit comments