Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

VS Code Support E2E Tests #1

VS Code Support E2E Tests

VS Code Support E2E Tests #1

name: VS Code Support E2E Tests
on:
workflow_run:
workflows:
- Nightly Build Develop
types:
- completed
workflow_dispatch:
inputs:
automationBranch:
description: 'Set the branch to use for automation tests'
required: false
default: 'develop'
type: string
testToRun:
description: 'Run this E2E test'
required: false
default: 'anInitialSuite.e2e.ts'
type: string
runId:
description: 'Run ID of the workflow run that created the vsixes'
required: false
type: string
vscodeVersion:
description: 'VS Code Version'
required: false
type: string
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
nodeVersion:
- 18.18.2
vscodeVersion:
- ${{ inputs.vscodeVersion || '1.61.2'}}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
path: ./salesforcedx-vscode
ref: ${{ github.event.ref }}
- name: Download extension vsixes
run: |
mkdir ./extensions
pwd
gh run download ${{ inputs.runId || github.event.workflow_run.id }} -D ./extensions
mv ./extensions/*/* ./extensions/
working-directory: salesforcedx-vscode
env:
GITHUB_TOKEN: ${{ secrets.IDEE_GH_TOKEN }}
- name: Display downloaded vsix files
run: ls -R ./salesforcedx-vscode/extensions
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.nodeVersion }}
cache: npm
cache-dependency-path: |
salesforcedx-vscode/package-lock.json
salesforcedx-vscode-automation-tests/package-lock.json
- name: Setup java
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '11'
- name: Clone automation tests
uses: actions/checkout@v3
with:
repository: forcedotcom/salesforcedx-vscode-automation-tests
path: salesforcedx-vscode-automation-tests
ref: ${{ inputs.automationBranch || 'develop' }}
- name: Install Test Dependencies
run: |
npm install
working-directory: salesforcedx-vscode-automation-tests
- name: Install the SFDX CLI
run: npm install -g sfdx-cli
- name: Verify CLI
shell: bash
run: |
set -e
sfdx version
SFDX_CLI_VERSION=$(sfdx version)
if [[ ((`echo $SFDX_CLI_VERSION | grep -c "sfdx-cli/"` > 0))]]
then
echo "sfdx-cli installed -" $SFDX_CLI_VERSION
else
echo "The sfdx-cli installation could not be verified"
exit 1
fi
- name: Run headless test
uses: coactions/setup-xvfb@b6b4fcfb9f5a895edadc3bc76318fae0ac17c8b3
with:
run: |
npm run setup
npm run automation-tests
working-directory: salesforcedx-vscode-automation-tests
env:
VSCODE_VERSION: ${{ matrix.vscodeVersion }}
SPEC_FILES: ${{ inputs.testToRun || 'anInitialSuite.e2e.ts' }}
SFDX_AUTH_URL: ${{ secrets.SFDX_AUTH_URL_E2E }}
ORG_ID: ${{ secrets.ORG_ID_E2E }}
- uses: actions/upload-artifact@v3
if: failure()
with:
name: screenshots
path: ./salesforcedx-vscode-automation-tests/screenshots