Skip to content

Commit 6856ed5

Browse files
committed
Update cypress config and e2e.yaml workflow to only record with DEBUG flags set to true and always upload those artifacts regardless of pass/fail states when DEBUG flags are true.
1 parent 95e8852 commit 6856ed5

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

.github/workflows/e2e.yaml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ jobs:
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
@@ -68,7 +67,7 @@ jobs:
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,7 @@ 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 }}
167167

168168
- name: Upload Cypress screenshots on failure
169169
uses: actions/upload-artifact@v4
@@ -173,21 +173,21 @@ jobs:
173173
path: test/e2e/cypress/screenshots
174174
if-no-files-found: ignore
175175

176-
- name: Upload Cypress videos on failure
176+
- name: "[DEBUG] Upload Cypress videos"
177177
uses: actions/upload-artifact@v4
178-
if: failure()
178+
if: always() && (env.DEBUG_CYPRESS == 'true' || env.ACTIONS_STEP_DEBUG)
179179
with:
180180
name: cypress-videos
181181
path: test/e2e/cypress/videos
182182
if-no-files-found: ignore
183183

184184
- name: "[DEBUG] List installed VS Code extensions"
185-
if: always() && (env.DEBUG_CYPRESS == 'true' || env.ACTIONS_STEP_DEBUG == 'true')
185+
if: always() && (env.DEBUG_CYPRESS == 'true' || env.ACTIONS_STEP_DEBUG)
186186
working-directory: test/e2e
187187
run: docker compose exec code-server code-server --list-extensions --show-versions || true
188188

189189
- name: "[DEBUG] Display test/e2e directory tree"
190-
if: always() && (env.DEBUG_CYPRESS == 'true' || env.ACTIONS_STEP_DEBUG == 'true')
190+
if: always() && (env.DEBUG_CYPRESS == 'true' || env.ACTIONS_STEP_DEBUG)
191191
run: |
192192
echo "Directory tree for test/e2e:"
193193
if command -v tree > /dev/null; then
@@ -197,7 +197,7 @@ jobs:
197197
fi
198198
199199
- name: "[DEBUG] Print code-server logs"
200-
if: always() && (env.DEBUG_CYPRESS == 'true' || env.ACTIONS_STEP_DEBUG == 'true')
200+
if: always() && (env.DEBUG_CYPRESS == 'true' || env.ACTIONS_STEP_DEBUG)
201201
run: |
202202
echo "=== Code Server Log Files ==="
203203
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 +207,20 @@ jobs:
207207
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"'
208208
209209
- name: "[DEBUG] Print Publisher extension logs"
210-
if: always() && (env.DEBUG_CYPRESS == 'true' || env.ACTIONS_STEP_DEBUG == 'true')
210+
if: always() && (env.DEBUG_CYPRESS == 'true' || env.ACTIONS_STEP_DEBUG)
211211
run: |
212212
echo "=== Finding Publisher logs ==="
213213
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"'
214214
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"'
215215
echo "======================================="
216216
217217
- name: "[DEBUG] Print code-server container logs"
218-
if: always() && (env.DEBUG_CYPRESS == 'true' || env.ACTIONS_STEP_DEBUG == 'true')
218+
if: always() && (env.DEBUG_CYPRESS == 'true' || env.ACTIONS_STEP_DEBUG)
219219
working-directory: test/e2e
220220
run: docker compose logs code-server || true
221221

222222
- name: "[DEBUG] List /home/coder directory contents"
223-
if: always() && (env.DEBUG_CYPRESS == 'true' || env.ACTIONS_STEP_DEBUG == 'true')
223+
if: always() && (env.DEBUG_CYPRESS == 'true' || env.ACTIONS_STEP_DEBUG)
224224
run: docker exec publisher-e2e.code-server ls -lR /home/coder || true
225225

226226
- name: Stop containers

0 commit comments

Comments
 (0)