Skip to content

Commit bbc6e6f

Browse files
committed
CI: Run the notebook E2E on develop pushes
desktop.yml gets a notebook-e2e job on macos-latest: it checks out pythonx-compose develop, builds its wheel with uv, and runs :python-multiplatform-compose:fixtures:notebook-e2e:desktopTest --rerun with -PpythonxComposeWheel as its own Gradle invocation. No skip property, so a missing wheel fails by name. The job summary counts the JUnit results; reports are uploaded on failure. README and SPEC say CI runs it. Closes #213
1 parent 8a8d06d commit bbc6e6f

3 files changed

Lines changed: 81 additions & 3 deletions

File tree

‎.github/workflows/desktop.yml‎

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,80 @@ jobs:
4444
- name: Run Desktop Tests
4545
# Using --console=plain so logs are readable in GitHub Actions
4646
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

‎docs/SPEC.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -471,8 +471,8 @@ All in `PM/commonTest`, so they run wherever the interpreter loads.
471471
README with the cell map, the wheel commands and the gaps), 20 passed, 0 failed against the
472472
pythonx-compose `develop` wheel on 2026-10-04 (after #146, #168 and pythonx-compose #88), and again
473473
with the notebook's own state spelling (`main.App.messages.getValue()` / `setValue(...)`, #174)
474-
against pythonx-compose f6dd3e2. No CI
475-
workflow runs the module yet.
474+
against pythonx-compose f6dd3e2. CI runs it on every push to `develop`
475+
(`desktop.yml`, job `notebook-e2e`, #213), against a wheel built from pythonx-compose `develop`.
476476
- **B-11** (#192) The artifact walker skips every declaration whose package has an `internal` segment
477477
(`*.internal` and `*.internal.*`, as in `androidx.compose.ui.internal`), on jars and on klibs. That is the
478478
Kotlin `.api` dump convention: a library that puts a declaration in such a package has declared it

‎python-multiplatform-compose/fixtures/notebook-e2e/README.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ JAVA_HOME=<JDK 21> ./gradlew :python-multiplatform-compose:fixtures:notebook-e2e
4242

4343
**Without a wheel the tests fail, by name, with a message that says how to give one.** They do not
4444
skip. Only `-PnotebookE2e.skip=true` disables `desktopTest`, and the build log then says that the
45-
scenarios did not run. Which of the two CI wants is CI's decision; no workflow runs this module yet.
45+
scenarios did not run. CI wants the scenarios run: the `notebook-e2e` job of `.github/workflows/desktop.yml` (#213) builds
46+
the wheel from pythonx-compose `develop` with uv and runs this module on every push to `develop`.
4647

4748
"Installing" is unpacking the pure-Python wheel into `build/pythonx-compose/site-packages`
4849
(`installPythonxComposeWheel`), which is all installing a pure-Python wheel amounts to; the embedded

0 commit comments

Comments
 (0)