From 9e78076ddf5b813c501268ae0d1b5fb5168973e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristina=20Ca=C3=B1izales?= <113132642+CristiCanizales@users.noreply.github.com> Date: Mon, 30 Oct 2023 01:05:16 +0100 Subject: [PATCH] Run e2e against vsixes (#5180) * 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 <76090802+gbockus-sf@users.noreply.github.com> --- .github/workflows/apexE2E.yml | 27 ++++++++++++------ .github/workflows/buildAll.yml | 3 +- .github/workflows/coreE2E.yml | 33 +++++++++++++++------- .github/workflows/e2e.yml | 21 ++++++++++---- .github/workflows/lspE2E.yml | 21 ++++++++++---- .github/workflows/runE2ETest.yml | 22 +++++++++++---- .github/workflows/slackNotification.yml | 1 + .github/workflows/testBuildAndRelease.yml | 4 +-- .github/workflows/testCommitExceptMain.yml | 3 +- .github/workflows/testSlackWorkflow.yml | 16 ----------- 10 files changed, 93 insertions(+), 58 deletions(-) delete mode 100644 .github/workflows/testSlackWorkflow.yml diff --git a/.github/workflows/apexE2E.yml b/.github/workflows/apexE2E.yml index 44437389fa..a6c2ed004d 100644 --- a/.github/workflows/apexE2E.yml +++ b/.github/workflows/apexE2E.yml @@ -1,8 +1,6 @@ name: Apex End to End Tests on: - schedule: - - cron: 10 6 * * * workflow_dispatch: inputs: automationBranch: @@ -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: @@ -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() }} @@ -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' \ No newline at end of file + type: 'e2e' diff --git a/.github/workflows/buildAll.yml b/.github/workflows/buildAll.yml index b9982b168d..3ca1d22338 100644 --- a/.github/workflows/buildAll.yml +++ b/.github/workflows/buildAll.yml @@ -34,5 +34,4 @@ jobs: uses: actions/upload-artifact@v3 with: name: ${{ inputs.label }} - path: ./extensions/ - \ No newline at end of file + path: ./extensions/ \ No newline at end of file diff --git a/.github/workflows/coreE2E.yml b/.github/workflows/coreE2E.yml index 6af2c6c981..4d24de7b9d 100644 --- a/.github/workflows/coreE2E.yml +++ b/.github/workflows/coreE2E.yml @@ -1,8 +1,6 @@ name: Core End to End Tests on: - schedule: - - cron: 10 6 * * * workflow_dispatch: inputs: automationBranch: @@ -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: @@ -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() }} @@ -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' \ No newline at end of file + type: 'e2e' diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index cb43c3548e..4841398672 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -1,5 +1,8 @@ name: End to End Tests on: + workflow_run: + workflows: + - Nightly Build Develop workflow_dispatch: inputs: automationBranch: @@ -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 }} diff --git a/.github/workflows/lspE2E.yml b/.github/workflows/lspE2E.yml index 3a62a991bb..e90628db8e 100644 --- a/.github/workflows/lspE2E.yml +++ b/.github/workflows/lspE2E.yml @@ -1,8 +1,6 @@ name: LSP End to End Tests on: - schedule: - - cron: 10 6 * * * workflow_dispatch: inputs: automationBranch: @@ -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: @@ -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() }} @@ -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' \ No newline at end of file + type: 'e2e' diff --git a/.github/workflows/runE2ETest.yml b/.github/workflows/runE2ETest.yml index 34892e3f9b..b15be521e8 100644 --- a/.github/workflows/runE2ETest.yml +++ b/.github/workflows/runE2ETest.yml @@ -11,6 +11,10 @@ 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: @@ -18,7 +22,7 @@ jobs: strategy: fail-fast: false matrix: - os: [macos-latest, windows-latest, ubuntu-latest] + os: [macos-latest, ubuntu-latest] nodeVersion: - 18.11.0 vscodeVersion: @@ -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: @@ -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 diff --git a/.github/workflows/slackNotification.yml b/.github/workflows/slackNotification.yml index d9b5ccd91f..03379ee872 100644 --- a/.github/workflows/slackNotification.yml +++ b/.github/workflows/slackNotification.yml @@ -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 }}" diff --git a/.github/workflows/testBuildAndRelease.yml b/.github/workflows/testBuildAndRelease.yml index 0795a96ba0..e04b3ffb01 100644 --- a/.github/workflows/testBuildAndRelease.yml +++ b/.github/workflows/testBuildAndRelease.yml @@ -1,7 +1,7 @@ name: Test, Build, and Release on: push: - branches: + branches: - 'main' jobs: @@ -21,7 +21,7 @@ jobs: build-and-test: uses: ./.github/workflows/buildAndTest.yml needs: [get-version] - with: + with: branch: 'main' label: ${{ needs.get-version.outputs.RELEASE_VERSION }} release: diff --git a/.github/workflows/testCommitExceptMain.yml b/.github/workflows/testCommitExceptMain.yml index 9001e6846f..fb0f6706dd 100644 --- a/.github/workflows/testCommitExceptMain.yml +++ b/.github/workflows/testCommitExceptMain.yml @@ -5,5 +5,4 @@ on: jobs: build-and-test: - uses: ./.github/workflows/buildAndTest.yml - \ No newline at end of file + uses: ./.github/workflows/buildAndTest.yml \ No newline at end of file diff --git a/.github/workflows/testSlackWorkflow.yml b/.github/workflows/testSlackWorkflow.yml deleted file mode 100644 index e9de81395e..0000000000 --- a/.github/workflows/testSlackWorkflow.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: Test Slack - -on: - workflow_dispatch: - -jobs: - slack_notification: - uses: ./.github/workflows/slackNotification.yml - secrets: inherit - with: - title: "Test: Release Branch v56.7.1 (patch) successfully created" - failedEvent: "Create Release Branch" - successfulEvent: "https://github.com/forcedotcom/salesforcedx-vscode/tree/release/v56.7.1" - type: "created" - result: "failure" - workflow: "create-release-branch.yml"