Fix not fully functional basic tests #16
This file contains 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 is a GitHub workflow defining a set of jobs with a set of steps. | |
# ref: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions | |
# | |
name: Test | |
on: | |
pull_request: | |
push: | |
branches-ignore: | |
- "dependabot/**" | |
- "pre-commit-ci-update-config" | |
tags: ["**"] | |
workflow_dispatch: | |
jobs: | |
container: | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 10 | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- vncserver: tigervnc | |
- vncserver: turbovnc | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install test requirements (websocat) | |
run: | | |
wget -q https://github.com/vi/websocat/releases/download/v1.12.0/websocat.x86_64-unknown-linux-musl \ | |
-O /usr/local/bin/websocat | |
chmod +x /usr/local/bin/websocat | |
- name: Build image | |
run: | | |
docker build --build-arg vncserver=${{ matrix.vncserver }} -t jupyter-remote-desktop-proxy . | |
- name: websockify --help | |
run: | | |
docker run jupyter-remote-desktop-proxy websockify --help | |
- name: vncserver -help | |
run: | | |
# -help flag is not available for TurboVNC, but it emits the -help | |
# equivalent information anyhow if passed -help, but also errors. Due | |
# to this, we fallback to use the errorcode of vncsrever -list. | |
docker run jupyter-remote-desktop-proxy bash -c "vncserver -help || vncserver -list > /dev/null" | |
- name: Smoke test image | |
run: | | |
container_id=$(docker run -d -p 8888:8888 -e JUPYTER_TOKEN=secret jupyter-remote-desktop-proxy) | |
# wait for jupyter_server startup | |
sleep 10 | |
echo "Testing /desktop/ to return rendered index.html template" | |
curl --silent --fail 'http://localhost:8888/desktop/?token=secret' | grep 'Jupyter Remote Desktop Proxy' | |
echo "Testing /desktop/ to provide pre-built viewer.js" | |
curl --silent --fail 'http://localhost:8888/desktop/static/dist/viewer.js?token=secret' > /dev/null | |
echo "Testing connectivity to /desktop-websockify/" | |
websocat --binary --one-message --exit-on-eof 'ws://127.0.0.1:8888/desktop-websockify/?token=secret' | |
# TODO: Check VNC desktop works, e.g. by comparing Playwright screenshots | |
# https://playwright.dev/docs/test-snapshots |