infra: simplify test results collection (#3623)

This commit is contained in:
Pavel Feldman 2020-08-25 15:46:42 -07:00 committed by GitHub
parent 17077fd901
commit adc2a44113
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 65 deletions

View File

@ -41,23 +41,13 @@ jobs:
env:
BROWSER: ${{ matrix.browser }}
DEBUG: "pw:*,-pw:wrapped*,-pw:test*"
DEBUG_FILE: "testrun.log"
PWRUNNER_JSON_REPORT: "test-results.json"
DEBUG_FILE: "test-results/debug.log"
PWRUNNER_JSON_REPORT: "test-results/report.json"
- uses: actions/upload-artifact@v1
if: failure()
if: always()
with:
name: ${{ matrix.browser }}-${{ matrix.os }}-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:
name: "macOS"
@ -78,23 +68,13 @@ jobs:
env:
BROWSER: ${{ matrix.browser }}
DEBUG: "pw:*,-pw:wrapped*,-pw:test*"
DEBUG_FILE: "testrun.log"
PWRUNNER_JSON_REPORT: "test-results.json"
DEBUG_FILE: "test-results/debug.log"
PWRUNNER_JSON_REPORT: "test-results/report.json"
- uses: actions/upload-artifact@v1
if: failure()
if: ${{ always() }}
with:
name: ${{ matrix.browser }}-mac-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:
name: "Windows"
@ -119,23 +99,13 @@ jobs:
env:
BROWSER: ${{ matrix.browser }}
DEBUG: "pw:*,-pw:wrapped*,-pw:test*"
DEBUG_FILE: "testrun.log"
PWRUNNER_JSON_REPORT: "test-results.json"
DEBUG_FILE: "test-results/debug.log"
PWRUNNER_JSON_REPORT: "test-results/report.json"
- uses: actions/upload-artifact@v1
if: failure()
if: ${{ always() }}
with:
name: ${{ matrix.browser }}-win-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:
runs-on: ubuntu-latest
@ -182,23 +152,13 @@ jobs:
env:
BROWSER: ${{ matrix.browser }}
HEADLESS: "false"
DEBUG_FILE: "testrun.log"
PWRUNNER_JSON_REPORT: "test-results.json"
DEBUG_FILE: "test-results/debug.log"
PWRUNNER_JSON_REPORT: "test-results/report.json"
- uses: actions/upload-artifact@v1
if: failure()
if: ${{ always() }}
with:
name: headful-${{ matrix.browser }}-linux-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:
name: "Wire Linux"
@ -225,21 +185,11 @@ jobs:
env:
BROWSER: ${{ matrix.browser }}
DEBUG: "pw:*,-pw:wrapped*,-pw:test*"
DEBUG_FILE: "testrun.log"
DEBUG_FILE: "test-results/debug.log"
PWWIRE: true
PWRUNNER_JSON_REPORT: "test-results.json"
PWRUNNER_JSON_REPORT: "test-results/report.json"
- uses: actions/upload-artifact@v1
if: failure()
if: ${{ always() }}
with:
name: wire-${{ matrix.browser }}-linux-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

View File

@ -16,6 +16,7 @@
import * as debug from 'debug';
import * as fs from 'fs';
import * as path from 'path';
const debugLoggerColorMap = {
'api': 45, // cyan
@ -33,6 +34,7 @@ class DebugLogger {
constructor() {
if (process.env.DEBUG_FILE) {
fs.mkdirSync(path.dirname(process.env.DEBUG_FILE), { recursive: true });
const ansiRegex = new RegExp([
'[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)',
'(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))'