Open
Conversation
- Update build.yml to build both armhf and arm64 using CustomPiOS v2 board system (BASE_BOARD matrix) with base_image_downloader - Add testing/ directory with Docker+QEMU-based E2E test harness that boots an OctoPi arm64 image, verifies SSH access, and checks OctoPrint web server availability - Add e2e-test.yml workflow triggered by build completion that runs E2E tests on the arm64 artifact and uploads screenshot + logs
- Add e2e-test job to build.yml with needs: build, downloads the octopi-arm64 artifact and runs the QEMU test + screenshot - Change e2e-test.yml to trigger on push to feature/e2e and devel using a stable arm64 image (workflow_run doesn't work from non-default branches)
E2E testing lives in build.yml as a job that tests the built arm64 image. No need for a separate workflow against a stable image.
The previous screenshot captured OctoPrint's "starting up" loading screen instead of the actual UI. Now both the CI workflow and the E2E test wait for OctoPrint to fully finish its startup phase by checking for CONFIG_WIZARD in the page HTML, and puppeteer waits for the #wizard_dialog to become visible before capturing.
Replace standalone testing scripts with the shared framework from CustomPiOS/src/distro_testing/. The CI workflow now checks out CustomPiOS and copies the shared scripts into the build context. OctoPi-specific logic moves into hooks/ (haproxy IPv4 patching, headless browser screenshot). Removes run-test.sh and testing/scripts/ (now provided by the framework).
The puppeteer-based screenshot was from the pre-framework approach and fails because the container stops the QEMU port forward after tests complete. Screenshots are now handled inside the container via the hooks/screenshot.sh mechanism. Also remove KEEP_ALIVE and increase the wait timeout to 25 minutes.
The test and screenshot hook both matched "OctoPrint" in the starting page title instead of waiting for the actual wizard. Now both poll specifically for CONFIG_WIZARD in the response. The test saves HTML from the matching response (not a second curl). Add chromium to the Docker container for headless screenshots. Increase poll timeout to 600s for slower CI runners.
The headless screenshot silently failed (2>/dev/null hid the error). Now show stderr, use --headless=new, --disable-dev-shm-usage, and add missing shared libraries (libnss3, libgbm1, etc.) needed for Chromium headless in the container environment.
The base image has /usr/bin/chromium-browser as a snap wrapper stub that prints "requires the chromium snap". Now search for the actual chromium binary at /usr/lib/chromium/chromium first, skipping any snap stubs. Add diagnostic output if no working binary is found.
The Ubuntu-based ptrsr/pi-ci image only has a snap stub for chromium. Install google-chrome-stable from Google's apt repo instead, which provides a real headless browser binary. The test now takes a screenshot right when CONFIG_WIZARD is confirmed and validates the PNG is >10KB (a real rendered page, not blank). The screenshot hook also uses google-chrome-stable as a redundant capture.
Chrome headless can hang indefinitely if the page doesn't load. Wrap all Chrome calls with `timeout 30` to kill after 30 seconds. Increase the workflow wait loop from 25 to 35 min and job timeout from 30 to 45 min, since OctoPrint can take 10+ min to start on slower CI runners.
Install chromium in the Docker container alongside google-chrome-stable. Update screenshot.sh to try google-chrome-stable, chromium, and chromium-browser in order, with screenshot size validation.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This adds automated end2end tests that confirm that OctoPi loads octoprint and boots in a virtual qemu environment. Currently it tests that OctoPrint starts and that ssh is working and captures a screenshot of the install wizard.
It could be extended to include other tests. It runs on github actions and locally:
cd testing/ ./run-test.sh