mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
infra: simplify test results collection (#3623)
This commit is contained in:
parent
17077fd901
commit
adc2a44113
80
.github/workflows/tests.yml
vendored
80
.github/workflows/tests.yml
vendored
@ -41,23 +41,13 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
BROWSER: ${{ matrix.browser }}
|
BROWSER: ${{ matrix.browser }}
|
||||||
DEBUG: "pw:*,-pw:wrapped*,-pw:test*"
|
DEBUG: "pw:*,-pw:wrapped*,-pw:test*"
|
||||||
DEBUG_FILE: "testrun.log"
|
DEBUG_FILE: "test-results/debug.log"
|
||||||
PWRUNNER_JSON_REPORT: "test-results.json"
|
PWRUNNER_JSON_REPORT: "test-results/report.json"
|
||||||
- uses: actions/upload-artifact@v1
|
- uses: actions/upload-artifact@v1
|
||||||
if: failure()
|
if: always()
|
||||||
with:
|
with:
|
||||||
name: ${{ matrix.browser }}-${{ matrix.os }}-test-results
|
name: ${{ matrix.browser }}-${{ matrix.os }}-test-results
|
||||||
path: test-results
|
path: test-results
|
||||||
- uses: actions/upload-artifact@v1
|
|
||||||
if: ${{ always() }}
|
|
||||||
with:
|
|
||||||
name: ${{ matrix.browser }}-${{ matrix.os }}-test-results.json
|
|
||||||
path: test-results.json
|
|
||||||
- uses: actions/upload-artifact@v1
|
|
||||||
if: ${{ always() }}
|
|
||||||
with:
|
|
||||||
name: ${{ matrix.browser }}-${{ matrix.os }}-testrun.log
|
|
||||||
path: testrun.log
|
|
||||||
|
|
||||||
test_mac:
|
test_mac:
|
||||||
name: "macOS"
|
name: "macOS"
|
||||||
@ -78,23 +68,13 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
BROWSER: ${{ matrix.browser }}
|
BROWSER: ${{ matrix.browser }}
|
||||||
DEBUG: "pw:*,-pw:wrapped*,-pw:test*"
|
DEBUG: "pw:*,-pw:wrapped*,-pw:test*"
|
||||||
DEBUG_FILE: "testrun.log"
|
DEBUG_FILE: "test-results/debug.log"
|
||||||
PWRUNNER_JSON_REPORT: "test-results.json"
|
PWRUNNER_JSON_REPORT: "test-results/report.json"
|
||||||
- uses: actions/upload-artifact@v1
|
- uses: actions/upload-artifact@v1
|
||||||
if: failure()
|
if: ${{ always() }}
|
||||||
with:
|
with:
|
||||||
name: ${{ matrix.browser }}-mac-test-results
|
name: ${{ matrix.browser }}-mac-test-results
|
||||||
path: test-results
|
path: test-results
|
||||||
- uses: actions/upload-artifact@v1
|
|
||||||
if: ${{ always() }}
|
|
||||||
with:
|
|
||||||
name: ${{ matrix.browser }}-mac-testrun.log
|
|
||||||
path: testrun.log
|
|
||||||
- uses: actions/upload-artifact@v1
|
|
||||||
if: ${{ always() }}
|
|
||||||
with:
|
|
||||||
name: ${{ matrix.browser }}-mac-test-results.json
|
|
||||||
path: test-results.json
|
|
||||||
|
|
||||||
test_win:
|
test_win:
|
||||||
name: "Windows"
|
name: "Windows"
|
||||||
@ -119,23 +99,13 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
BROWSER: ${{ matrix.browser }}
|
BROWSER: ${{ matrix.browser }}
|
||||||
DEBUG: "pw:*,-pw:wrapped*,-pw:test*"
|
DEBUG: "pw:*,-pw:wrapped*,-pw:test*"
|
||||||
DEBUG_FILE: "testrun.log"
|
DEBUG_FILE: "test-results/debug.log"
|
||||||
PWRUNNER_JSON_REPORT: "test-results.json"
|
PWRUNNER_JSON_REPORT: "test-results/report.json"
|
||||||
- uses: actions/upload-artifact@v1
|
- uses: actions/upload-artifact@v1
|
||||||
if: failure()
|
if: ${{ always() }}
|
||||||
with:
|
with:
|
||||||
name: ${{ matrix.browser }}-win-test-results
|
name: ${{ matrix.browser }}-win-test-results
|
||||||
path: test-results
|
path: test-results
|
||||||
- uses: actions/upload-artifact@v1
|
|
||||||
if: ${{ always() }}
|
|
||||||
with:
|
|
||||||
name: ${{ matrix.browser }}-win-testrun.log
|
|
||||||
path: testrun.log
|
|
||||||
- uses: actions/upload-artifact@v1
|
|
||||||
if: ${{ always() }}
|
|
||||||
with:
|
|
||||||
name: ${{ matrix.browser }}-win-test-results.json
|
|
||||||
path: test-results.json
|
|
||||||
|
|
||||||
test-package-installations:
|
test-package-installations:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@ -182,23 +152,13 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
BROWSER: ${{ matrix.browser }}
|
BROWSER: ${{ matrix.browser }}
|
||||||
HEADLESS: "false"
|
HEADLESS: "false"
|
||||||
DEBUG_FILE: "testrun.log"
|
DEBUG_FILE: "test-results/debug.log"
|
||||||
PWRUNNER_JSON_REPORT: "test-results.json"
|
PWRUNNER_JSON_REPORT: "test-results/report.json"
|
||||||
- uses: actions/upload-artifact@v1
|
- uses: actions/upload-artifact@v1
|
||||||
if: failure()
|
if: ${{ always() }}
|
||||||
with:
|
with:
|
||||||
name: headful-${{ matrix.browser }}-linux-test-results
|
name: headful-${{ matrix.browser }}-linux-test-results
|
||||||
path: test-results
|
path: test-results
|
||||||
- uses: actions/upload-artifact@v1
|
|
||||||
if: ${{ always() }}
|
|
||||||
with:
|
|
||||||
name: headful-${{ matrix.browser }}-linux-test-results.json
|
|
||||||
path: test-results.json
|
|
||||||
- uses: actions/upload-artifact@v1
|
|
||||||
if: ${{ always() }}
|
|
||||||
with:
|
|
||||||
name: headful-${{ matrix.browser }}-linux-testrun.log
|
|
||||||
path: testrun.log
|
|
||||||
|
|
||||||
wire_linux:
|
wire_linux:
|
||||||
name: "Wire Linux"
|
name: "Wire Linux"
|
||||||
@ -225,21 +185,11 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
BROWSER: ${{ matrix.browser }}
|
BROWSER: ${{ matrix.browser }}
|
||||||
DEBUG: "pw:*,-pw:wrapped*,-pw:test*"
|
DEBUG: "pw:*,-pw:wrapped*,-pw:test*"
|
||||||
DEBUG_FILE: "testrun.log"
|
DEBUG_FILE: "test-results/debug.log"
|
||||||
PWWIRE: true
|
PWWIRE: true
|
||||||
PWRUNNER_JSON_REPORT: "test-results.json"
|
PWRUNNER_JSON_REPORT: "test-results/report.json"
|
||||||
- uses: actions/upload-artifact@v1
|
- uses: actions/upload-artifact@v1
|
||||||
if: failure()
|
if: ${{ always() }}
|
||||||
with:
|
with:
|
||||||
name: wire-${{ matrix.browser }}-linux-test-results
|
name: wire-${{ matrix.browser }}-linux-test-results
|
||||||
path: test-results
|
path: test-results
|
||||||
- uses: actions/upload-artifact@v1
|
|
||||||
if: ${{ always() }}
|
|
||||||
with:
|
|
||||||
name: wire-${{ matrix.browser }}-linux-test-results.json
|
|
||||||
path: test-results.json
|
|
||||||
- uses: actions/upload-artifact@v1
|
|
||||||
if: ${{ always() }}
|
|
||||||
with:
|
|
||||||
name: wire-${{ matrix.browser }}-linux-testrun.log
|
|
||||||
path: testrun.log
|
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
import * as debug from 'debug';
|
import * as debug from 'debug';
|
||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
|
import * as path from 'path';
|
||||||
|
|
||||||
const debugLoggerColorMap = {
|
const debugLoggerColorMap = {
|
||||||
'api': 45, // cyan
|
'api': 45, // cyan
|
||||||
@ -33,6 +34,7 @@ class DebugLogger {
|
|||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
if (process.env.DEBUG_FILE) {
|
if (process.env.DEBUG_FILE) {
|
||||||
|
fs.mkdirSync(path.dirname(process.env.DEBUG_FILE), { recursive: true });
|
||||||
const ansiRegex = new RegExp([
|
const ansiRegex = new RegExp([
|
||||||
'[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)',
|
'[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)',
|
||||||
'(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))'
|
'(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user