@@ -40,25 +40,14 @@ jobs:
40
40
run : |
41
41
docker build --progress=plain --build-arg vncserver=${{ matrix.vncserver }} -t test .
42
42
43
- - name : (inside container) websockify --help
44
- run : |
45
- docker run test websockify --help
46
-
47
43
- name : (inside container) vncserver -help
48
44
run : |
49
45
# -help flag is not available for TurboVNC, but it emits the -help
50
46
# equivalent information anyhow if passed -help, but also errors. Due
51
47
# to this, we fallback to use the errorcode of vncsrever -list.
52
48
docker run test bash -c "vncserver -help || vncserver -list > /dev/null"
53
49
54
- - name : Install websocat, a test dependency"
55
- run : |
56
- wget -q https://github.com/vi/websocat/releases/download/v1.12.0/websocat.x86_64-unknown-linux-musl \
57
- -O /usr/local/bin/websocat
58
- chmod +x /usr/local/bin/websocat
59
-
60
50
- name : Test vncserver
61
- if : always()
62
51
run : |
63
52
container_id=$(docker run -d -it -p 5901:5901 test vncserver -xstartup /opt/install/jupyter_remote_desktop_proxy/share/xstartup -verbose -fg -geometry 1680x1050 -SecurityTypes None -rfbport 5901)
64
53
sleep 1
@@ -79,71 +68,24 @@ jobs:
79
68
80
69
docker stop $container_id > /dev/null
81
70
if [ "$TEST_OK" == "false" ]; then
82
- echo "One or more tests failed!"
71
+ echo "Test failed!"
83
72
exit 1
84
73
fi
85
74
86
- - name : Test websockify'ed vncserver
87
- if : always()
75
+ - name : Install playwright
88
76
run : |
89
- container_id=$(docker run -d -it -p 5901:5901 test websockify --verbose --log-file=/tmp/websockify.log --heartbeat=30 5901 -- vncserver -xstartup /opt/ install/jupyter_remote_desktop_proxy/share/xstartup -verbose -fg -geometry 1680x1050 -SecurityTypes None -rfbport 5901)
90
- sleep 1
77
+ python -mpip install -r dev-requirements.txt
78
+ python -mplaywright install --with-deps
91
79
92
- echo "::group::Install websocat, a test dependency"
93
- docker exec --user root $container_id bash -c '
94
- wget -q https://github.com/vi/websocat/releases/download/v1.12.0/websocat.x86_64-unknown-linux-musl \
95
- -O /usr/local/bin/websocat
96
- chmod +x /usr/local/bin/websocat
97
- '
98
- echo "::endgroup::"
99
-
100
- docker exec -it $container_id websocat --binary --one-message --exit-on-eof "ws://localhost:5901/" 2>&1 | tee -a /dev/stderr | \
101
- grep --quiet RFB && echo "Passed test" || { echo "Failed test" && TEST_OK=false; }
102
-
103
- echo "::group::websockify logs"
104
- docker exec $container_id bash -c "cat /tmp/websockify.log"
105
- echo "::endgroup::"
106
-
107
- echo "::group::vncserver logs"
108
- docker exec $container_id bash -c 'cat ~/.vnc/*.log'
109
- echo "::endgroup::"
110
-
111
- docker stop $container_id > /dev/null
112
- if [ "$TEST_OK" == "false" ]; then
113
- echo "One or more tests failed!"
114
- exit 1
115
- fi
116
-
117
- - name : Test project's proxy to websockify'ed vncserver
118
- if : always()
80
+ - name : Playwright browser test
119
81
run : |
120
82
container_id=$(docker run -d -it -p 8888:8888 -e JUPYTER_TOKEN=secret test)
121
83
sleep 3
84
+ export CONTAINER_ID=$container_id
85
+ export JUPYTER_HOST=http://localhost:8888
86
+ export JUPYTER_TOKEN=secret
122
87
123
- curl --silent --fail 'http://localhost:8888/desktop/?token=secret' | grep --quiet 'Jupyter Remote Desktop Proxy' && echo "Passed get index.html test" || { echo "Failed get index.html test" && TEST_OK=false; }
124
- curl --silent --fail 'http://localhost:8888/desktop/static/dist/viewer.js?token=secret' > /dev/null && echo "Passed get viewer.js test" || { echo "Failed get viewer.js test" && TEST_OK=false; }
125
-
126
- # The first attempt often fails, but the second always(?) succeeds.
127
- #
128
- # This could be related to jupyter-server-proxy's issue
129
- # https://github.com/jupyterhub/jupyter-server-proxy/issues/459
130
- # because the client/proxy websocket handshake completes before the
131
- # proxy/server handshake. This issue is tracked for this project by
132
- # https://github.com/jupyterhub/jupyter-remote-desktop-proxy/issues/105.
133
- #
134
- websocat --binary --one-message --exit-on-eof 'ws://localhost:8888/desktop-websockify/?token=secret' 2>&1 \
135
- | tee -a /dev/stderr \
136
- | grep --quiet RFB \
137
- && echo "Passed initial websocket test" \
138
- || { \
139
- echo "Failed initial websocket test" \
140
- && sleep 1 \
141
- && websocat --binary --one-message --exit-on-eof 'ws://localhost:8888/desktop-websockify/?token=secret' 2>&1 \
142
- | tee -a /dev/stderr \
143
- | grep --quiet RFB \
144
- && echo "Passed second websocket test" \
145
- || { echo "Failed second websocket test" && TEST_OK=false; } \
146
- }
88
+ python -mpytest -vs
147
89
148
90
echo "::group::jupyter_server logs"
149
91
docker logs $container_id
@@ -159,6 +101,3 @@ jobs:
159
101
echo "One or more tests failed!"
160
102
exit 1
161
103
fi
162
-
163
- # TODO: Check VNC desktop works, e.g. by comparing Playwright screenshots
164
- # https://playwright.dev/docs/test-snapshots
0 commit comments