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

LSP End to End Tests #79

LSP End to End Tests

LSP End to End Tests #79

Workflow file for this run

name: LSP End to End Tests
on:
workflow_dispatch:
inputs:
automationBranch:
description: 'Set the branch to use for automation tests'
required: false
default: 'develop'
type: string
auraLsp:
description: 'auraLsp.e2e.ts'
required: false
default: false
type: boolean
lwcLsp:
description: 'lwcLsp.e2e.ts'
required: false
default: false
type: boolean
visualforceLsp:
description: 'visualforceLsp.e2e.ts'
required: false
default: false
type: boolean
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
nodeVersion:
- 16.15.1
vscodeVersion:
- stable
steps:
# - name: Checkout
# uses: actions/checkout@v3
# with:
# path: ./salesforcedx-vscode
# ref: ${{ github.event.ref }}
# - 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: Clone automation tests
# uses: actions/checkout@v3
# with:
# repository: forcedotcom/salesforcedx-vscode-automation-tests
# path: salesforcedx-vscode-automation-tests
# ref: ${{ inputs.automationBranch }}
# - name: Install Extension Dependencies
# run: |
# npm install
# npm run compile
# working-directory: salesforcedx-vscode
# - 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: Check which e2e tests are selected
shell: bash
run: |
TESTS_TO_RUN=dummyvalue
echo 'inside check which e2e tests are selected'
echo 'before if statement block'
if (${{ inputs.auraLsp }} == true)
then
TESTS_TO_RUN=$TESTS_TO_RUN+auraLsp.e2e.ts
echo 'auraLsp is selected'
fi
if (${{ inputs.lwcLsp }} == true)
then
TESTS_TO_RUN=$TESTS_TO_RUN+lwcLsp.e2e.ts
echo 'lwcLsp is selected'
fi
if (${{ inputs.visualforceLsp }} == true)
then
TESTS_TO_RUN=$TESTS_TO_RUN+visualforceLsp.e2e.ts
echo 'visualforceLsp is selected'
fi
echo 'after if statement block 4'
echo $TESTS_TO_RUN
if ($TESTS_TO_RUN = "dummyvalue")
then
echo 'no tests are selected to be run'
TESTS_TO_RUN=$TESTS_TO_RUN+auraLsp.e2e.ts+lwcLsp.e2e.ts+visualforceLsp.e2e.ts
fi
# https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#environment-files
echo "ENV_TESTS_TO_RUN=$TESTS_TO_RUN" >> "$GITHUB_ENV"
- name: Print env.ENV_TESTS_TO_RUN
shell: bash
run: echo ${{ env.ENV_TESTS_TO_RUN }}
# - name: Run headless test
# uses: coactions/setup-xvfb@b6b4fcfb9f5a895edadc3bc76318fae0ac17c8b3
# with:
# run: |
# npm run setup
# npm run automation-tests
# echo 'testsToRun = ' + ${{ env.ENV_TESTS_TO_RUN }}
# echo 'auraLsp = ' + ${{ inputs.auraLsp }}
# echo 'lwcLsp = ' + ${{ inputs.lwcLsp }}
# echo 'visualforceLwp = ' + ${{ inputs.visualforceLsp }}
# working-directory: salesforcedx-vscode-automation-tests
# env:
# VSCODE_VERSION: ${{ matrix.vscodeVersion }}
# SPEC_FILES: ${{ env.ENV_TESTS_TO_RUN }}
# 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