|
44 | 44 | - name: Run Desktop Tests |
45 | 45 | # Using --console=plain so logs are readable in GitHub Actions |
46 | 46 | run: ./gradlew :python-multiplatform:desktopTest --console=plain |
| 47 | + |
| 48 | + # pythonx-compose's UI.ipynb, end to end (#26, #213): the installed pythonx-compose wheel drives a |
| 49 | + # real desktop Compose host, pixel-compared with the same composables drawn from Kotlin. Its own |
| 50 | + # job and Gradle invocation, so it neither hides nor is hidden by the module tests above. |
| 51 | + notebook-e2e: |
| 52 | + name: Notebook E2E (pythonx-compose wheel) |
| 53 | + runs-on: macos-latest |
| 54 | + env: |
| 55 | + WHEEL_DIR: ${{ github.workspace }}/.tmp/pythonx-compose-dist |
| 56 | + steps: |
| 57 | + - name: Checkout |
| 58 | + uses: actions/checkout@v4 |
| 59 | + |
| 60 | + # Beside this repository, as on a developer machine; the wheel is built from it, not installed |
| 61 | + # from PyPI, so the scenarios follow pythonx-compose develop. |
| 62 | + - name: Checkout pythonx-compose develop |
| 63 | + uses: actions/checkout@v4 |
| 64 | + with: |
| 65 | + repository: thisisthepy/pythonx-compose |
| 66 | + ref: develop |
| 67 | + path: .tmp/pythonx-compose |
| 68 | + fetch-depth: 1 |
| 69 | + |
| 70 | + - name: Setup uv |
| 71 | + uses: astral-sh/setup-uv@v6 |
| 72 | + |
| 73 | + - name: Build the pythonx-compose wheel |
| 74 | + run: | |
| 75 | + uv build --wheel --directory .tmp/pythonx-compose --out-dir "$WHEEL_DIR" |
| 76 | + ls -l "$WHEEL_DIR" |
| 77 | + git -C .tmp/pythonx-compose log -1 --format='pythonx-compose %h %s' |
| 78 | +
|
| 79 | + - name: Setup Java |
| 80 | + uses: actions/setup-java@v4 |
| 81 | + with: |
| 82 | + java-version: '21' |
| 83 | + distribution: 'zulu' |
| 84 | + cache: 'gradle' |
| 85 | + |
| 86 | + - name: Cache Konan |
| 87 | + uses: actions/cache@v4 |
| 88 | + with: |
| 89 | + path: ~/.konan |
| 90 | + key: ${{ runner.os }}-konan-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} |
| 91 | + restore-keys: | |
| 92 | + ${{ runner.os }}-konan- |
| 93 | +
|
| 94 | + # No skip property: without a wheel every scenario fails by name, which is what CI wants. |
| 95 | + - name: Run the notebook scenarios |
| 96 | + run: > |
| 97 | + ./gradlew :python-multiplatform-compose:fixtures:notebook-e2e:desktopTest --rerun |
| 98 | + -PpythonxComposeWheel="$WHEEL_DIR" --console=plain |
| 99 | +
|
| 100 | + - name: Count the scenarios |
| 101 | + if: always() |
| 102 | + run: | |
| 103 | + python3 - <<'PY' >> "$GITHUB_STEP_SUMMARY" |
| 104 | + import glob, xml.etree.ElementTree as ET |
| 105 | + files = glob.glob("python-multiplatform-compose/fixtures/notebook-e2e/build/test-results/desktopTest/*.xml") |
| 106 | + total = failed = skipped = 0 |
| 107 | + for f in files: |
| 108 | + suite = ET.parse(f).getroot() |
| 109 | + total += int(suite.get("tests", 0)) |
| 110 | + failed += int(suite.get("failures", 0)) + int(suite.get("errors", 0)) |
| 111 | + skipped += int(suite.get("skipped", 0)) |
| 112 | + print(f"Notebook E2E: {total} tests, {total - failed - skipped} passed, {failed} failed, {skipped} skipped ({len(files)} suites)") |
| 113 | + PY |
| 114 | + cat "$GITHUB_STEP_SUMMARY" |
| 115 | +
|
| 116 | + - name: Upload the test reports |
| 117 | + if: failure() |
| 118 | + uses: actions/upload-artifact@v4 |
| 119 | + with: |
| 120 | + name: notebook-e2e-reports |
| 121 | + path: | |
| 122 | + python-multiplatform-compose/fixtures/notebook-e2e/build/reports/tests/desktopTest |
| 123 | + python-multiplatform-compose/fixtures/notebook-e2e/build/test-results/desktopTest |
0 commit comments