-
Notifications
You must be signed in to change notification settings - Fork 0
feat(testing): implement playwright parallelization improvements #82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
0c8b789
3d42ecd
79e71f9
6274976
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -37,6 +37,11 @@ on: | |||||||||||||||||||||||||||||||||||||||||||||||
| required: false | ||||||||||||||||||||||||||||||||||||||||||||||||
| default: false | ||||||||||||||||||||||||||||||||||||||||||||||||
| type: boolean | ||||||||||||||||||||||||||||||||||||||||||||||||
| shard-count: | ||||||||||||||||||||||||||||||||||||||||||||||||
| description: 'Number of shards for parallel execution (2-8)' | ||||||||||||||||||||||||||||||||||||||||||||||||
| required: false | ||||||||||||||||||||||||||||||||||||||||||||||||
| default: 4 | ||||||||||||||||||||||||||||||||||||||||||||||||
| type: number | ||||||||||||||||||||||||||||||||||||||||||||||||
| secrets: | ||||||||||||||||||||||||||||||||||||||||||||||||
| TEST_USERNAME: | ||||||||||||||||||||||||||||||||||||||||||||||||
| description: 'Username for test authentication' | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -56,12 +61,13 @@ on: | |||||||||||||||||||||||||||||||||||||||||||||||
| value: ${{ jobs.e2e-tests.outputs.test-results }} | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||||||||||||||||||||||||||
| e2e-tests: | ||||||||||||||||||||||||||||||||||||||||||||||||
| name: Playwright E2E Tests | ||||||||||||||||||||||||||||||||||||||||||||||||
| # Setup job - runs once to prepare shared artifacts | ||||||||||||||||||||||||||||||||||||||||||||||||
| setup: | ||||||||||||||||||||||||||||||||||||||||||||||||
| name: Setup Dependencies and Build | ||||||||||||||||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||||||||||||||||||||
| timeout-minutes: 30 | ||||||||||||||||||||||||||||||||||||||||||||||||
| timeout-minutes: 15 | ||||||||||||||||||||||||||||||||||||||||||||||||
| outputs: | ||||||||||||||||||||||||||||||||||||||||||||||||
| test-results: ${{ steps.test-results.outputs.results }} | ||||||||||||||||||||||||||||||||||||||||||||||||
| can-run-tests: ${{ steps.validate-secrets.outputs.can_run_tests }} | ||||||||||||||||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Checkout code | ||||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -154,8 +160,73 @@ jobs: | |||||||||||||||||||||||||||||||||||||||||||||||
| echo "can_run_tests=true" >> $GITHUB_OUTPUT | ||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Set up non-sensitive environment variables | ||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Build the application | ||||||||||||||||||||||||||||||||||||||||||||||||
| if: steps.validate-secrets.outputs.can_run_tests == 'true' && !inputs.skip-build | ||||||||||||||||||||||||||||||||||||||||||||||||
| run: yarn build | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
asithade marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Upload build artifacts | ||||||||||||||||||||||||||||||||||||||||||||||||
| if: steps.validate-secrets.outputs.can_run_tests == 'true' | ||||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/upload-artifact@v4 | ||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||
| name: build-artifacts | ||||||||||||||||||||||||||||||||||||||||||||||||
| path: | | ||||||||||||||||||||||||||||||||||||||||||||||||
| packages/shared/dist/ | ||||||||||||||||||||||||||||||||||||||||||||||||
| apps/lfx-pcc/dist/ | ||||||||||||||||||||||||||||||||||||||||||||||||
| node_modules/.cache/ | ||||||||||||||||||||||||||||||||||||||||||||||||
| .turbo/ | ||||||||||||||||||||||||||||||||||||||||||||||||
| retention-days: 1 | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+167
to
+178
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. π οΈ Refactor suggestion Guard artifact upload when skipping build (or ignore if empty). If skip-build is true, this step may warn/fail due to missing paths. Guard with the same condition or set if-no-files-found: ignore. - - name: Upload build artifacts
- if: steps.validate-secrets.outputs.can_run_tests == 'true'
+ - name: Upload build artifacts
+ if: steps.validate-secrets.outputs.can_run_tests == 'true' && !inputs['skip-build']
uses: actions/upload-artifact@v4
with:
name: build-artifacts
path: |
packages/shared/dist/
apps/lfx-pcc/dist/
node_modules/.cache/
.turbo/
retention-days: 1
+ if-no-files-found: ignoreπ Committable suggestion
Suggested change
π€ Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||
| # E2E tests - runs in parallel shards after setup | ||||||||||||||||||||||||||||||||||||||||||||||||
| e2e-tests: | ||||||||||||||||||||||||||||||||||||||||||||||||
| name: Playwright E2E Tests (Shard ${{ matrix.shard }}/${{ inputs.shard-count }}) | ||||||||||||||||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||||||||||||||||||||
| timeout-minutes: 15 | ||||||||||||||||||||||||||||||||||||||||||||||||
| needs: [setup] | ||||||||||||||||||||||||||||||||||||||||||||||||
| if: ${{ needs.setup.outputs.can-run-tests == 'true' }} | ||||||||||||||||||||||||||||||||||||||||||||||||
| strategy: | ||||||||||||||||||||||||||||||||||||||||||||||||
| fail-fast: false | ||||||||||||||||||||||||||||||||||||||||||||||||
| matrix: | ||||||||||||||||||||||||||||||||||||||||||||||||
| shard: [1, 2, 3, 4] | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+179
to
+189
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. π‘ Verification agent π§© Analysis chainBug: matrix hardcodes 4 shards, ignores shard-count, and canβt be disabled. This will under/over-run tests vs the provided denominator and forces sharding even when not desired. Generate the shard array from shard-count and gate it behind enable-sharding. - e2e-tests:
- name: Playwright E2E Tests (Shard ${{ matrix.shard }}/${{ inputs.shard-count }})
+ e2e-tests:
+ name: Playwright E2E Tests (Shard ${{ matrix.shard }}/${{ inputs['enable-sharding'] && inputs['shard-count'] || 1 }})
runs-on: ubuntu-latest
timeout-minutes: 15
needs: [setup]
if: ${{ needs.setup.outputs.can-run-tests == 'true' }}
strategy:
fail-fast: false
matrix:
- shard: [1, 2, 3, 4]
+ shard: ${{ inputs['enable-sharding'] && fromJSON(format('[{0}]', join(', ', range(1, inputs['shard-count'] + 1)))) || fromJSON('[1]') }}To confirm the exact semantics of GitHubβs range() (end-exclusive vs inclusive), please verify: π Web query: π‘ Result: Short answer: range(start, end) is end-exclusive (it does NOT include end). Official docs: Evaluate expressions in workflows and actions (GitHub Docs). [1] Minimal example (builds [1..N]; here N=4 so use range(1, 5)): name: range-matrix References Citations: Bug: don't hardcode 4 shards β generate shard list from inputs.shard-count and gate with enable-sharding Confirmed: GitHub expressions' range(start, end) is endβexclusive β build [1..N] with range(1, N+1). Example: matrix: i: ${{ range(1, 5) }} produces [1,2,3,4]. (docs.github.com) Action (file + lines): .github/workflows/e2e-tests.yml (lines 179β189) β replace the hardcoded π€ Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||
| outputs: | ||||||||||||||||||||||||||||||||||||||||||||||||
| test-results: ${{ steps.test-results.outputs.results }} | ||||||||||||||||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Checkout code | ||||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||
| fetch-depth: 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Download build artifacts | ||||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/download-artifact@v4 | ||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||
| name: build-artifacts | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+198
to
+202
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. π οΈ Refactor suggestion Also guard artifact download when skipping build. Without an uploaded artifact this step will fail. Mirror the condition. - - name: Download build artifacts
- uses: actions/download-artifact@v4
+ - name: Download build artifacts
+ if: ${{ !inputs['skip-build'] }}
+ uses: actions/download-artifact@v4
with:
name: build-artifactsπ Committable suggestion
Suggested change
π€ Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Setup Node.js | ||||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/setup-node@v4 | ||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||
| node-version: ${{ inputs.node-version }} | ||||||||||||||||||||||||||||||||||||||||||||||||
| cache: 'yarn' | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Install dependencies | ||||||||||||||||||||||||||||||||||||||||||||||||
| run: yarn install --immutable | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| - name: OIDC Auth | ||||||||||||||||||||||||||||||||||||||||||||||||
| uses: aws-actions/configure-aws-credentials@v4 | ||||||||||||||||||||||||||||||||||||||||||||||||
| id: oidc-auth | ||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||
| audience: sts.amazonaws.com | ||||||||||||||||||||||||||||||||||||||||||||||||
| role-to-assume: arn:aws:iam::788942260905:role/github-actions-deploy | ||||||||||||||||||||||||||||||||||||||||||||||||
| aws-region: us-west-2 | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Read secrets from AWS Secrets Manager into environment variables | ||||||||||||||||||||||||||||||||||||||||||||||||
| id: get_secrets | ||||||||||||||||||||||||||||||||||||||||||||||||
| uses: aws-actions/aws-secretsmanager-get-secrets@v2 | ||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||
| secret-ids: | | ||||||||||||||||||||||||||||||||||||||||||||||||
| SUPABASE, /cloudops/managed-secrets/cloud/supabase/api_key | ||||||||||||||||||||||||||||||||||||||||||||||||
| AUTH0, /cloudops/managed-secrets/auth0/LFX_V2_PCC | ||||||||||||||||||||||||||||||||||||||||||||||||
| AUTH, /cloudops/managed-secrets/auth0/LFX_V2_Meeting_Join_M2M | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Set up environment variables | ||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo "ENV=development" >> $GITHUB_ENV | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo "PCC_BASE_URL=http://localhost:4200" >> $GITHUB_ENV | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -166,142 +237,83 @@ jobs: | |||||||||||||||||||||||||||||||||||||||||||||||
| echo "M2M_AUTH_ISSUER_BASE_URL=https://linuxfoundation-dev.auth0.com/" >> $GITHUB_ENV | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo "M2M_AUTH_AUDIENCE=https://api-gw.dev.platform.linuxfoundation.org/" >> $GITHUB_ENV | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo "CI=true" >> $GITHUB_ENV | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Set up sensitive environment variables | ||||||||||||||||||||||||||||||||||||||||||||||||
| if: steps.validate-secrets.outputs.can_run_tests == 'true' | ||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||
| # Parse and set AUTH0 secrets with explicit masking | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| # Parse and set AUTH0 secrets | ||||||||||||||||||||||||||||||||||||||||||||||||
| if [ -n "$AUTH0" ]; then | ||||||||||||||||||||||||||||||||||||||||||||||||
| AUTH0_CLIENT_ID=$(echo "$AUTH0" | jq -r '.client_id // empty') | ||||||||||||||||||||||||||||||||||||||||||||||||
| AUTH0_CLIENT_SECRET=$(echo "$AUTH0" | jq -r '.client_secret // empty') | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| # Explicitly mask the values | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo "::add-mask::$AUTH0_CLIENT_ID" | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo "::add-mask::$AUTH0_CLIENT_SECRET" | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| # Set as environment variables | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo "PCC_AUTH0_CLIENT_ID=$AUTH0_CLIENT_ID" >> $GITHUB_ENV | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo "PCC_AUTH0_CLIENT_SECRET=$AUTH0_CLIENT_SECRET" >> $GITHUB_ENV | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo "β AUTH0 secrets set as masked environment variables" | ||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| # Parse and set M2M AUTH secrets | ||||||||||||||||||||||||||||||||||||||||||||||||
| if [ -n "$AUTH" ]; then | ||||||||||||||||||||||||||||||||||||||||||||||||
| M2M_AUTH_CLIENT_ID=$(echo "$AUTH" | jq -r '.m2m_client_id // empty') | ||||||||||||||||||||||||||||||||||||||||||||||||
| M2M_AUTH_CLIENT_SECRET=$(echo "$AUTH" | jq -r '.m2m_client_secret // empty') | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| # Explicitly mask the values | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo "::add-mask::$M2M_AUTH_CLIENT_ID" | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo "::add-mask::$M2M_AUTH_CLIENT_SECRET" | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| # Set as environment variables | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo "M2M_AUTH_CLIENT_ID=$M2M_AUTH_CLIENT_ID" >> $GITHUB_ENV | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo "M2M_AUTH_CLIENT_SECRET=$M2M_AUTH_CLIENT_SECRET" >> $GITHUB_ENV | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo "β M2M_AUTH secrets set as masked environment variables" | ||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| # Parse and set SUPABASE secrets | ||||||||||||||||||||||||||||||||||||||||||||||||
| if [ -n "$SUPABASE" ]; then | ||||||||||||||||||||||||||||||||||||||||||||||||
| SUPABASE_URL=$(echo "$SUPABASE" | jq -r '.url // empty') | ||||||||||||||||||||||||||||||||||||||||||||||||
| SUPABASE_API_KEY=$(echo "$SUPABASE" | jq -r '.api_key // empty') | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| # Explicitly mask the values | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo "::add-mask::$SUPABASE_URL" | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo "::add-mask::$SUPABASE_API_KEY" | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| # Set as environment variables | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo "SUPABASE_URL=$SUPABASE_URL" >> $GITHUB_ENV | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo "POSTGRES_API_KEY=$SUPABASE_API_KEY" >> $GITHUB_ENV | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo "β SUPABASE secrets set as masked environment variables" | ||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| # Set AI secrets | ||||||||||||||||||||||||||||||||||||||||||||||||
| # Set GitHub secrets | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo "::add-mask::${{ secrets.AI_API_KEY }}" | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo "::add-mask::${{ secrets.AI_PROXY_URL }}" | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo "AI_API_KEY=${{ secrets.AI_API_KEY }}" >> $GITHUB_ENV | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo "AI_PROXY_URL=${{ secrets.AI_PROXY_URL }}" >> $GITHUB_ENV | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo "β AI secrets set as masked environment variables" | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| # Set test credentials | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo "::add-mask::${{ secrets.TEST_USERNAME }}" | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo "::add-mask::${{ secrets.TEST_PASSWORD }}" | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo "AI_API_KEY=${{ secrets.AI_API_KEY }}" >> $GITHUB_ENV | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo "AI_PROXY_URL=${{ secrets.AI_PROXY_URL }}" >> $GITHUB_ENV | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo "TEST_USERNAME=${{ secrets.TEST_USERNAME }}" >> $GITHUB_ENV | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo "TEST_PASSWORD=${{ secrets.TEST_PASSWORD }}" >> $GITHUB_ENV | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo "β TEST_USERNAME and TEST_PASSWORD secrets set as masked environment variables" | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Setup Playwright with caching | ||||||||||||||||||||||||||||||||||||||||||||||||
| if: steps.validate-secrets.outputs.can_run_tests == 'true' | ||||||||||||||||||||||||||||||||||||||||||||||||
| uses: ./.github/actions/setup-playwright | ||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||
| browser: ${{ inputs.browser }} | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Create Playwright auth directory | ||||||||||||||||||||||||||||||||||||||||||||||||
| if: steps.validate-secrets.outputs.can_run_tests == 'true' | ||||||||||||||||||||||||||||||||||||||||||||||||
| working-directory: apps/lfx-pcc | ||||||||||||||||||||||||||||||||||||||||||||||||
| run: mkdir -p playwright/.auth | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Build the application | ||||||||||||||||||||||||||||||||||||||||||||||||
| if: steps.validate-secrets.outputs.can_run_tests == 'true' | ||||||||||||||||||||||||||||||||||||||||||||||||
| run: yarn build | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Run E2E tests (All browsers) | ||||||||||||||||||||||||||||||||||||||||||||||||
| id: run-tests-all | ||||||||||||||||||||||||||||||||||||||||||||||||
| if: ${{ inputs.browser == 'all' && steps.validate-secrets.outputs.can_run_tests == 'true' }} | ||||||||||||||||||||||||||||||||||||||||||||||||
| if: ${{ inputs.browser == 'all' }} | ||||||||||||||||||||||||||||||||||||||||||||||||
| working-directory: apps/lfx-pcc | ||||||||||||||||||||||||||||||||||||||||||||||||
| continue-on-error: true | ||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||
| if [ -n "$TEST_USERNAME" ] && [ -n "$TEST_PASSWORD" ]; then | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo "π Running authenticated E2E tests on all browsers" | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo "π Playwright will automatically start the dev server on localhost:4200" | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo "π Using secrets from AWS Secrets Manager" | ||||||||||||||||||||||||||||||||||||||||||||||||
| yarn ${{ inputs.test-command }} --reporter=list | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo "test_exit_code=$?" >> $GITHUB_OUTPUT | ||||||||||||||||||||||||||||||||||||||||||||||||
| else | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo "β οΈ No test credentials provided. Skipping E2E tests." | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Set TEST_USERNAME and TEST_PASSWORD secrets to enable E2E tests." | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo "test_exit_code=0" >> $GITHUB_OUTPUT | ||||||||||||||||||||||||||||||||||||||||||||||||
| exit 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo "π Running authenticated E2E tests on all browsers" | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo "π Running with sharding: ${{ matrix.shard }}/${{ inputs.shard-count }}" | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo "π Playwright will automatically start the dev server on localhost:4200" | ||||||||||||||||||||||||||||||||||||||||||||||||
| yarn ${{ inputs.test-command }} --reporter=list --shard=${{ matrix.shard }}/${{ inputs.shard-count }} | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo "test_exit_code=$?" >> $GITHUB_OUTPUT | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+296
to
301
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix hyphenated input references and make shard denominator dynamic (or 1 when disabled). The current commands use dot-notation for test-command and always divide by inputs.shard-count. Align with enable-sharding and bracket notation to avoid invalid expressions and incorrect partitioning. - echo "π Running with sharding: ${{ matrix.shard }}/${{ inputs.shard-count }}"
- echo "π Playwright will automatically start the dev server on localhost:4200"
- yarn ${{ inputs.test-command }} --reporter=list --shard=${{ matrix.shard }}/${{ inputs.shard-count }}
+ echo "π Running with sharding: ${{ matrix.shard }}/${{ inputs['enable-sharding'] && inputs['shard-count'] || 1 }}"
+ echo "π Playwright will automatically start the dev server on ${{ inputs['base-url'] }}"
+ yarn ${{ inputs['test-command'] }} --reporter=list --shard=${{ matrix.shard }}/${{ inputs['enable-sharding'] && inputs['shard-count'] || 1 }}- echo "π Running authenticated E2E tests on ${{ inputs.browser }}"
- echo "π Running with sharding: ${{ matrix.shard }}/${{ inputs.shard-count }}"
- echo "π Playwright will automatically start the dev server on localhost:4200"
- yarn ${{ inputs.test-command }} --project=${{ inputs.browser }} --reporter=list --shard=${{ matrix.shard }}/${{ inputs.shard-count }}
+ echo "π Running authenticated E2E tests on ${{ inputs.browser }}"
+ echo "π Running with sharding: ${{ matrix.shard }}/${{ inputs['enable-sharding'] && inputs['shard-count'] || 1 }}"
+ echo "π Playwright will automatically start the dev server on ${{ inputs['base-url'] }}"
+ yarn ${{ inputs['test-command'] }} --project=${{ inputs.browser }} --reporter=list --shard=${{ matrix.shard }}/${{ inputs['enable-sharding'] && inputs['shard-count'] || 1 }}Also applies to: 306-310 π€ Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Run E2E tests (Specific browser) | ||||||||||||||||||||||||||||||||||||||||||||||||
| if: ${{ inputs.browser != 'all' && steps.validate-secrets.outputs.can_run_tests == 'true' }} | ||||||||||||||||||||||||||||||||||||||||||||||||
| if: ${{ inputs.browser != 'all' }} | ||||||||||||||||||||||||||||||||||||||||||||||||
| working-directory: apps/lfx-pcc | ||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||
| if [ -n "$TEST_USERNAME" ] && [ -n "$TEST_PASSWORD" ]; then | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo "π Running authenticated E2E tests on ${{ inputs.browser }}" | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo "π Playwright will automatically start the dev server on localhost:4200" | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo "π Using secrets from AWS Secrets Manager" | ||||||||||||||||||||||||||||||||||||||||||||||||
| yarn ${{ inputs.test-command }} --project=${{ inputs.browser }} --reporter=list | ||||||||||||||||||||||||||||||||||||||||||||||||
| else | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo "β οΈ No test credentials provided. Skipping E2E tests." | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Set TEST_USERNAME and TEST_PASSWORD secrets to enable E2E tests." | ||||||||||||||||||||||||||||||||||||||||||||||||
| exit 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| - name: E2E tests skipped | ||||||||||||||||||||||||||||||||||||||||||||||||
| if: ${{ steps.validate-secrets.outputs.can_run_tests == 'false' }} | ||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo "βοΈ E2E tests skipped due to missing required secrets" | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Configure the following secrets to enable E2E testing:" | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo "" | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo "AWS Secrets Manager (required):" | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo " - /cloudops/managed-secrets/auth0/LFX_V2_PCC (AUTH0 configuration)" | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo " - /cloudops/managed-secrets/cloud/supabase/api_key (SUPABASE configuration)" | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo " - /cloudops/managed-secrets/ai/ai_config (AI configuration)" | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo "" | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo "GitHub Secrets (required for authenticated tests):" | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo " - TEST_USERNAME" | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo " - TEST_PASSWORD" | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo "π Running authenticated E2E tests on ${{ inputs.browser }}" | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo "π Running with sharding: ${{ matrix.shard }}/${{ inputs.shard-count }}" | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo "π Playwright will automatically start the dev server on localhost:4200" | ||||||||||||||||||||||||||||||||||||||||||||||||
| yarn ${{ inputs.test-command }} --project=${{ inputs.browser }} --reporter=list --shard=${{ matrix.shard }}/${{ inputs.shard-count }} | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Generate test results summary | ||||||||||||||||||||||||||||||||||||||||||||||||
| id: test-results | ||||||||||||||||||||||||||||||||||||||||||||||||
| if: always() | ||||||||||||||||||||||||||||||||||||||||||||||||
| working-directory: apps/lfx-pcc | ||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||
| if [ "${{ steps.validate-secrets.outputs.can_run_tests }}" == "false" ]; then | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo "βοΈ E2E tests skipped (missing required secrets)" | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo "results=skipped" >> $GITHUB_OUTPUT | ||||||||||||||||||||||||||||||||||||||||||||||||
| elif [ -z "$TEST_USERNAME" ] || [ -z "$TEST_PASSWORD" ]; then | ||||||||||||||||||||||||||||||||||||||||||||||||
| if [ -z "$TEST_USERNAME" ] || [ -z "$TEST_PASSWORD" ]; then | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo "βοΈ E2E tests skipped (no test credentials)" | ||||||||||||||||||||||||||||||||||||||||||||||||
| echo "results=skipped" >> $GITHUB_OUTPUT | ||||||||||||||||||||||||||||||||||||||||||||||||
| elif [ -f "test-results/.last-run.json" ]; then | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -313,7 +325,7 @@ jobs: | |||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Comment test results on PR | ||||||||||||||||||||||||||||||||||||||||||||||||
| if: github.event_name == 'pull_request' && always() | ||||||||||||||||||||||||||||||||||||||||||||||||
| if: github.event_name == 'pull_request' && matrix.shard == 1 && always() | ||||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/github-script@v7 | ||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||
| script: | | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -326,7 +338,7 @@ jobs: | |||||||||||||||||||||||||||||||||||||||||||||||
| if (results === 'success') { | ||||||||||||||||||||||||||||||||||||||||||||||||
| emoji = 'β '; | ||||||||||||||||||||||||||||||||||||||||||||||||
| status = 'passed'; | ||||||||||||||||||||||||||||||||||||||||||||||||
| details = 'All E2E tests passed successfully.'; | ||||||||||||||||||||||||||||||||||||||||||||||||
| details = 'All E2E tests passed successfully across 4 parallel shards.'; | ||||||||||||||||||||||||||||||||||||||||||||||||
| } else if (results === 'failure') { | ||||||||||||||||||||||||||||||||||||||||||||||||
| emoji = 'β'; | ||||||||||||||||||||||||||||||||||||||||||||||||
| status = 'failed'; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -340,6 +352,7 @@ jobs: | |||||||||||||||||||||||||||||||||||||||||||||||
| const comment = `## ${emoji} E2E Tests ${status.charAt(0).toUpperCase() + status.slice(1)} | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| **Browser:** ${browser} | ||||||||||||||||||||||||||||||||||||||||||||||||
| **Shards:** 4 parallel executions | ||||||||||||||||||||||||||||||||||||||||||||||||
| **Status:** ${status} | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| ${details} | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -351,6 +364,7 @@ jobs: | |||||||||||||||||||||||||||||||||||||||||||||||
| - **Command:** \`${{ inputs.test-command }}\` | ||||||||||||||||||||||||||||||||||||||||||||||||
| - **Browser:** ${browser} | ||||||||||||||||||||||||||||||||||||||||||||||||
| - **Base URL:** ${{ inputs.base-url }} | ||||||||||||||||||||||||||||||||||||||||||||||||
| - **Shards:** ${{ inputs.shard-count }} | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| </details>`; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.