Skip to content

Commit

Permalink
Fix not fully functional basic tests
Browse files Browse the repository at this point in the history
  • Loading branch information
consideRatio committed Mar 10, 2024
1 parent 3df5407 commit a011cd1
Showing 1 changed file with 27 additions and 8 deletions.
35 changes: 27 additions & 8 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,42 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Install test requirements (websocat)
run: |
wget -q https:/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)
# -help flag is only available for TigerVNC, where TurboVNC can't
# print info without returning an error code.
docker exec $container_id vncserver -help || true
docker exec $container_id vncserver -list
# wait for jupyter_server startup
sleep 10
curl 'http://localhost:8888/desktop/?token=secret' | grep 'Jupyter Remote Desktop Proxy'
# Test if the built JS file is present in the image
curl 'http://localhost:8888/desktop/dist/viewer.js?token=secret' > /dev/null
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 /desktop-websockify/ to return vncserver response"
websocat --binary --one-message --exit-on-eof 'ws://127.0.0.1:8888/desktop-websockify/?token=secret' | grep RFB
# TODO: Check VNC desktop works, e.g. by comparing Playwright screenshots
# https://playwright.dev/docs/test-snapshots

0 comments on commit a011cd1

Please sign in to comment.