Skip to content

Commit 5aabc74

Browse files
authored
feat: Add Windows Playwright tests to nightly builds (#12264)
* feat: Add Windows Playwright tests to nightly builds - Add windows-latest to typescript_test.yml runner options - Add shell: bash to all script steps for cross-platform compatibility - Split Playwright installation into OS-aware steps (Linux uses --with-deps, Windows/macOS/self-hosted don't) - Fix artifact naming with OS prefix to prevent conflicts: blob-report-${{ runner.os }}-${{ matrix.shardIndex }} - Split frontend-tests into separate Linux and Windows jobs in nightly_build.yml - Add ref parameter to all test jobs to checkout code from release branch - Add resolve-release-branch to needs dependencies - Update Slack notifications to handle both Linux and Windows test results - Windows tests are non-blocking (not checked in release-nightly-build condition) - Update .secrets.baseline with new line number (263 -> 347) for LANGFLOW_ENG_SLACK_WEBHOOK_URL Fixes LE-566 * fix: Use contains() for self-hosted runner detection - Replace exact string equality (==, !=) with contains() for substring matching - Fixes issue when inputs.runs-on is array format: '["self-hosted", "linux", "ARM64", ...]' - Ensures self-hosted Linux runners correctly skip --with-deps flag Addresses CodeRabbit feedback on PR #12264
1 parent cacb54d commit 5aabc74

3 files changed

Lines changed: 63 additions & 18 deletions

File tree

.github/workflows/nightly_build.yml

Lines changed: 49 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -205,15 +205,35 @@ jobs:
205205
exit 1
206206
fi
207207
208-
frontend-tests:
208+
frontend-tests-linux:
209209
if: github.repository == 'langflow-ai/langflow' && !inputs.skip_frontend_tests
210-
name: Run Frontend Tests
211-
needs: create-nightly-tag
210+
name: Run Frontend Tests - Linux
211+
needs: [resolve-release-branch, create-nightly-tag]
212212
uses: ./.github/workflows/typescript_test.yml
213213
with:
214214
tests_folder: "tests"
215215
release: true
216-
runs-on: ${{ inputs['runs_on'] || github.event.inputs['runs_on'] || 'ubuntu-latest' }}
216+
runs-on: ubuntu-latest
217+
ref: ${{ needs.resolve-release-branch.outputs.branch }}
218+
secrets:
219+
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
220+
STORE_API_KEY: ${{ secrets.STORE_API_KEY }}
221+
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
222+
TAVILY_API_KEY: ${{ secrets.TAVILY_API_KEY }}
223+
224+
frontend-tests-windows:
225+
if: github.repository == 'langflow-ai/langflow' && !inputs.skip_frontend_tests
226+
name: Run Frontend Tests - Windows
227+
needs: [resolve-release-branch, create-nightly-tag]
228+
# Windows tests are non-blocking - the release-nightly-build job only checks
229+
# frontend-tests-linux.result, allowing Windows tests to fail without blocking the build.
230+
# This gives us visibility into Windows-specific issues while we stabilize the tests.
231+
uses: ./.github/workflows/typescript_test.yml
232+
with:
233+
tests_folder: "tests"
234+
release: true
235+
runs-on: windows-latest
236+
ref: ${{ needs.resolve-release-branch.outputs.branch }}
217237
secrets:
218238
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
219239
STORE_API_KEY: ${{ secrets.STORE_API_KEY }}
@@ -223,11 +243,12 @@ jobs:
223243
backend-unit-tests:
224244
if: github.repository == 'langflow-ai/langflow' && !inputs.skip_backend_tests
225245
name: Run Backend Unit Tests
226-
needs: create-nightly-tag
246+
needs: [resolve-release-branch, create-nightly-tag]
227247
uses: ./.github/workflows/python_test.yml
228248
with:
229249
python-versions: '["3.10", "3.11", "3.12", "3.13"]'
230250
runs-on: ${{ inputs['runs_on'] || github.event.inputs['runs_on'] || 'ubuntu-latest' }}
251+
ref: ${{ needs.resolve-release-branch.outputs.branch }}
231252
secrets:
232253
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
233254
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
@@ -244,10 +265,10 @@ jobs:
244265
# ref: ${{ needs.create-nightly-tag.outputs.tag }}
245266

246267
release-nightly-build:
247-
if: github.repository == 'langflow-ai/langflow' && always() && needs.frontend-tests.result != 'failure' && needs.backend-unit-tests.result != 'failure'
268+
if: github.repository == 'langflow-ai/langflow' && always() && needs.frontend-tests-linux.result != 'failure' && needs.backend-unit-tests.result != 'failure'
248269
name: Run Nightly Langflow Build
249270
needs:
250-
[validate-inputs, create-nightly-tag, frontend-tests, backend-unit-tests]
271+
[validate-inputs, create-nightly-tag, frontend-tests-linux, frontend-tests-windows, backend-unit-tests]
251272
uses: ./.github/workflows/release_nightly.yml
252273
with:
253274
build_docker_base: true
@@ -264,19 +285,21 @@ jobs:
264285

265286
slack-notification:
266287
name: Send Slack Notification
267-
needs: [frontend-tests, backend-unit-tests, release-nightly-build]
268-
if: ${{ github.repository == 'langflow-ai/langflow' && !inputs.skip_slack && always() && (needs.release-nightly-build.result == 'failure' || needs.frontend-tests.result == 'failure' || needs.backend-unit-tests.result == 'failure' || needs.release-nightly-build.result == 'success') }}
288+
needs: [frontend-tests-linux, frontend-tests-windows, backend-unit-tests, release-nightly-build]
289+
if: ${{ github.repository == 'langflow-ai/langflow' && !inputs.skip_slack && always() && (needs.release-nightly-build.result == 'failure' || needs.frontend-tests-linux.result == 'failure' || needs.frontend-tests-windows.result == 'failure' || needs.backend-unit-tests.result == 'failure' || needs.release-nightly-build.result == 'success') }}
269290
runs-on: ubuntu-latest
270291
steps:
271292
- name: Send failure notification to Slack
272-
if: ${{ needs.release-nightly-build.result == 'failure' || needs.frontend-tests.result == 'failure' || needs.backend-unit-tests.result == 'failure' }}
293+
if: ${{ needs.release-nightly-build.result == 'failure' || needs.frontend-tests-linux.result == 'failure' || needs.frontend-tests-windows.result == 'failure' || needs.backend-unit-tests.result == 'failure' }}
273294
run: |
274295
# Determine which job failed
275296
FAILED_JOB="unknown"
276297
if [ "${{ needs.release-nightly-build.result }}" == "failure" ]; then
277298
FAILED_JOB="release-nightly-build"
278-
elif [ "${{ needs.frontend-tests.result }}" == "failure" ]; then
279-
FAILED_JOB="frontend-tests"
299+
elif [ "${{ needs.frontend-tests-linux.result }}" == "failure" ]; then
300+
FAILED_JOB="frontend-tests-linux"
301+
elif [ "${{ needs.frontend-tests-windows.result }}" == "failure" ]; then
302+
FAILED_JOB="frontend-tests-windows (non-blocking)"
280303
elif [ "${{ needs.backend-unit-tests.result }}" == "failure" ]; then
281304
FAILED_JOB="backend-unit-tests"
282305
fi
@@ -304,6 +327,13 @@ jobs:
304327
}
305328
]
306329
},
330+
{
331+
\"type\": \"section\",
332+
\"text\": {
333+
\"type\": \"mrkdwn\",
334+
\"text\": \"*Note:* Frontend tests now run on both Linux and Windows\"
335+
}
336+
},
307337
{
308338
\"type\": \"context\",
309339
\"elements\": [
@@ -342,6 +372,13 @@ jobs:
342372
}
343373
]
344374
},
375+
{
376+
"type": "section",
377+
"text": {
378+
"type": "mrkdwn",
379+
"text": "*Platforms:* Linux & Windows Playwright tests passed"
380+
}
381+
},
345382
{
346383
"type": "context",
347384
"elements": [

.github/workflows/typescript_test.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ on:
5959
type: choice
6060
options:
6161
- ubuntu-latest
62+
- windows-latest
6263
- self-hosted
6364
- '["self-hosted", "linux", "ARM64", "langflow-ai-arm64-40gb-ephemeral"]'
6465
default: ubuntu-latest
@@ -93,6 +94,7 @@ jobs:
9394

9495
- name: Determine Test Suites from Changes
9596
id: set-matrix
97+
shell: bash
9698
run: |
9799
# Start with input suites if provided, otherwise empty array
98100
echo "Changes filter output: $(echo '${{ toJSON(steps.filter.outputs) }}')"
@@ -233,6 +235,7 @@ jobs:
233235

234236
- name: Calculate Test Shards Distribution
235237
id: setup-matrix
238+
shell: bash
236239
run: |
237240
cd src/frontend
238241
@@ -310,14 +313,16 @@ jobs:
310313
restore-keys: |
311314
playwright-${{ env.PLAYWRIGHT_VERSION }}-chromium-${{ runner.os }}
312315
313-
- name: Install Playwright Browser Dependencies
314-
if: steps.cache-playwright.outputs.cache-hit != 'true' && inputs.runs-on != 'self-hosted'
316+
- name: Install Playwright Browser Dependencies (Linux)
317+
if: steps.cache-playwright.outputs.cache-hit != 'true' && runner.os == 'Linux' && !contains(inputs.runs-on, 'self-hosted')
318+
shell: bash
315319
run: |
316320
cd ./src/frontend
317321
npx playwright install --with-deps chromium
318322
319-
- name: Install Playwright Browsers (Self-Hosted)
320-
if: steps.cache-playwright.outputs.cache-hit != 'true' && inputs.runs-on == 'self-hosted'
323+
- name: Install Playwright Browsers (Windows/macOS/Self-Hosted)
324+
if: steps.cache-playwright.outputs.cache-hit != 'true' && (runner.os != 'Linux' || contains(inputs.runs-on, 'self-hosted'))
325+
shell: bash
321326
run: |
322327
cd ./src/frontend
323328
npx playwright install chromium
@@ -334,6 +339,7 @@ jobs:
334339
run: uv sync --extra audio
335340

336341
- name: Configure Environment Variables
342+
shell: bash
337343
run: |
338344
touch .env
339345
echo "${{ secrets.ENV_VARS }}" > .env
@@ -356,7 +362,7 @@ jobs:
356362
if: always()
357363
uses: actions/upload-artifact@v6
358364
with:
359-
name: blob-report-${{ matrix.shardIndex }}
365+
name: blob-report-${{ runner.os }}-${{ matrix.shardIndex }}
360366
path: src/frontend/blob-report
361367
retention-days: 1
362368

@@ -376,6 +382,7 @@ jobs:
376382
# If the CI was successful, we don't need to merge the reports
377383
# so we can skip all the steps below
378384
id: should_merge_reports
385+
shell: bash
379386
run: |
380387
if [ "$EXIT_CODE" == "0" ]; then
381388
echo "should_merge_reports=false" >> $GITHUB_OUTPUT
@@ -407,6 +414,7 @@ jobs:
407414
- name: Merge into HTML Report
408415

409416
if: ${{ steps.should_merge_reports.outputs.should_merge_reports == 'true' }}
417+
shell: bash
410418
run: |
411419
npx playwright merge-reports --reporter html ./all-blob-reports
412420

.secrets.baseline

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@
153153
"filename": ".github/workflows/nightly_build.yml",
154154
"hashed_secret": "3e26d6750975d678acb8fa35a0f69237881576b0",
155155
"is_verified": false,
156-
"line_number": 263,
156+
"line_number": 347,
157157
"is_secret": false
158158
}
159159
],

0 commit comments

Comments
 (0)