Skip to content

Test: E2E (Linux)

Test: E2E (Linux) #13

Workflow file for this run

name: "Test: E2E (Linux)"
on:
workflow_call:
inputs:
grep:
required: false
description: "Only run tests matching this regex. Supports tags (comma-separated), titles, filenames. Confirm pattern matching locally with: npx playwright test --grep=<regex>"
default: "@critical"
type: string
project:
required: false
description: "The name of the Playwright project to run tests for."
default: "e2e-electron"
type: string
repeat_each:
required: false
description: "Run each test N times, defaults to one."
default: 1
type: number
display_name:
required: false
description: "The name of the job as it will appear in the GitHub Actions UI."
default: "e2e-linux"
type: string
currents_tags:
required: false
description: "The tags to use for Currents recording."
default: "@linux"
type: string
report_testrail:
required: false
description: "Whether or not to report results to TestRail."
default: false
type: boolean
workflow_dispatch:
inputs:
project:
required: false
description: "The name of the Playwright project to run tests for."
default: "e2e-electron"
type: choice
options:
- e2e-electron
- e2e-browser
grep:
required: false
description: "Run tests matching a regular expression. Supports tags, test titles, and filenames. Leave blank to run all tests. For project `e2e-browser`, tests tagged with @web are pre-filtered; additional tags, titles, or filenames can be specified to refine filtering."
default: "@critical"
type: string
repeat_each:
required: false
description: "Run each test N times, defaults to one."
default: 1
type: number
permissions:
id-token: write
contents: read
jobs:
e2e-linux:
name: ${{ inputs.display_name || 'e2e-linux' }}
timeout-minutes: 45
runs-on: ubuntu-latest-8x
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
POSITRON_BUILD_NUMBER: 0 # CI skips building releases
_R_CHECK_FUTURE_FILE_TIMESTAMPS_: false # this check can be flaky in the R pkg tests
_R_CHECK_CRAN_INCOMING_: false
_R_CHECK_SYSTEM_CLOCK_: false
AWS_S3_BUCKET: positron-test-reports
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- name: Transform to Playwright tags $PW_TAGS
run: bash scripts/pr-tags-transform.sh ${{ inputs.project}} "${{ inputs.grep }}"
shell: bash
- name: Cache node_modules, build, extensions, and remote
uses: ./.github/actions/cache-multi-paths
- name: Setup Build and Compile
uses: ./.github/actions/setup-build-env
- name: Install Positron License
uses: ./.github/actions/install-license
with:
github-token: ${{ secrets.POSITRON_GITHUB_PAT }}
license-key: ${{ secrets.POSITRON_DEV_LICENSE }}
- name: Setup E2E Test Environment
uses: ./.github/actions/setup-test-env
with:
aws-role-to-assume: ${{ secrets.QA_AWS_RO_ROLE }}
aws-region: ${{ secrets.QA_AWS_REGION }}
github-token: ${{ secrets.GITHUB_TOKEN }}
# Preloading ensures the Node.js binary is fully built and ready before
# any parallel processes start, preventing runtime conflicts
- name: Preload Node.js Binary
if: ${{ inputs.project == 'e2e-browser' }}
run: npm run gulp node
- name: Send Results to GH Summary
uses: ./.github/actions/gen-report-dir
if: ${{ !cancelled() }}
- name: Run Playwright Tests (Electron)
env:
POSITRON_PY_VER_SEL: 3.10.12
POSITRON_R_VER_SEL: 4.4.0
CURRENTS_RECORD_KEY: ${{ secrets.CURRENTS_RECORD_KEY }}
CURRENTS_CI_BUILD_ID: ${{ github.run_id }}-${{ github.run_attempt }}
COMMIT_INFO_MESSAGE: ${{ github.event.head_commit.message }}
PWTEST_BLOB_DO_NOT_REMOVE: 1
CURRENTS_TAG: ${{ inputs.currents_tags || 'electron/linux' }}
run: |
DISPLAY=:10 npx playwright test --project ${{ inputs.project }} --workers 2 --grep "${{ env.PW_TAGS }}" --repeat-each ${{ inputs.repeat_each }}
- name: Upload Playwright Report to S3
if: ${{ success() || failure() }}
uses: ./.github/actions/upload-report-to-s3
with:
role-to-assume: ${{ secrets.AWS_TEST_REPORTS_ROLE }}
report-dir: ${{ env.REPORT_DIR }}
- name: Install trcli
if: ${{ inputs.report_testrail }}
shell: bash
run: sudo apt-get update && sudo apt-get install -y python3-pip && pip3 install trcli
- name: Upload Test Results to TestRail
if: ${{ inputs.report_testrail }}
shell: bash
run: |
TESTRAIL_TITLE="$(date +'%Y-%m-%d') ${{ env.TESTRAIL_TITLE }} - $GITHUB_REF_NAME"
echo "TESTRAIL_TITLE=$TESTRAIL_TITLE" >> $GITHUB_ENV
trcli --host "https://posit.testrail.io/" --project "${{ env.TESTRAIL_PROJECT }}" --username testrailautomation@posit.co --key "${{ env.TESTRAIL_API_KEY }}" parse_junit --file "./test-results/junit.xml" --case-matcher name --title "$TESTRAIL_TITLE" --close-run
env:
TESTRAIL_TITLE: ${{ inputs.project }}
TESTRAIL_PROJECT: "Positron"
TESTRAIL_API_KEY: ${{ secrets.TESTRAIL_API_KEY }}