devops: fix self-hosted runner stack collection (#11169)

In case of self-hosted github runners, it's much easier to checkout
under `playwright-internal` folder name instead of a default
`playwright` name. This confuses our stack collection.

This patch makes it generic.
This commit is contained in:
Andrey Lushnikov 2022-01-04 07:23:28 -07:00 committed by GitHub
parent 0332b2a7a9
commit 13dd41c2e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -37,6 +37,7 @@ const UTIL_LIB = path.join(CORE_DIR, 'lib', 'util');
const UTIL_SRC = path.join(CORE_DIR, 'src', 'util');
const TEST_DIR_SRC = path.resolve(CORE_DIR, '..', 'playwright-test');
const TEST_DIR_LIB = path.resolve(CORE_DIR, '..', '@playwright', 'test');
const COVERAGE_PATH = path.join(CORE_DIR, '..', '..', 'tests', 'config', 'coverage.js');
const WS_LIB = path.relative(process.cwd(), path.dirname(require.resolve('ws')));
export type ParsedStackTrace = {
@ -85,7 +86,7 @@ export function captureStackTrace(rawStack?: string): ParsedStackTrace {
fileName = new URL(frame.file).pathname;
else
fileName = path.resolve(process.cwd(), frame.file);
if (isTesting && fileName.includes(path.join('playwright', 'tests', 'config', 'coverage.js')))
if (isTesting && fileName.includes(COVERAGE_PATH))
return null;
const inClient = fileName.startsWith(CLIENT_LIB) || fileName.startsWith(CLIENT_SRC) || fileName.startsWith(UTIL_LIB) || fileName.startsWith(UTIL_SRC);
const parsed: ParsedFrame = {