-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test reporting to component generation
- Loading branch information
Showing
14 changed files
with
220 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { copyFile, getDestinationPath, mergeText, replaceText } from '../../helper.js'; | ||
|
||
export function run(templateData) { | ||
templateData = { | ||
...templateData, | ||
testReportingTool: templateData.testReportingTool?.trim() || 'Unknown', | ||
testReportingExperience: templateData.testReportingExperience?.trim() || 'Unknown' | ||
}; | ||
|
||
mergeText( | ||
`${__dirname}/templates/configured/_gitignore`, | ||
`${getDestinationPath(templateData.hyphenatedName)}/.gitignore` | ||
); | ||
copyFile( | ||
`${__dirname}/templates/configured/_d2l-test-reporting.config.json`, | ||
`${getDestinationPath(templateData.hyphenatedName)}/d2l-test-reporting.config.json` | ||
); | ||
replaceText(`${getDestinationPath(templateData.hyphenatedName)}/d2l-test-reporting.config.json`, templateData); | ||
} |
4 changes: 4 additions & 0 deletions
4
src/generators/test-reporting/templates/configured/_d2l-test-reporting.config.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"tool": "<%= testReportingTool %>", | ||
"experience": "<%= testReportingExperience %>" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
d2l-test-report.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
src/generators/test-unit-axe/templates/configured/_d2l-test-reporting.config.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"overrides": [ | ||
{ | ||
"pattern": "**/test/*.test.js", | ||
"type": "UI Unit" | ||
}, | ||
{ | ||
"pattern": "**/test/*.axe.js", | ||
"type": "UI Accessibility" | ||
} | ||
] | ||
} |
46 changes: 46 additions & 0 deletions
46
src/generators/test-unit-axe/templates/static/.github/workflows/ci-test-reporting.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: CI | ||
on: pull_request | ||
jobs: | ||
test: | ||
name: Test | ||
timeout-minutes: 5 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: Brightspace/third-party-actions@actions/checkout | ||
- name: Setup node | ||
uses: Brightspace/third-party-actions@actions/setup-node | ||
with: | ||
node-version-file: .nvmrc | ||
- name: Install dependencies | ||
run: npm install | ||
- name: Lint (JavaScript) | ||
run: npm run lint:eslint | ||
- name: Lint (CSS) | ||
run: npm run lint:style | ||
- name: Accessibility tests | ||
id: at | ||
run: npm run test:axe | ||
- name: Upload test report | ||
if: > | ||
always() && | ||
github.triggering_actor != 'dependabot[bot]' && | ||
(steps.at.outcome == 'failure' || steps.at.outcome == 'success') | ||
uses: Brightspace/test-reporting-action@main | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-session-token: ${{ secrets.AWS_SESSION_TOKEN }} | ||
- name: Unit tests | ||
id: ut | ||
run: npm run test:unit | ||
- name: Upload test report | ||
if: > | ||
always() && | ||
github.triggering_actor != 'dependabot[bot]' && | ||
(steps.ut.outcome == 'failure' || steps.ut.outcome == 'success') | ||
uses: Brightspace/test-reporting-action@main | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-session-token: ${{ secrets.AWS_SESSION_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
src/generators/test-vdiff/templates/configured/_d2l-test-reporting.config.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"overrides": [ | ||
{ | ||
"pattern": "**/test/*.vdiff.js", | ||
"type": "UI Visual Diff" | ||
} | ||
] | ||
} |
27 changes: 27 additions & 0 deletions
27
src/generators/test-vdiff/templates/static/.github/workflows/vdiff-test-reporting.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: vdiff | ||
on: pull_request | ||
jobs: | ||
vdiff: | ||
timeout-minutes: 5 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: Brightspace/third-party-actions@actions/checkout | ||
- uses: Brightspace/third-party-actions@actions/setup-node | ||
with: | ||
node-version-file: .nvmrc | ||
- name: Install Dependencies | ||
run: npm install | ||
- name: vdiff Tests | ||
uses: BrightspaceUI/actions/vdiff@main | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-session-token: ${{ secrets.AWS_SESSION_TOKEN }} | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Upload test report | ||
if: failure() || success() | ||
uses: Brightspace/test-reporting-action@main | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-session-token: ${{ secrets.AWS_SESSION_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters