Skip to content

Positron: Full Test Suite #1061

Positron: Full Test Suite

Positron: Full Test Suite #1061

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: 80
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-smoke-tests
run: DISPLAY=:10 yarn smoketest-all --tracing --skip-cleanup
- name: Convert XUnit to JUnit
id: xunit-to-junit
if: success() || failure()
run: |
sudo apt-get update
sudo apt-get install -y libxml2-utils
yarn xunit-to-junit smoke-tests-electron
- name: Publish Electron Test Report
uses: mikepenz/action-junit-report@v4
if: success() || failure()
with:
report_paths: "**/.build/logs/smoke-tests-electron/test-results/xunit-results.xml"
check_name: "Electron Test Results"
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set TestRail Run Title
id: set-testrail-run-title
if: steps.xunit-to-junit == 'success'
run: echo "TESTRAIL_TITLE=$(date +'%Y-%m-%d') Nightly Smoke Tests - $GITHUB_REF_NAME" >> $GITHUB_ENV
- name: Upload Test Results to TestRail (Electron ONLY)
id: testrail-upload
if: steps.xunit-to-junit == 'success'
run: trcli --host "https://posit.testrail.io/" --project Positron --username testrailautomation@posit.co --key ${{ secrets.TESTRAIL_API_KEY}} parse_junit --file ".build/logs/smoke-tests-electron/test-results/xunit-results.xml" --case-matcher name --title "$TESTRAIL_TITLE" --close-run
- name: Upload Artifacts - Electron
if: always()
uses: actions/upload-artifact@v4
with:
name: run-artifacts-electron
path: .build/logs/smoke-tests-electron/
e2e-browser-tests:
runs-on: ubuntu-latest-4x
timeout-minutes: 40
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 Web Smoke Tests
env:
POSITRON_PY_VER_SEL: 3.10.12
POSITRON_R_VER_SEL: 4.4.0
id: electron-web-smoke-tests
run: DISPLAY=:10 yarn smoketest-web --tracing
- name: Convert XUnit to JUnit
id: xunit-to-junit
if: success() || failure()
run: |
sudo apt-get update
sudo apt-get install -y libxml2-utils
yarn xunit-to-junit smoke-tests-browser
- name: Publish Web Test Report
uses: mikepenz/action-junit-report@v4
if: success() || failure()
with:
report_paths: "**/.build/logs/smoke-tests-browser/test-results/xunit-results.xml"
check_name: "Web Test Results"
token: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Artifacts - Browser
if: always()
uses: actions/upload-artifact@v4
with:
name: run-artifacts-browser
path: .build/logs/smoke-tests-browser/
- name: Clean up license files
if: always()
run: cd .. && rm -rf positron-license
slack-notification:
name: "slack-notification"
runs-on: ubuntu-latest
needs:
[
"unit-tests",
"integration-tests",
"e2e-electron-tests",
"e2e-browser-tests",
]
if: failure()
steps:
- name: "Send Slack notification"
uses: testlabauto/action-test-results-to-slack@v0.0.6
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