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
This commit is contained in:
Aasim Khan 2024-08-01 16:38:46 -07:00 коммит произвёл GitHub
Родитель 28949715ce
Коммит bfc26e2c62
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
5 изменённых файлов: 48 добавлений и 27 удалений

56
.github/workflows/daily-build-and-test.yml поставляемый
Просмотреть файл

@ -4,6 +4,10 @@ on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
permissions:
contents: read
actions: read
checks: write
jobs:
build-and-test:
@ -37,8 +41,6 @@ jobs:
npm install --global vsce@2.9.2
echo "Installing gulp"
npm install --global gulp@4.0.2
npm install gulp
npm link gulp
- name: Install extension dependencies
run: |
@ -60,12 +62,42 @@ jobs:
run: |
DISPLAY=:10 yarn test --coverage --log
- name: Publish test
uses: EnricoMi/publish-unit-test-result-action@v2
- name: Unit Test Report
uses: dorny/test-reporter@v1
if: success() || failure()
with:
name: 'Unit Test'
path: ./test-reports/**/*.xml
reporter: jest-junit
badge-title: 'unit-tests'
- name: Generate Code Coverage Report
id: testcoverage
run: |
yarn gulp cover
- name: Code Coverage Report
uses: irongut/CodeCoverageSummary@v1.3.0
with:
filename: ./coverage/cobertura-coverage.xml
badge: true
fail_below_min: true
format: markdown
hide_branch_rate: false
hide_complexity: true
indicators: true
output: both
- name: Create a check run for code coverage
uses: LouisBrunner/checks-action@v2.0.0
if: always()
with:
files: |
./test-reports/**/*.xml
token: ${{ secrets.GITHUB_TOKEN }}
name: Coverage
conclusion: ${{ steps.testcoverage.conclusion }}
output: |
{"summary":"${{ steps.testcoverage.summary }}"}
output_text_description_file: ./code-coverage-results.md
- name: Setup environment for smoke tests
run: |
@ -97,12 +129,14 @@ jobs:
PROFILE_NAME=test-server
DISPLAY=:10 yarn smoketest
- name: Publish smoke test
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
- name: Smoke Test Report
uses: dorny/test-reporter@v1
if: success() || failure()
with:
files: |
./test-reports/**/*.trx
name: 'Smoke Test'
path: ./test-reports/**/smoke-results.xml
reporter: jest-junit
badge-title: 'smoke-tests'

Просмотреть файл

@ -1,4 +1,4 @@
[![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)
[![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)
[![Gitter](https://img.shields.io/badge/chat-on%20gitter-blue.svg)](https://gitter.im/Microsoft/mssql)

Просмотреть файл

@ -119,7 +119,6 @@
"husky": "^9.0.11",
"istanbul": "^0.4.5",
"npm-run-all": "^4.1.5",
"playwright-trx-reporter": "^1.0.8",
"pm-mocha-jenkins-reporter": "^0.2.6",
"remap-istanbul": "0.9.6",
"rxjs": "5.0.0-beta.12",

Просмотреть файл

@ -29,8 +29,8 @@ export default defineConfig({
/* Opt out of parallel tests on CI. */
workers: 1,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: [['playwright-trx-reporter', {
outputFile: './test-reports/smoke-results.trx',
reporter: [['junit', {
outputFile: './test-reports/smoke-results.xml',
}]],
/* Set timeout to 5 minutes */
timeout: 5 * 60 * 1000,

Просмотреть файл

@ -7840,13 +7840,6 @@ playwright-core@1.45.0:
resolved "https://registry.yarnpkg.com/playwright-core/-/playwright-core-1.45.0.tgz#5741a670b7c9060ce06852c0051d84736fb94edc"
integrity sha512-lZmHlFQ0VYSpAs43dRq1/nJ9G/6SiTI7VPqidld9TDefL9tX87bTKExWZZUF5PeRyqtXqd8fQi2qmfIedkwsNQ==
playwright-trx-reporter@^1.0.8:
version "1.0.8"
resolved "https://registry.yarnpkg.com/playwright-trx-reporter/-/playwright-trx-reporter-1.0.8.tgz#3bc5a28eb432f5b5c132716aab7ae9a487defd63"
integrity sha512-Pufi7jWWc43X4wnx436dgxyoSkN2ZmzbIGzPIXl1MVgq2sdRW9CGaECe/7kpUwjJXDfbZ7WkbM6yWVq8tSnocg==
dependencies:
uuid "^9.0.0"
playwright@1.45.0:
version "1.45.0"
resolved "https://registry.yarnpkg.com/playwright/-/playwright-1.45.0.tgz#400c709c64438690f13705cb9c88ef93089c5c27"
@ -10021,11 +10014,6 @@ uuid@^8.3.0:
resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2"
integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==
uuid@^9.0.0:
version "9.0.1"
resolved "https://registry.yarnpkg.com/uuid/-/uuid-9.0.1.tgz#e188d4c8853cc722220392c424cd637f32293f30"
integrity sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==
v8flags@^3.2.0:
version "3.2.0"
resolved "https://registry.yarnpkg.com/v8flags/-/v8flags-3.2.0.tgz#b243e3b4dfd731fa774e7492128109a0fe66d656"