Skip to content

Test: Full Suite (Ubuntu) #1099

Test: Full Suite (Ubuntu)

Test: Full Suite (Ubuntu) #1099

name: "Positron: Full Test Suite"
# Run tests daily at 4am UTC (11p EST) on weekdays for now, or manually
on:
schedule:
- cron: "0 4 * * 1-5"
workflow_dispatch:
permissions:
id-token: write
contents: read
jobs:
unit-tests:
runs-on: ubuntu-latest
timeout-minutes: 30
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
POSITRON_BUILD_NUMBER: 0 # CI skips building releases
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- 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: Run Unit Tests (Electron)
id: electron-unit-tests
run: DISPLAY=:10 ./scripts/test.sh
- name: Run Unit Tests (node.js)
id: nodejs-unit-tests
run: yarn test-node
- name: Run Unit Tests (Browser, Chromium)
id: browser-unit-tests
run: DISPLAY=:10 yarn test-browser-no-install --browser chromium
integration-tests:
runs-on: ubuntu-latest
timeout-minutes: 30
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
POSITRON_BUILD_NUMBER: 0 # CI skips building releases
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- 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 R
uses: ./.github/actions/install-r
with:
version: "4.4.0"
- name: Compile Integration Tests
run: yarn --cwd test/integration/browser compile
- name: Run Integration Tests (Electron)
id: electron-integration-tests
run: DISPLAY=:10 ./scripts/test-integration.sh
- name: Run Integration Tests (Remote)
if: ${{ job.status != 'cancelled' && (success() || failure()) }}
id: electron-remote-integration-tests
run: DISPLAY=:10 ./scripts/test-remote-integration.sh
- name: Run Integration Tests (Browser, Chromium)
if: ${{ job.status != 'cancelled' && (success() || failure()) }}
id: browser-integration-tests
run: DISPLAY=:10 ./scripts/test-web-integration.sh --browser chromium
- name: Clean up license files
if: always()
run: cd .. && rm -rf positron-license
e2e-electron-tests:
runs-on: ubuntu-latest-8x
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
shardIndex: [1, 2]
shardTotal: [2]
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
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- 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: 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 }}
- name: Run Tests (Electron)
env:
POSITRON_PY_VER_SEL: 3.10.12
POSITRON_R_VER_SEL: 4.4.0
id: electron-tests
run: DISPLAY=:10 npx playwright test --project e2e-electron --workers 1 --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
- name: Upload blob report
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: blob-report-electron-${{ matrix.shardIndex }}
path: blob-report
retention-days: 14
- name: Upload junit report
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: junit-report-electron-${{ matrix.shardIndex }}
path: test-results/junit.xml
e2e-browser-tests:
runs-on: ubuntu-latest-4x
timeout-minutes: 50
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
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- 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 }}
- name: Run Tests (Browser)
env:
POSITRON_PY_VER_SEL: 3.10.12
POSITRON_R_VER_SEL: 4.4.0
id: browser-tests
run: DISPLAY=:10 npx playwright test --project e2e-browser --workers 1
- name: Upload blob report
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: blob-report-browser
path: blob-report
retention-days: 14
- name: Clean up license files
if: always()
run: cd .. && rm -rf positron-license
e2e-report:
container:
image: mcr.microsoft.com/playwright:v1.48.0-jammy
runs-on: ubuntu-latest
needs:
[
"unit-tests",
"integration-tests",
"e2e-electron-tests",
"e2e-browser-tests",
]
if: ${{ !cancelled() }}
env:
AWS_S3_BUCKET: positron-test-reports
REPORT_DIR: playwright-report-${{ github.run_id }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- name: Install unzip
run: apt-get update && apt-get install -y unzip
- name: Install AWS CLI
run: |
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o /tmp/awscliv2.zip
unzip -q /tmp/awscliv2.zip -d /tmp
/tmp/aws/install -i $HOME/aws-cli -b $HOME/bin
rm -rf /tmp/aws /tmp/awscliv2.zip
- name: Add AWS CLI to PATH
run: echo "$HOME/bin" >> $GITHUB_PATH
- name: Verify AWS CLI installation
run: aws --version
- name: Download blob reports
uses: actions/download-artifact@v4
with:
path: all-blob-reports
pattern: blob-report-*
merge-multiple: true
- name: Merge blobs into HTML Report
run: npx playwright merge-reports --reporter html ./all-blob-reports
- name: Upload Playwright Report to S3
uses: ./.github/actions/upload-report-to-s3
if: ${{ !cancelled() }}
with:
role-to-assume: ${{ secrets.AWS_TEST_REPORTS_ROLE }}
- name: Send HTML report URL to GitHub Summary
if: ${{ !cancelled() }}
run: |
REPORT_URL="https://d38p2avprg8il3.cloudfront.net/${{ env.REPORT_DIR }}/index.html"
echo $REPORT_URL > url.txt
echo "Report URL: $REPORT_URL"
echo "📄 [Playwright Report]($REPORT_URL) <br>" > $GITHUB_STEP_SUMMARY
- name: Download junit reports
uses: actions/download-artifact@v4
with:
path: all-junit-reports
pattern: junit-report-*
merge-multiple: true
- name: Merge junit reports
run: npm install -g junit-report-merger && npx jrm junit.xml "all-junit-reports/*.xml"
- name: Set TestRail Run Title
id: set-testrail-run-title
if: ${{ !cancelled() }}
run: echo "TESTRAIL_TITLE=$(date +'%Y-%m-%d') Nightly E2E Electron Tests - $GITHUB_REF_NAME" >> $GITHUB_ENV
- name: Install trcli
run: apt-get update && apt-get install -y python3-pip && pip3 install trcli
- name: Upload Test Results to TestRail (Electron ONLY)
id: testrail-upload
if: ${{ !cancelled() }}
run: trcli --host "https://posit.testrail.io/" --project Positron --username [email protected] --key ${{ secrets.TESTRAIL_API_KEY}} parse_junit --file "./junit.xml" --case-matcher name --title "$TESTRAIL_TITLE" --close-run
- name: Check Upstream Job Status
if: ${{ !cancelled() }}
run: |
FAILED_JOBS=""
if [ "${{ needs.unit-tests.result }}" == "failure" ]; then
FAILED_JOBS="${FAILED_JOBS} Unit Tests"
fi
if [ "${{ needs.integration-tests.result }}" == "failure" ]; then
FAILED_JOBS="${FAILED_JOBS} Integration Tests"
fi
if [ "${{ needs.e2e-electron-tests.result }}" == "failure" ]; then
FAILED_JOBS="${FAILED_JOBS} E2E Electron Tests"
fi
if [ "${{ needs.e2e-browser-tests.result }}" == "failure" ]; then
FAILED_JOBS="${FAILED_JOBS} E2E Browser Tests"
fi
if [ -z "$FAILED_JOBS" ]; then
echo "All upstream jobs succeeded. Exiting early."
exit 0
else
echo "Failed jobs detected: $FAILED_JOBS. Proceeding to Slack notification."
fi
- name: Send Slack notification
if: ${{ !cancelled() }}
uses: testlabauto/[email protected]
with:
github_token: ${{ secrets.POSITRON_GITHUB_PAT }}
slack_token: ${{ secrets.SMOKE_TESTS_SLACK_TOKEN }}
slack_channel: C07FR1JNZNJ #positron-test-results channel
suite_name: Positron Full Test Suite