00c270b0d4
The E2E Headlamp instance is deployed without OIDC configuration, so Headlamp redirects / → /token directly instead of / → /login. The authenticateWithToken function was hardcoded to expect /login first, causing a 60s timeout on every run. - e2e.yaml: remove unused Setup Helm step (deploy script uses kubectl) - e2e.yaml: remove AUTHENTIK_USERNAME/PASSWORD (no OIDC in E2E instance) - auth.setup.ts: waitForURL accepts both /login and /token; only clicks "use a token" if landed on /login (OIDC-configured Headlamp) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
81 lines
1.8 KiB
YAML
81 lines
1.8 KiB
YAML
name: E2E Tests
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
env:
|
|
E2E_NAMESPACE: privilegedescalation-dev
|
|
E2E_RELEASE: headlamp-e2e
|
|
|
|
jobs:
|
|
e2e:
|
|
runs-on: runners-privilegedescalation
|
|
timeout-minutes: 15
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '22'
|
|
cache: 'npm'
|
|
|
|
- name: Setup kubectl
|
|
uses: azure/setup-kubectl@v4
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Build plugin
|
|
run: npx @kinvolk/headlamp-plugin build
|
|
|
|
- name: Deploy E2E Headlamp instance
|
|
run: scripts/deploy-e2e-headlamp.sh
|
|
|
|
- name: Load E2E environment
|
|
run: |
|
|
if [ -f .env.e2e ]; then
|
|
cat .env.e2e >> "$GITHUB_ENV"
|
|
else
|
|
echo "::error::deploy-e2e-headlamp.sh did not produce .env.e2e"
|
|
exit 1
|
|
fi
|
|
|
|
- name: Install Playwright browsers
|
|
run: npx playwright install --with-deps chromium
|
|
|
|
- name: Run E2E tests
|
|
run: npm run e2e
|
|
env:
|
|
HEADLAMP_URL: ${{ env.HEADLAMP_URL }}
|
|
HEADLAMP_TOKEN: ${{ env.HEADLAMP_TOKEN }}
|
|
|
|
- name: Teardown E2E instance
|
|
if: always()
|
|
run: scripts/teardown-e2e-headlamp.sh
|
|
|
|
- name: Upload Playwright report
|
|
uses: actions/upload-artifact@v4
|
|
if: failure()
|
|
with:
|
|
name: playwright-report
|
|
path: playwright-report/
|
|
retention-days: 7
|
|
|
|
- name: Upload test results
|
|
uses: actions/upload-artifact@v4
|
|
if: failure()
|
|
with:
|
|
name: test-results
|
|
path: test-results/
|
|
retention-days: 7
|