Skip to content

Commit

Permalink
Run e2e against vsixes (#5180)
Browse files Browse the repository at this point in the history
* chore: initial commit

* chore: target specific vsixes from given run

* chore: nit - remove unused workflow

* chore: adapt e2e categories workflows

* chore: adapt e2e main workflow

* chore: make buildAll call e2e and update references

* chore: pr comments

* chore: wrong runID

* chore: remove one level

* chore: add branch to slack notif

* chore: default label Nightly E2E

* chore: missing input

* chore: add descriptions to the workflow inputs

* chore: add secrets inherit

* chore: run e2e after nigtly build develop finishes

* chore: missing comma in json for slack notif

---------

Co-authored-by: gbockus-sf <[email protected]>
  • Loading branch information
CristiCanizales and gbockus-sf authored Oct 30, 2023
1 parent 8c47d60 commit 9e78076
Show file tree
Hide file tree
Showing 10 changed files with 93 additions and 58 deletions.
27 changes: 19 additions & 8 deletions .github/workflows/apexE2E.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: Apex End to End Tests

on:
schedule:
- cron: 10 6 * * *
workflow_dispatch:
inputs:
automationBranch:
Expand Down Expand Up @@ -35,6 +33,10 @@ on:
required: false
default: true
type: boolean
runId:
description: 'Run ID of the workflow run that created the vsixes'
required: true
type: string

workflow_call:
inputs:
Expand Down Expand Up @@ -68,48 +70,57 @@ on:
required: false
default: true
type: boolean
runId:
description: 'Run ID of the workflow run that created the vsixes'
required: true
type: string

jobs:

apexLSP:
if: ${{ inputs.apexLsp || github.event_name == 'schedule' }}
if: ${{ inputs.apexLsp }}
uses: ./.github/workflows/runE2ETest.yml
secrets: inherit
with:
automationBranch: ${{ inputs.automationBranch }}
testToRun: 'apexLsp.e2e.ts'
runId: ${{ inputs.runId }}

apexReplayDebugger:
if: ${{ inputs.apexReplayDebugger || github.event_name == 'schedule' }}
if: ${{ inputs.apexReplayDebugger }}
uses: ./.github/workflows/runE2ETest.yml
secrets: inherit
with:
automationBranch: ${{ inputs.automationBranch }}
testToRun: 'apexReplayDebugger.e2e.ts'
runId: ${{ inputs.runId }}

debugApexTests:
if: ${{ inputs.debugApexTests || github.event_name == 'schedule' }}
if: ${{ inputs.debugApexTests }}
uses: ./.github/workflows/runE2ETest.yml
secrets: inherit
with:
automationBranch: ${{ inputs.automationBranch }}
testToRun: 'debugApexTests.e2e.ts'
runId: ${{ inputs.runId }}

runApexTests:
if: ${{ inputs.runApexTests || github.event_name == 'schedule' }}
if: ${{ inputs.runApexTests }}
uses: ./.github/workflows/runE2ETest.yml
secrets: inherit
with:
automationBranch: ${{ inputs.automationBranch }}
testToRun: 'runApexTests.e2e.ts'
runId: ${{ inputs.runId }}

trailApexReplayDebugger:
if: ${{ inputs.trailApexReplayDebugger || github.event_name == 'schedule' }}
if: ${{ inputs.trailApexReplayDebugger }}
uses: ./.github/workflows/runE2ETest.yml
secrets: inherit
with:
automationBranch: ${{ inputs.automationBranch }}
testToRun: 'trailApexReplayDebugger.e2e.ts'
runId: ${{ inputs.runId }}

slack_success_notification:
if: ${{ success() }}
Expand Down Expand Up @@ -145,4 +156,4 @@ jobs:
summary: '\n- Apex LSP: ${{ needs.apexLSP.result }}\n- Apex Replay Debugger: ${{ needs.apexReplayDebugger.result }}\n- Debug Apex Tests: ${{ needs.debugApexTests.result }}\n- Run Apex Tests: ${{ needs.runApexTests.result }}\n- Trail Apex Replay Debugger: ${{ needs.trailApexReplayDebugger.result }}'
result: 'The workflow was cancelled.'
workflow: 'actions/runs/${{ github.run_id }}'
type: 'e2e'
type: 'e2e'
3 changes: 1 addition & 2 deletions .github/workflows/buildAll.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,4 @@ jobs:
uses: actions/upload-artifact@v3
with:
name: ${{ inputs.label }}
path: ./extensions/

path: ./extensions/
33 changes: 23 additions & 10 deletions .github/workflows/coreE2E.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: Core End to End Tests

on:
schedule:
- cron: 10 6 * * *
workflow_dispatch:
inputs:
automationBranch:
Expand Down Expand Up @@ -45,6 +43,10 @@ on:
required: false
default: true
type: boolean
runId:
description: 'Run ID of the workflow run that created the vsixes'
required: true
type: string

workflow_call:
inputs:
Expand Down Expand Up @@ -88,64 +90,75 @@ on:
required: false
default: true
type: boolean
runId:
description: 'Run ID of the workflow run that created the vsixes'
required: false
type: string

jobs:

anInitialSuite:
if: ${{ inputs.anInitialSuite || github.event_name == 'schedule' }}
if: ${{ inputs.anInitialSuite }}
uses: ./.github/workflows/runE2ETest.yml
secrets: inherit
with:
automationBranch: ${{ inputs.automationBranch }}
testToRun: 'anInitialSuite.e2e.ts'
runId: ${{ inputs.runId }}

authentication:
if: ${{ inputs.authentication || github.event_name == 'schedule' }}
if: ${{ inputs.authentication }}
uses: ./.github/workflows/runE2ETest.yml
secrets: inherit
with:
automationBranch: ${{ inputs.automationBranch }}
testToRun: 'authentication.e2e.ts'
runId: ${{ inputs.runId }}

deployAndRetrieve:
if: ${{ inputs.deployAndRetrieve || github.event_name == 'schedule' }}
if: ${{ inputs.deployAndRetrieve }}
uses: ./.github/workflows/runE2ETest.yml
secrets: inherit
with:
automationBranch: ${{ inputs.automationBranch }}
testToRun: 'deployAndRetrieve.e2e.ts'
runId: ${{ inputs.runId }}

manifestBuilder:
if: ${{ inputs.manifestBuilder || github.event_name == 'schedule' }}
if: ${{ inputs.manifestBuilder }}
uses: ./.github/workflows/runE2ETest.yml
secrets: inherit
with:
automationBranch: ${{ inputs.automationBranch }}
testToRun: 'manifestBuilder.e2e.ts'
runId: ${{ inputs.runId }}

pushAndPull:
if: ${{ inputs.pushAndPull || github.event_name == 'schedule' }}
if: ${{ inputs.pushAndPull }}
uses: ./.github/workflows/runE2ETest.yml
secrets: inherit
with:
automationBranch: ${{ inputs.automationBranch }}
testToRun: 'pushAndPull.e2e.ts'
runId: ${{ inputs.runId }}

sObjectsDefinitions:
if: ${{ inputs.sObjectsDefinitions || github.event_name == 'schedule' }}
if: ${{ inputs.sObjectsDefinitions }}
uses: ./.github/workflows/runE2ETest.yml
secrets: inherit
with:
automationBranch: ${{ inputs.automationBranch }}
testToRun: 'sObjectsDefinitions.e2e.ts'
runId: ${{ inputs.runId }}

templates:
if: ${{ inputs.templates || github.event_name == 'schedule' }}
if: ${{ inputs.templates }}
uses: ./.github/workflows/runE2ETest.yml
secrets: inherit
with:
automationBranch: ${{ inputs.automationBranch }}
testToRun: 'templates.e2e.ts'
runId: ${{ inputs.runId }}

slack_success_notification:
if: ${{ success() }}
Expand Down Expand Up @@ -181,4 +194,4 @@ jobs:
summary: '\n- An Initial Suite: ${{ needs.anInitialSuite.result }}\n- Authentication: ${{ needs.authentication.result }}\n- Deploy and Retrieve: ${{ needs.deployAndRetrieve.result }}\n- Manifest Builder: ${{ needs.manifestBuilder.result }}\n- Push and Pull: ${{ needs.pushAndPull.result }}\n- SObjects Definitions: ${{ needs.sObjectsDefinitions.result }}\n- Templates: ${{ needs.templates.result }}'
result: 'The workflow was cancelled.'
workflow: 'actions/runs/${{ github.run_id }}'
type: 'e2e'
type: 'e2e'
21 changes: 15 additions & 6 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: End to End Tests
on:
workflow_run:
workflows:
- Nightly Build Develop
workflow_dispatch:
inputs:
automationBranch:
Expand All @@ -22,26 +25,32 @@ on:
required: false
default: true
type: boolean
runId:
required: true
type: string

jobs:

Apex_E2E_tests:
if: ${{ inputs.apexE2ETests }}
if: ${{ inputs.apexE2ETests || github.event_name == 'workflow_run' }}
uses: ./.github/workflows/apexE2E.yml
secrets: inherit
with:
automationBranch: ${{ inputs.automationBranch }}
automationBranch: ${{ inputs.automationBranch || 'develop' }}
runId: ${{ inputs.runId || github.event.workflow_run.run_number }}

Core_E2E_tests:
if: ${{ inputs.coreE2ETests }}
if: ${{ inputs.coreE2ETests || github.event_name == 'workflow_run' }}
uses: ./.github/workflows/coreE2E.yml
secrets: inherit
with:
automationBranch: ${{ inputs.automationBranch }}
automationBranch: ${{ inputs.automationBranch || 'develop' }}
runId: ${{ inputs.runId || github.event.workflow_run.run_number }}

LSP_E2E_tests:
if: ${{ inputs.lspE2ETests }}
if: ${{ inputs.lspE2ETests || github.event_name == 'workflow_run' }}
uses: ./.github/workflows/lspE2E.yml
secrets: inherit
with:
automationBranch: ${{ inputs.automationBranch }}
automationBranch: ${{ inputs.automationBranch || 'develop' }}
runId: ${{ inputs.runId || github.event.workflow_run.run_number }}
21 changes: 15 additions & 6 deletions .github/workflows/lspE2E.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: LSP End to End Tests

on:
schedule:
- cron: 10 6 * * *
workflow_dispatch:
inputs:
automationBranch:
Expand All @@ -25,6 +23,10 @@ on:
required: false
default: true
type: boolean
runId:
description: 'Run ID of the workflow run that created the vsixes'
required: true
type: string

workflow_call:
inputs:
Expand All @@ -48,32 +50,39 @@ on:
required: false
default: true
type: boolean
runId:
description: 'Run ID of the workflow run that created the vsixes'
required: false
type: string

jobs:

auraLSP:
if: ${{ inputs.auraLsp || github.event_name == 'schedule' }}
if: ${{ inputs.auraLsp }}
uses: ./.github/workflows/runE2ETest.yml
secrets: inherit
with:
automationBranch: ${{ inputs.automationBranch }}
testToRun: 'auraLsp.e2e.ts'
runId: ${{ inputs.runId }}

lwcLSP:
if: ${{ inputs.lwcLsp || github.event_name == 'schedule' }}
if: ${{ inputs.lwcLsp }}
uses: ./.github/workflows/runE2ETest.yml
secrets: inherit
with:
automationBranch: ${{ inputs.automationBranch }}
testToRun: 'lwcLsp.e2e.ts'
runId: ${{ inputs.runId }}

visualforceLSP:
if: ${{ inputs.visualforceLsp || github.event_name == 'schedule' }}
if: ${{ inputs.visualforceLsp }}
uses: ./.github/workflows/runE2ETest.yml
secrets: inherit
with:
automationBranch: ${{ inputs.automationBranch }}
testToRun: 'visualforceLsp.e2e.ts'
runId: ${{ inputs.runId }}

slack_success_notification:
if: ${{ success() }}
Expand Down Expand Up @@ -109,4 +118,4 @@ jobs:
summary: '\n- Aura LSP: ${{ needs.auraLSP.result }}\n- LWC LSP: ${{ needs.lwcLSP.result }}\n- Visualforce LSP: ${{ needs.visualforceLSP.result }}'
result: 'The workflow was cancelled.'
workflow: 'actions/runs/${{ github.run_id }}'
type: 'e2e'
type: 'e2e'
22 changes: 16 additions & 6 deletions .github/workflows/runE2ETest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,18 @@ on:
description: 'Run this E2E test'
required: false
type: string
runId:
description: 'Run ID of the workflow run that created the vsixes'
required: false
type: string

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
os: [macos-latest, ubuntu-latest]
nodeVersion:
- 18.11.0
vscodeVersion:
Expand All @@ -29,6 +33,17 @@ jobs:
with:
path: ./salesforcedx-vscode
ref: ${{ github.event.ref }}
- name: Download extension vsixes
run: |
mkdir ./extensions
pwd
gh run download ${{ inputs.runId }} -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:
Expand All @@ -48,11 +63,6 @@ jobs:
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
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/slackNotification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ jobs:
payload: |
{
"category": "${{ inputs.title }}",
"branch": "${{ github.ref_name }}",
"summary": "${{ inputs.summary }}",
"event": "${{ github.event.repository.html_url }}/${{ inputs.workflow }}",
"result": "${{ inputs.result }}"
Expand Down
Loading

0 comments on commit 9e78076

Please sign in to comment.