1010 name : e2e tests (cypress)
1111 runs-on : ubuntu-latest
1212 env :
13- DEBUG_CYPRESS : " false" # Set to true to enable extra logging
14- ACTIONS_STEP_DEBUG : " false" # Set to false to suppress yaml warnings
13+ DEBUG_CYPRESS : " false" # Set to true to enable extra logging and video recording replays
1514 steps :
1615 - name : Checkout code
1716 uses : actions/checkout@v3
6867 CONNECT_LICENSE : ${{ secrets.CONNECT_LICENSE }}
6968
7069 - name : " [DEBUG] Print host user and group info"
71- if : always() && (env.DEBUG_CYPRESS == 'true' || env.ACTIONS_STEP_DEBUG == 'true' )
70+ if : always() && (env.DEBUG_CYPRESS == 'true' || env.ACTIONS_STEP_DEBUG)
7271 run : |
7372 echo "USER: $(whoami)"
7473 echo "UID: $(id -u)"
@@ -147,7 +146,7 @@ jobs:
147146 done
148147
149148 - name : " [DEBUG] Print workspace file ownership before tests"
150- if : always() && (env.DEBUG_CYPRESS == 'true' || env.ACTIONS_STEP_DEBUG == 'true' )
149+ if : always() && (env.DEBUG_CYPRESS == 'true' || env.ACTIONS_STEP_DEBUG)
151150 run : |
152151 docker exec publisher-e2e.code-server ls -lR /home/coder/workspace || true
153152
@@ -164,6 +163,8 @@ jobs:
164163 CONNECT_LICENSE : ${{ secrets.CONNECT_LICENSE }}
165164 CONNECT_CLOUD_ENV : ${{ env.CONNECT_CLOUD_ENV }} # defaults to staging
166165 CI : true
166+ DEBUG_CYPRESS : ${{ env.DEBUG_CYPRESS }}
167+ ACTIONS_STEP_DEBUG : ${{ env.ACTIONS_STEP_DEBUG }}
167168
168169 - name : Upload Cypress screenshots on failure
169170 uses : actions/upload-artifact@v4
@@ -173,21 +174,21 @@ jobs:
173174 path : test/e2e/cypress/screenshots
174175 if-no-files-found : ignore
175176
176- - name : Upload Cypress videos on failure
177+ - name : " [DEBUG] Upload Cypress videos"
177178 uses : actions/upload-artifact@v4
178- if : failure( )
179+ if : always() && (env.DEBUG_CYPRESS == 'true' || env.ACTIONS_STEP_DEBUG )
179180 with :
180181 name : cypress-videos
181182 path : test/e2e/cypress/videos
182183 if-no-files-found : ignore
183184
184185 - name : " [DEBUG] List installed VS Code extensions"
185- if : always() && (env.DEBUG_CYPRESS == 'true' || env.ACTIONS_STEP_DEBUG == 'true' )
186+ if : always() && (env.DEBUG_CYPRESS == 'true' || env.ACTIONS_STEP_DEBUG)
186187 working-directory : test/e2e
187188 run : docker compose exec code-server code-server --list-extensions --show-versions || true
188189
189190 - name : " [DEBUG] Display test/e2e directory tree"
190- if : always() && (env.DEBUG_CYPRESS == 'true' || env.ACTIONS_STEP_DEBUG == 'true' )
191+ if : always() && (env.DEBUG_CYPRESS == 'true' || env.ACTIONS_STEP_DEBUG)
191192 run : |
192193 echo "Directory tree for test/e2e:"
193194 if command -v tree > /dev/null; then
@@ -197,7 +198,7 @@ jobs:
197198 fi
198199
199200 - name : " [DEBUG] Print code-server logs"
200- if : always() && (env.DEBUG_CYPRESS == 'true' || env.ACTIONS_STEP_DEBUG == 'true' )
201+ if : always() && (env.DEBUG_CYPRESS == 'true' || env.ACTIONS_STEP_DEBUG)
201202 run : |
202203 echo "=== Code Server Log Files ==="
203204 docker exec publisher-e2e.code-server bash -c 'find /root/.local -type f -name "*.log" 2>/dev/null | while read -r file; do echo "FILE: $file"; done'
@@ -207,20 +208,20 @@ jobs:
207208 docker exec publisher-e2e.code-server bash -c 'find /root/.local -name "remoteexthost.log" -type f 2>/dev/null | head -n 1 | xargs cat | tail -n 50 || echo "No logs found"'
208209
209210 - name : " [DEBUG] Print Publisher extension logs"
210- if : always() && (env.DEBUG_CYPRESS == 'true' || env.ACTIONS_STEP_DEBUG == 'true' )
211+ if : always() && (env.DEBUG_CYPRESS == 'true' || env.ACTIONS_STEP_DEBUG)
211212 run : |
212213 echo "=== Finding Publisher logs ==="
213214 docker exec publisher-e2e.code-server bash -c 'find /root -type f -name "*.log" 2>/dev/null | grep -i "posit\|publisher" || echo "No publisher logs found"'
214215 docker exec publisher-e2e.code-server bash -c 'find /home -type f -name "*.log" 2>/dev/null | grep -i "posit\|publisher" || echo "No publisher logs found"'
215216 echo "======================================="
216217
217218 - name : " [DEBUG] Print code-server container logs"
218- if : always() && (env.DEBUG_CYPRESS == 'true' || env.ACTIONS_STEP_DEBUG == 'true' )
219+ if : always() && (env.DEBUG_CYPRESS == 'true' || env.ACTIONS_STEP_DEBUG)
219220 working-directory : test/e2e
220221 run : docker compose logs code-server || true
221222
222223 - name : " [DEBUG] List /home/coder directory contents"
223- if : always() && (env.DEBUG_CYPRESS == 'true' || env.ACTIONS_STEP_DEBUG == 'true' )
224+ if : always() && (env.DEBUG_CYPRESS == 'true' || env.ACTIONS_STEP_DEBUG)
224225 run : docker exec publisher-e2e.code-server ls -lR /home/coder || true
225226
226227 - name : Stop containers
0 commit comments