Skip to content

Commit bfc26e2

Browse files
authored
Adding daily build and test status to readme and publish test reports and coverage (#17957)
* Adding daily test * fixing space * fixing space * removing npm fund * remove gulp install * switching to different action * adding permission to write checks * switch to junit in playwright * Fixing reporter * Adding badges and fixing badge title * Adding code coverage * remove publish action * fixing path * Adding coverage step * switching to xml * fixing stuff * Adding check run for coverage * Fixing summary object
1 parent 2894971 commit bfc26e2

File tree

5 files changed

+48
-27
lines changed

5 files changed

+48
-27
lines changed

.github/workflows/daily-build-and-test.yml

+45-11
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ on:
44
schedule:
55
- cron: '0 0 * * *'
66
workflow_dispatch:
7+
permissions:
8+
contents: read
9+
actions: read
10+
checks: write
711

812
jobs:
913
build-and-test:
@@ -37,8 +41,6 @@ jobs:
3741
npm install --global [email protected]
3842
echo "Installing gulp"
3943
npm install --global [email protected]
40-
npm install gulp
41-
npm link gulp
4244
4345
- name: Install extension dependencies
4446
run: |
@@ -60,12 +62,42 @@ jobs:
6062
run: |
6163
DISPLAY=:10 yarn test --coverage --log
6264
63-
- name: Publish test
64-
uses: EnricoMi/publish-unit-test-result-action@v2
65+
- name: Unit Test Report
66+
uses: dorny/test-reporter@v1
67+
if: success() || failure()
68+
with:
69+
name: 'Unit Test'
70+
path: ./test-reports/**/*.xml
71+
reporter: jest-junit
72+
badge-title: 'unit-tests'
73+
74+
- name: Generate Code Coverage Report
75+
id: testcoverage
76+
run: |
77+
yarn gulp cover
78+
79+
- name: Code Coverage Report
80+
uses: irongut/[email protected]
81+
with:
82+
filename: ./coverage/cobertura-coverage.xml
83+
badge: true
84+
fail_below_min: true
85+
format: markdown
86+
hide_branch_rate: false
87+
hide_complexity: true
88+
indicators: true
89+
output: both
90+
91+
- name: Create a check run for code coverage
92+
uses: LouisBrunner/[email protected]
6593
if: always()
6694
with:
67-
files: |
68-
./test-reports/**/*.xml
95+
token: ${{ secrets.GITHUB_TOKEN }}
96+
name: Coverage
97+
conclusion: ${{ steps.testcoverage.conclusion }}
98+
output: |
99+
{"summary":"${{ steps.testcoverage.summary }}"}
100+
output_text_description_file: ./code-coverage-results.md
69101

70102
- name: Setup environment for smoke tests
71103
run: |
@@ -97,12 +129,14 @@ jobs:
97129
PROFILE_NAME=test-server
98130
DISPLAY=:10 yarn smoketest
99131
100-
- name: Publish smoke test
101-
uses: EnricoMi/publish-unit-test-result-action@v2
102-
if: always()
132+
- name: Smoke Test Report
133+
uses: dorny/test-reporter@v1
134+
if: success() || failure()
103135
with:
104-
files: |
105-
./test-reports/**/*.trx
136+
name: 'Smoke Test'
137+
path: ./test-reports/**/smoke-results.xml
138+
reporter: jest-junit
139+
badge-title: 'smoke-tests'
106140

107141

108142

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![Build Status](https://mssqltools.visualstudio.com/CrossPlatBuildScripts/_apis/build/status/VSCode-MSSQL?branchName=main)](https://mssqltools.visualstudio.com/CrossPlatBuildScripts/_build/latest?definitionId=70&branchName=main)
1+
[![Daily Build and Test](https://github.com/microsoft/vscode-mssql/actions/workflows/daily-build-and-test.yml/badge.svg?branch=main&event=schedule)](https://github.com/microsoft/vscode-mssql/actions/workflows/daily-build-and-test.yml)
22
[![Gitter](https://img.shields.io/badge/chat-on%20gitter-blue.svg)](https://gitter.im/Microsoft/mssql)
33

44

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@
119119
"husky": "^9.0.11",
120120
"istanbul": "^0.4.5",
121121
"npm-run-all": "^4.1.5",
122-
"playwright-trx-reporter": "^1.0.8",
123122
"pm-mocha-jenkins-reporter": "^0.2.6",
124123
"remap-istanbul": "0.9.6",
125124
"rxjs": "5.0.0-beta.12",

playwright.config.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ export default defineConfig({
2929
/* Opt out of parallel tests on CI. */
3030
workers: 1,
3131
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
32-
reporter: [['playwright-trx-reporter', {
33-
outputFile: './test-reports/smoke-results.trx',
32+
reporter: [['junit', {
33+
outputFile: './test-reports/smoke-results.xml',
3434
}]],
3535
/* Set timeout to 5 minutes */
3636
timeout: 5 * 60 * 1000,

yarn.lock

-12
Original file line numberDiff line numberDiff line change
@@ -7840,13 +7840,6 @@ [email protected]:
78407840
resolved "https://registry.yarnpkg.com/playwright-core/-/playwright-core-1.45.0.tgz#5741a670b7c9060ce06852c0051d84736fb94edc"
78417841
integrity sha512-lZmHlFQ0VYSpAs43dRq1/nJ9G/6SiTI7VPqidld9TDefL9tX87bTKExWZZUF5PeRyqtXqd8fQi2qmfIedkwsNQ==
78427842

7843-
playwright-trx-reporter@^1.0.8:
7844-
version "1.0.8"
7845-
resolved "https://registry.yarnpkg.com/playwright-trx-reporter/-/playwright-trx-reporter-1.0.8.tgz#3bc5a28eb432f5b5c132716aab7ae9a487defd63"
7846-
integrity sha512-Pufi7jWWc43X4wnx436dgxyoSkN2ZmzbIGzPIXl1MVgq2sdRW9CGaECe/7kpUwjJXDfbZ7WkbM6yWVq8tSnocg==
7847-
dependencies:
7848-
uuid "^9.0.0"
7849-
78507843
78517844
version "1.45.0"
78527845
resolved "https://registry.yarnpkg.com/playwright/-/playwright-1.45.0.tgz#400c709c64438690f13705cb9c88ef93089c5c27"
@@ -10021,11 +10014,6 @@ uuid@^8.3.0:
1002110014
resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2"
1002210015
integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==
1002310016

10024-
uuid@^9.0.0:
10025-
version "9.0.1"
10026-
resolved "https://registry.yarnpkg.com/uuid/-/uuid-9.0.1.tgz#e188d4c8853cc722220392c424cd637f32293f30"
10027-
integrity sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==
10028-
1002910017
v8flags@^3.2.0:
1003010018
version "3.2.0"
1003110019
resolved "https://registry.yarnpkg.com/v8flags/-/v8flags-3.2.0.tgz#b243e3b4dfd731fa774e7492128109a0fe66d656"

0 commit comments

Comments
 (0)