fix after_pipeline for E2E reporting#3340
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes scheduled Semaphore Playwright E2E after_pipeline reporting by ensuring the custom Kafka reporter source and its Node dependencies are available when merging blob reports.
Changes:
- Add
checkoutinafter_pipelinesotests/e2e/reporters/kafka-results-reporter.tsexists when referenced. - Restore Semaphore caches and run
npm ciinafter_pipelineso the reporter’s runtime dependencies are installed.
| - npm ci --prefer-offline --include=dev | ||
| # Publish to dedicated Kafka topic for additional test result visualization/analysis | ||
| - export E2E_KAFKA_REPORTER_TOPIC=vscode-test-results | ||
| - if [[ "$SEMAPHORE_WORKFLOW_TRIGGERED_BY_SCHEDULE" == "true" ]]; then |
There was a problem hiding this comment.
kafka-results-reporter.ts reads credentials via vault kv get at module load time, but this after_pipeline job doesn't run the same Vault setup used by the E2E blocks (the conditional . vault-setup/login). Once the reporter file is available, npx playwright merge-reports is likely to fail here due to missing Vault auth/token. Add the same Vault initialization step in this job (ideally only for the scheduled path).
| - if [[ "$SEMAPHORE_WORKFLOW_TRIGGERED_BY_SCHEDULE" == "true" ]]; then | |
| - if [[ "$SEMAPHORE_WORKFLOW_TRIGGERED_BY_SCHEDULE" == "true" ]]; then | |
| . vault-setup; |
| - checkout | ||
| - make ci-bin-sem-cache-restore | ||
| - npm ci --prefer-offline --include=dev | ||
| # Publish to dedicated Kafka topic for additional test result visualization/analysis | ||
| - export E2E_KAFKA_REPORTER_TOPIC=vscode-test-results | ||
| - if [[ "$SEMAPHORE_WORKFLOW_TRIGGERED_BY_SCHEDULE" == "true" ]]; then |
There was a problem hiding this comment.
checkout, cache restore, and npm ci now run unconditionally in after_pipeline, but the blob report merge (and Kafka publishing via the custom reporter) only runs for scheduled workflows. Consider moving these expensive steps inside the SEMAPHORE_WORKFLOW_TRIGGERED_BY_SCHEDULE conditional so non-scheduled runs don’t pay the extra time/network cost.
Follow-up based on the errors we're seeing in CI For the scheduled E2E test runs:
checkoutsotests/e2e/reporters/kafka-results-reporter.tsis availablemake ci-bin-sem-cache-restoreisn't really necessary, but should help speed upnpm cinpm ciadded since the custom reporter needs to use a few packages