Skip to content

Commit

Permalink
test release
Browse files Browse the repository at this point in the history
  • Loading branch information
midleman committed Dec 10, 2024
1 parent 6709096 commit e957bf5
Show file tree
Hide file tree
Showing 3 changed files with 125 additions and 88 deletions.
179 changes: 101 additions & 78 deletions .github/workflows/positron-full-test.yml
Original file line number Diff line number Diff line change
@@ -1,92 +1,116 @@
name: "Test: Full Suite"
name: "Test: E2E (Latest Release)"

on:
schedule:
- cron: "0 4 * * 1-5" # Run at 4 AM UTC on weekdays

workflow_dispatch:
inputs:
run_e2e_linux:
description: "E2E Electron (Linux) Tests"
required: false
default: true
type: boolean
run_e2e_windows:
description: "E2E Electron (Windows) Tests"
required: false
default: true
type: boolean
run_e2e_browser:
description: "E2E Browser (Linux) Tests"
required: false
default: true
type: boolean
run_unit_tests:
description: "Unit Tests"
required: false
default: true
type: boolean
run_integration_tests:
description: "Integration Tests"
required: false
default: true
type: boolean
notify_on:
description: "Send Slack notification on:"
required: false
default: "failure"
type: choice
options:
- failure
- always
inputs:
grep:
required: false
description: "Grep filter to apply to the e2e tests: @critical, @win, etc."
default: ""
type: string
notify_on:
description: "Slack notification on:"
required: false
default: "failure"
type: choice
options:
- failure
- always

permissions:
id-token: write
contents: read

jobs:
e2e-electron:
name: e2e
if: ${{ inputs.run_e2e_linux }}
uses: ./.github/workflows/test-e2e-linux.yml
with:
grep: ""
project: "e2e-electron"
display_name: "electron (linux)"
currents_tags: "nightly,electron/linux"
secrets: inherit
runs-on: ubuntu-latest-8x
timeout-minutes: 45
steps:
- uses: actions/checkout@v4

e2e-windows:
name: e2e
if: ${{ inputs.run_e2e_windows }}
uses: ./.github/workflows/test-e2e-windows.yml
with:
grep: ""
display_name: "electron (win)"
currents_tags: "nightly,electron/win"
secrets: inherit
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc

e2e-browser:
name: e2e
if: ${{ inputs.run_e2e_browser }}
uses: ./.github/workflows/test-e2e-linux.yml
with:
grep: ""
project: "e2e-browser"
display_name: "browser (linux)"
currents_tags: "nightly,browser/linux"
secrets: inherit
- name: Install Build Dependencies
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y \
vim curl build-essential clang make cmake git \
libsodium-dev libxkbfile-dev pkg-config libsecret-1-dev libxss1 dbus xvfb \
libgtk-3-0 libgbm1 libnss3 libnspr4 libasound2 libkrb5-dev libcairo-dev \
libsdl-pango-dev libjpeg-dev libgif-dev pandoc
unit-tests:
name: test
if: ${{ inputs.run_unit_tests }}
uses: ./.github/workflows/test-unit.yml
secrets: inherit
- name: Compile tests
run: |
corepack enable
yarn global add node-gyp
yarn install
yarn --cwd test/automation install
yarn --cwd test/e2e install
yarn --cwd test/automation compile
yarn --cwd test/e2e compile
- name: Get & install latest release
id: get_latest_release
run: |
response=$(curl -s -H "Authorization: token ${{ secrets.POSITRON_GITHUB_PAT }}" "https://api.github.com/repos/posit-dev/positron-builds/releases")
latest_tag=$(echo "${response}" | jq -r '.[0].tag_name')
asset_url=$(echo "${response}" | jq -r '.[0].assets[] | select(.name|match("deb")) | .url')
filename=$(echo "${response}" | jq -r '.[0].assets[] | select(.name|match("deb")) | .name')
echo "Latest release: ${latest_tag}"
echo "Downloading ${filename} from ${asset_url}..."
curl -L -H "Accept: application/octet-stream" -H "Authorization: token ${{ secrets.POSITRON_GITHUB_PAT }}" "${asset_url}" -o "${filename}"
sudo dpkg -i "${filename}"
- 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 }}

integration-tests:
name: test
if: ${{ inputs.run_integration_tests }}
uses: ./.github/workflows/test-integration.yml
secrets: inherit
- name: Configure xvfb Service
shell: bash
run: |
sudo cp build/azure-pipelines/linux/xvfb.init /etc/init.d/xvfb
sudo chmod +x /etc/init.d/xvfb
sudo update-rc.d xvfb defaults
sudo service xvfb start
- name: Send Results to GH Summary
uses: ./.github/actions/gen-report-dir
if: ${{ !cancelled() }}

- name: Get and set Playwright tags to $PW_TAGS
run: bash scripts/playwright-tags.sh "e2e-electron" "${{ inputs.grep }}"
shell: bash

- name: Run Tests (Electron)
if: ${{ !cancelled() }}
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: "release,${{ inputs.grep }}"
id: electron-e2e-tests
run: |
export DISPLAY=:10
BUILD=/usr/share/positron npx playwright test --project e2e-electron --workers 2 --grep=${{ env.grep }}
- name: Upload Playwright Report to S3
if: ${{ !cancelled() }}
uses: ./.github/actions/upload-report-to-s3
with:
role-to-assume: ${{ secrets.AWS_TEST_REPORTS_ROLE }}
report-dir: ${{ env.REPORT_DIR }}

slack-notify:
needs: [e2e-electron, e2e-windows, e2e-browser, unit-tests, integration-tests]
needs: [e2e-electron]
runs-on: ubuntu-latest
if: always()
steps:
Expand All @@ -96,4 +120,3 @@ jobs:
repo_token: ${{ secrets.POSITRON_GITHUB_PAT }}
slack_webhook_url: ${{ secrets.SLACK_MARIE_WEBHOOK_URL }}
notify_on: ${{ inputs.notify_on }}

19 changes: 19 additions & 0 deletions .github/workflows/test-e2e-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ on:
description: "Grep filter to apply to the e2e tests: @critical, @win, etc."
default: ""
type: string
notify_on:
description: "Slack notification on:"
required: false
default: "failure"
type: choice
options:
- failure
- always

permissions:
id-token: write
Expand Down Expand Up @@ -101,3 +109,14 @@ jobs:
role-to-assume: ${{ secrets.AWS_TEST_REPORTS_ROLE }}
report-dir: ${{ env.REPORT_DIR }}

slack-notify:
needs: [e2e-electron]
runs-on: ubuntu-latest
if: always()
steps:
- name: Notify Slack
uses: midleman/slack-workflow-status@master
with:
repo_token: ${{ secrets.POSITRON_GITHUB_PAT }}
slack_webhook_url: ${{ secrets.SLACK_MARIE_WEBHOOK_URL }}
notify_on: ${{ inputs.notify_on }}
15 changes: 5 additions & 10 deletions build/secrets/.secrets.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@
{
"path": "detect_secrets.filters.allowlist.is_line_allowlisted"
},
{
"path": "detect_secrets.filters.common.is_baseline_file",
"filename": "build/secrets/.secrets.baseline"
},
{
"path": "detect_secrets.filters.heuristic.is_indirect_reference"
},
Expand Down Expand Up @@ -129,15 +133,6 @@
}
],
"results": {
".github/workflows/positron-full-test.yml": [
{
"type": "Secret Keyword",
"filename": ".github/workflows/positron-full-test.yml",
"hashed_secret": "3e26d6750975d678acb8fa35a0f69237881576b0",
"is_verified": false,
"line_number": 53
}
],
".github/workflows/positron-merge-to-branch.yml": [
{
"type": "Secret Keyword",
Expand Down Expand Up @@ -1947,5 +1942,5 @@
}
]
},
"generated_at": "2024-12-10T15:58:09Z"
"generated_at": "2024-12-10T16:13:52Z"
}

0 comments on commit e957bf5

Please sign in to comment.