forked from Qafana/xunit-xml-slack-action
-
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.
Merge pull request #1 from empear-analytics/Taking-care-of-tests-with…
…out-a-result Sending a different message when test results can't be found
- Loading branch information
Showing
12 changed files
with
9,308 additions
and
546 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Run Tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
workflow_dispatch: | ||
|
||
jobs: | ||
run-tests: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: '16.14.0' | ||
- run: npm ci --no-progress | ||
- run: npm run test |
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 |
---|---|---|
|
@@ -100,3 +100,7 @@ typings/ | |
# TernJS port file | ||
.tern-port | ||
.DS_Store | ||
|
||
# IDE | ||
.idea/ | ||
.vscode/ |
This file was deleted.
Oops, something went wrong.
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,17 @@ | ||
import ResultsParser from './results-parser'; | ||
|
||
test('existing file is parsed OK', async () => { | ||
const result = new ResultsParser('results.xml'); | ||
await result.parse(); | ||
expect(result.failedTests).toBe(1); | ||
}) | ||
|
||
test('non-existing file throws ENOENT', async () => { | ||
const result = new ResultsParser('foo.xml'); | ||
try { | ||
await result.parse(); | ||
} catch (e) { | ||
expect(e.code).toEqual('ENOENT'); | ||
} | ||
}) | ||
|
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,161 @@ | ||
<testsuites id="" name="" tests="8" failures="1" skipped="1" errors="0" time="195.091"> | ||
<testsuite name="cloud/test-4f.spec.ts" timestamp="1655667311825" hostname="" tests="1" failures="1" skipped="0" time="57.449" errors="0"> | ||
<testcase name="4 factors dashboard Check 4 factors @dashboard on @cloud" classname="[staging] › cloud/test-4f.spec.ts:11:5 › 4 factors dashboard › Check 4 factors @dashboard on @cloud" time="57.449"> | ||
<failure message="test-4f.spec.ts:11:5 Check 4 factors @dashboard on @cloud" type="FAILURE"> | ||
[staging] › cloud/test-4f.spec.ts:11:5 › 4 factors dashboard › Check 4 factors @dashboard on @cloud | ||
|
||
Error: expect(received).toBeVisible() | ||
Call log: | ||
- expect.toBeVisible with timeout 5000ms | ||
- waiting for selector "[data-automation-id='hotspot-code-health-div']" | ||
|
||
|
||
15 | const analysisResultsPage = await projectsPage.clickOnProjectTitle(projectName); | ||
16 | let newDashboardPage = await analysisResultsPage.load4f(); | ||
> 17 | await newDashboardPage.verifyVisibilityOfHotspotCodeHealth(); | ||
| ^ | ||
18 | let hotspotsPage = await newDashboardPage.clickOnViewHotspotsLink(); | ||
19 | await hotspotsPage.verifyHotspotsTab(); | ||
20 | await page.goBack(); | ||
|
||
at CodeHealthPage.verifyVisibilityOfHotspotCodeHealth (/Users/emir/Codebase/codescene/testing/ui-tests-playwright/pages/common-pages/analysis-results-pages/new-dashboard-page/code-health-page.ts:57:60) | ||
at /Users/emir/Codebase/codescene/testing/ui-tests-playwright/tests/cloud/test-4f.spec.ts:17:30 | ||
|
||
Error: expect(received).toBeVisible() | ||
Call log: | ||
- expect.toBeVisible with timeout 5000ms | ||
- waiting for selector "[data-automation-id='view-hotspots-in-hotspot-code-health']" | ||
|
||
|
||
15 | const analysisResultsPage = await projectsPage.clickOnProjectTitle(projectName); | ||
16 | let newDashboardPage = await analysisResultsPage.load4f(); | ||
> 17 | await newDashboardPage.verifyVisibilityOfHotspotCodeHealth(); | ||
| ^ | ||
18 | let hotspotsPage = await newDashboardPage.clickOnViewHotspotsLink(); | ||
19 | await hotspotsPage.verifyHotspotsTab(); | ||
20 | await page.goBack(); | ||
|
||
at CodeHealthPage.verifyVisibilityOfHotspotCodeHealth (/Users/emir/Codebase/codescene/testing/ui-tests-playwright/pages/common-pages/analysis-results-pages/new-dashboard-page/code-health-page.ts:58:50) | ||
at /Users/emir/Codebase/codescene/testing/ui-tests-playwright/tests/cloud/test-4f.spec.ts:17:7 | ||
|
||
locator.click: Timeout 20000ms exceeded. | ||
=========================== logs =========================== | ||
waiting for selector "[data-automation-id='view-hotspots-in-hotspot-code-health']" | ||
============================================================ | ||
|
||
16 | let newDashboardPage = await analysisResultsPage.load4f(); | ||
17 | await newDashboardPage.verifyVisibilityOfHotspotCodeHealth(); | ||
> 18 | let hotspotsPage = await newDashboardPage.clickOnViewHotspotsLink(); | ||
| ^ | ||
19 | await hotspotsPage.verifyHotspotsTab(); | ||
20 | await page.goBack(); | ||
21 | await newDashboardPage.verifyVisibilityOfAverageCodeHealth(); | ||
|
||
at CodeHealthPage.clickOnViewHotspotsLink (/Users/emir/Codebase/codescene/testing/ui-tests-playwright/pages/common-pages/analysis-results-pages/new-dashboard-page/code-health-page.ts:89:37) | ||
at /Users/emir/Codebase/codescene/testing/ui-tests-playwright/tests/cloud/test-4f.spec.ts:18:49 | ||
|
||
attachment #1: video (video/webm) -------------------------------------------------------------- | ||
test-results/cloud-test-4f-4-factors-dashboard-Check-4-factors-dashboard-on-cloud-staging/video.webm | ||
------------------------------------------------------------------------------------------------ | ||
|
||
attachment #2: trace (application/zip) --------------------------------------------------------- | ||
test-results/cloud-test-4f-4-factors-dashboard-Check-4-factors-dashboard-on-cloud-staging/trace.zip | ||
Usage: | ||
|
||
npx playwright show-trace test-results/cloud-test-4f-4-factors-dashboard-Check-4-factors-dashboard-on-cloud-staging/trace.zip | ||
|
||
------------------------------------------------------------------------------------------------ | ||
|
||
attachment #3: screenshot (image/png) ---------------------------------------------------------- | ||
test-results/cloud-test-4f-4-factors-dashboard-Check-4-factors-dashboard-on-cloud-staging/test-failed-1.png | ||
------------------------------------------------------------------------------------------------ | ||
|
||
</failure> | ||
<system-out> | ||
|
||
[[ATTACHMENT|../test-results/cloud-test-4f-4-factors-dashboard-Check-4-factors-dashboard-on-cloud-staging/video.webm]] | ||
|
||
[[ATTACHMENT|../test-results/cloud-test-4f-4-factors-dashboard-Check-4-factors-dashboard-on-cloud-staging/trace.zip]] | ||
|
||
[[ATTACHMENT|../test-results/cloud-test-4f-4-factors-dashboard-Check-4-factors-dashboard-on-cloud-staging/test-failed-1.png]] | ||
|
||
</system-out> | ||
</testcase> | ||
</testsuite> | ||
<testsuite name="cloud/test-login.spec.ts" timestamp="1655667311825" hostname="" tests="3" failures="0" skipped="0" time="104.71" errors="0"> | ||
<testcase name="Login feature Login with github on @cloud" classname="[staging] › cloud/test-login.spec.ts:10:5 › Login feature › Login with github on @cloud" time="34.088"> | ||
<system-out> | ||
|
||
[[ATTACHMENT|../test-results/cloud-test-login-Login-feature-Login-with-github-on-cloud-staging/video.webm]] | ||
|
||
[[ATTACHMENT|../test-results/cloud-test-login-Login-feature-Login-with-github-on-cloud-staging/trace.zip]] | ||
|
||
[[ATTACHMENT|../test-results/cloud-test-login-Login-feature-Login-with-github-on-cloud-staging/test-finished-1.png]] | ||
|
||
</system-out> | ||
</testcase> | ||
<testcase name="Login feature Login with bitbucket on @cloud" classname="[staging] › cloud/test-login.spec.ts:10:5 › Login feature › Login with bitbucket on @cloud" time="33.26"> | ||
<system-out> | ||
|
||
[[ATTACHMENT|../test-results/cloud-test-login-Login-feature-Login-with-bitbucket-on-cloud-staging/video.webm]] | ||
|
||
[[ATTACHMENT|../test-results/cloud-test-login-Login-feature-Login-with-bitbucket-on-cloud-staging/trace.zip]] | ||
|
||
[[ATTACHMENT|../test-results/cloud-test-login-Login-feature-Login-with-bitbucket-on-cloud-staging/test-finished-1.png]] | ||
|
||
</system-out> | ||
</testcase> | ||
<testcase name="Login feature Login with azure on @cloud" classname="[staging] › cloud/test-login.spec.ts:10:5 › Login feature › Login with azure on @cloud" time="37.362"> | ||
<system-out> | ||
|
||
[[ATTACHMENT|../test-results/cloud-test-login-Login-feature-Login-with-azure-on-cloud-staging/video.webm]] | ||
|
||
[[ATTACHMENT|../test-results/cloud-test-login-Login-feature-Login-with-azure-on-cloud-staging/trace.zip]] | ||
|
||
[[ATTACHMENT|../test-results/cloud-test-login-Login-feature-Login-with-azure-on-cloud-staging/test-finished-1.png]] | ||
|
||
</system-out> | ||
</testcase> | ||
</testsuite> | ||
<testsuite name="cloud/test-pr-integration.spec.ts" timestamp="1655667311825" hostname="" tests="3" failures="0" skipped="0" time="500.244" errors="0"> | ||
<testcase name="PR integration feature Test PR integration with github on @cloud @prIntegration" classname="[staging] › cloud/test-pr-integration.spec.ts:13:5 › PR integration feature › Test PR integration with github on @cloud @prIntegration" time="148.814"> | ||
<system-out> | ||
|
||
[[ATTACHMENT|../test-results/cloud-test-pr-integration-PR-integration-featu-eff46--integration-with-github-on-cloud-prIntegration-staging/video.webm]] | ||
|
||
[[ATTACHMENT|../test-results/cloud-test-pr-integration-PR-integration-featu-eff46--integration-with-github-on-cloud-prIntegration-staging/trace.zip]] | ||
|
||
[[ATTACHMENT|../test-results/cloud-test-pr-integration-PR-integration-featu-eff46--integration-with-github-on-cloud-prIntegration-staging/test-finished-1.png]] | ||
|
||
</system-out> | ||
</testcase> | ||
<testcase name="PR integration feature Test PR integration with bitbucket on @cloud @prIntegration" classname="[staging] › cloud/test-pr-integration.spec.ts:13:5 › PR integration feature › Test PR integration with bitbucket on @cloud @prIntegration" time="156.852"> | ||
<system-out> | ||
|
||
[[ATTACHMENT|../test-results/cloud-test-pr-integration-PR-integration-featu-31950-tegration-with-bitbucket-on-cloud-prIntegration-staging/video.webm]] | ||
|
||
[[ATTACHMENT|../test-results/cloud-test-pr-integration-PR-integration-featu-31950-tegration-with-bitbucket-on-cloud-prIntegration-staging/trace.zip]] | ||
|
||
[[ATTACHMENT|../test-results/cloud-test-pr-integration-PR-integration-featu-31950-tegration-with-bitbucket-on-cloud-prIntegration-staging/test-finished-1.png]] | ||
|
||
</system-out> | ||
</testcase> | ||
<testcase name="PR integration feature Test PR integration with azure on @cloud @prIntegration" classname="[staging] › cloud/test-pr-integration.spec.ts:13:5 › PR integration feature › Test PR integration with azure on @cloud @prIntegration" time="194.578"> | ||
<system-out> | ||
|
||
[[ATTACHMENT|../test-results/cloud-test-pr-integration-PR-integration-featu-1ac6b-R-integration-with-azure-on-cloud-prIntegration-staging/video.webm]] | ||
|
||
[[ATTACHMENT|../test-results/cloud-test-pr-integration-PR-integration-featu-1ac6b-R-integration-with-azure-on-cloud-prIntegration-staging/trace.zip]] | ||
|
||
[[ATTACHMENT|../test-results/cloud-test-pr-integration-PR-integration-featu-1ac6b-R-integration-with-azure-on-cloud-prIntegration-staging/test-finished-1.png]] | ||
|
||
</system-out> | ||
</testcase> | ||
</testsuite> | ||
<testsuite name="cloud/test-project-architecture.spec.ts" timestamp="1655667311825" hostname="" tests="1" failures="0" skipped="1" time="0" errors="0"> | ||
<testcase name="Architectural components Generate architectural components on @cloud" classname="[staging] › cloud/test-project-architecture.spec.ts:15:8 › Architectural components › Generate architectural components on @cloud" time="0"> | ||
<skipped> | ||
</skipped> | ||
</testcase> | ||
</testsuite> | ||
</testsuites> |
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,20 @@ | ||
import ResultsParser from './results-parser'; | ||
import SlackMessage from './slack-message'; | ||
import ActionInfo from './action-info'; | ||
|
||
jest.mock('./action-info') | ||
|
||
test('blocks created OK for OK results', async () => { | ||
const result = new ResultsParser('results.xml'); | ||
await result.parse(); | ||
const blocks = new SlackMessage(undefined).getBlocks(result, new ActionInfo()); | ||
expect(blocks).toContain(":large_green_circle"); | ||
}) | ||
|
||
test('blocks created OK for unknown results', async () => { | ||
const blocks = new SlackMessage(new ResultsParser('foo.xml')).getUnknownBlocks(new ActionInfo()); | ||
expect(blocks).toContain(":Question: *UNKNOWN RESULT:*"); | ||
}) | ||
|
||
|
||
|
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,6 @@ | ||
module.exports = { | ||
presets: [ | ||
['@babel/preset-env', {targets: {node: 'current'}}], | ||
'@babel/preset-typescript', | ||
], | ||
}; |
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
Oops, something went wrong.