Skip to content

Commit c84662c

Browse files
authored
Merge pull request #968 from forcedotcom/dev
RELEASE: @W-12446613@: Merging dev to release for v3.9.0
2 parents 4b09d60 + b13a50f commit c84662c

File tree

133 files changed

+21413
-2831
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

133 files changed

+21413
-2831
lines changed

.github/workflows/run-tests.yml

Lines changed: 57 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -85,16 +85,58 @@ jobs:
8585
if: ${{ always() }}
8686
id: cli-messaging-tests
8787
run: yarn test-cli-messaging
88+
- if: ${{ failure() && steps.cli-messaging-tests.outcome != 'success' }}
89+
uses: ./github-actions/summarize-errors
90+
with:
91+
location: "${{github.workspace}}/cli-messaging"
92+
project-name: "cli-messaging"
93+
artifact-name: cli-messaging-tests-${{ runner.os }}-${{ matrix.java }}-${{ matrix.node.artifact }}
94+
framework: "junit"
95+
- if: ${{ failure() && steps.cli-messaging-tests.outcome != 'success' }}
96+
uses: actions/upload-artifact@v3
97+
with:
98+
name: cli-messaging-tests-${{ runner.os }}-${{ matrix.java }}-${{ matrix.node.artifact }}
99+
path: |
100+
./cli-messaging/build/reports
101+
./cli-messaging/build/test-results
88102
# 2. PMD Cataloger project.
89103
- name: PMD Cataloger Tests And Coverage
90104
id: pmd-cataloger-tests
91105
if: ${{ always() }}
92106
run: yarn test-pmd-cataloger
107+
- if: ${{ failure() && steps.pmd-cataloger-tests.outcome != 'success' }}
108+
uses: ./github-actions/summarize-errors
109+
with:
110+
location: "${{github.workspace}}/pmd-cataloger"
111+
project-name: "pmd-cataloger"
112+
artifact-name: pmd-cataloger-tests-${{ runner.os }}-${{ matrix.java }}-${{ matrix.node.artifact }}
113+
framework: "junit"
114+
- if: ${{ failure() && steps.pmd-cataloger-tests.outcome != 'success' }}
115+
uses: actions/upload-artifact@v3
116+
with:
117+
name: pmd-cataloger-tests-${{ runner.os }}-${{ matrix.java }}-${{ matrix.node.artifact }}
118+
path: |
119+
./pmd-cataloger/build/reports
120+
./pmd-cataloger/build/test-results
93121
# 3. SFGE project. (NOTE: We use the quiet variant so the logs don't blow up the console.)
94122
- name: SFGE Tests And Coverage
95123
id: sfge-tests
96124
if: ${{ always() }}
97125
run: yarn test-sfge-quiet
126+
- if: ${{ failure() && steps.sfge-tests.outcome != 'success' }}
127+
uses: ./github-actions/summarize-errors
128+
with:
129+
location: "${{github.workspace}}/sfge"
130+
project-name: "sfge"
131+
artifact-name: sfge-tests-${{ runner.os }}-${{ matrix.java }}-${{ matrix.node.artifact }}
132+
framework: "junit"
133+
- if: ${{ failure() && steps.sfge-tests.outcome != 'success' }}
134+
uses: actions/upload-artifact@v3
135+
with:
136+
name: sfge-tests-${{ runner.os }}-${{ matrix.java }}-${{ matrix.node.artifact }}
137+
path: |
138+
./sfge/build/reports
139+
./sfge/build/test-results
98140
# 4. Typescript project.
99141
- name: Typescript Tests And Coverage
100142
id: typescript-tests
@@ -104,12 +146,24 @@ jobs:
104146
id: typescript-linting
105147
if: ${{ always() }}
106148
run: yarn lint-typescript -f junit -o typescript-test-results/eslint/lint-results.xml
107-
# Upload the test results and coverage as an artifact
108-
- name: Upload artifact
149+
- if: ${{ failure() && (steps.typescript-tests.outcome != 'success' || steps.typescript-linting.outcome != 'success') }}
150+
uses: ./github-actions/summarize-errors
151+
with:
152+
location: "${{github.workspace}}/typescript-test-results"
153+
project-name: "typescript"
154+
artifact-name: typescript-tests-${{ runner.os }}-${{ matrix.java }}-${{ matrix.node.artifact }}
155+
framework: "mocha"
156+
- if: ${{ failure() && (steps.typescript-tests.outcome != 'success' || steps.typescript-linting.outcome != 'success') }}
157+
uses: actions/upload-artifact@v3
158+
with:
159+
name: typescript-tests-${{ runner.os }}-${{ matrix.java }}-${{ matrix.node.artifact }}
160+
path: |
161+
./typescript-test-results
162+
- name: Upload full artifact
109163
if: ${{ always() }}
110164
uses: actions/upload-artifact@v3
111165
with:
112-
name: test-results-${{ runner.os }}-jvm-${{ matrix.java }}-node-${{ matrix.node.artifact }}
166+
name: all-unit-tests-${{ runner.os }}-${{ matrix.java }}-${{ matrix.node.artifact }}
113167
path: |
114168
./typescript-test-results
115169
./pmd-cataloger/build/reports
@@ -118,36 +172,6 @@ jobs:
118172
./sfge/build/test-results
119173
./cli-messaging/build/reports
120174
./cli-messaging/build/test-results
121-
# If any of the steps failed, we need to report that.
122-
# TODO: In the future, we could replace this step with a JS-based one that uses `core.setFailed()` to set a failure
123-
# message in the annotations.
124-
- name: Report failures
125-
if: ${{ failure() || cancelled() }}
126-
shell: bash
127-
env:
128-
CLI_MESSAGING_FAILED: ${{ steps.cli-messaging-tests.outcome == 'failure' }}
129-
PMD_CATALOGER_FAILED: ${{ steps.pmd-cataloger-tests.outcome == 'failure' }}
130-
SFGE_FAILED: ${{ steps.sfge-tests.outcome == 'failure' }}
131-
TYPESCRIPT_TESTS_FAILED: ${{ steps.typescript-tests.outcome == 'failure' }}
132-
TYPESCRIPT_LINTING_FAILED: ${{ steps.typescript-linting.outcome == 'failure' }}
133-
run: |
134-
if [[ ${{ env.CLI_MESSAGING_FAILED }} == true ]]; then
135-
echo "cli-messaging had test failures"
136-
fi
137-
if [[ ${{ env.PMD_CATALOGER_FAILED }} == true ]]; then
138-
echo "pmd-cataloger had test failures and/or insufficient code coverage"
139-
fi
140-
if [[ ${{ env.SFGE_FAILED }} == true ]]; then
141-
echo "sfge had test failures and/or insufficient code coverage"
142-
fi
143-
if [[ ${{ env.TYPESCRIPT_TESTS_FAILED }} == true ]]; then
144-
echo "typescript had test failures and/or insufficient code coverage"
145-
fi
146-
if [[ ${{ env.TYPESCRIPT_LINTING_FAILED }} == true ]]; then
147-
echo "typescript had linting issues"
148-
fi
149-
echo "For more information, consult the failed steps' logs and the artifact for this run"
150-
exit 1
151175
# Step 2B: Run the smoke tests
152176
smoke-tests:
153177
strategy:
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dist/**
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# The compiled action is contained in the dist directory
2+
!dist/
3+
!build/
4+
5+
# Typescript output
6+
lib/
7+
8+
# npm output
9+
package-lock.json
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# summarize-errors github action
2+
3+
## Github action that adds a summary of selected errors to the GHA report
4+
5+
This action is based on the [typescript-action repo](https://github.com/actions/typescript-action).
6+
7+
**Important:** `index.ts` and its dependencies are compiled into a single file `dist/index.js`. Use the following steps to update `dist/index.js` before committing any changes.
8+
9+
```bash
10+
$ cd github-actions/summarize-errors
11+
$ npm install
12+
$ npm run all
13+
$ git add .
14+
$ git commit
15+
```
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: 'Summarize errors'
2+
description: 'Add information about test failures to GHA report'
3+
inputs:
4+
location:
5+
description: 'Location of results directory'
6+
required: true
7+
project-name:
8+
description: 'Name by which project should be displayed'
9+
required: true
10+
artifact-name:
11+
description: 'Name of the artifact where target test results are stored'
12+
required: true
13+
framework:
14+
description: 'What test framework are we summarizing?'
15+
required: true
16+
runs:
17+
using: 'node16'
18+
main: 'dist/index.js'

0 commit comments

Comments
 (0)