diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 0b6812d6..a493fd5b 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -18,4 +18,7 @@ jobs: run: yarn - name: Test run: yarn test - + - uses: actions/upload-artifact@v3 + with: + name: test-logs + path: test-logs/ diff --git a/.gitignore b/.gitignore index 45918396..360c3f9a 100644 --- a/.gitignore +++ b/.gitignore @@ -4,5 +4,6 @@ node_modules /build/ /dist/ /test-reports/ +/test-logs/ *.tgz yarn-error.log diff --git a/src/integration-tests/utils.ts b/src/integration-tests/utils.ts index 0db4ed8e..1469a1bd 100644 --- a/src/integration-tests/utils.ts +++ b/src/integration-tests/utils.ts @@ -225,6 +225,7 @@ export function fillDefaults( } const args = argsIn !== undefined ? argsIn : ({} as RequestArguments); args.verbose = true; + args.logFile = logFileName(test); args.gdb = gdbPath; args.openGdbConsole = openGdbConsole; args.gdbAsync = gdbAsync; @@ -276,6 +277,12 @@ beforeEach(function () { } }); +export function logFileName(test: Runnable): string { + // Clean up characters that GitHub actions doesn't like in filenames + const cleaned = test.fullTitle().replace('>', '>').replace('<', '<'); + return `${process.cwd()}/test-logs/${cleaned}.log`; +} + function getGdbPathCli(): string | undefined { const keyIndex = process.argv.indexOf('--gdb-path'); if (keyIndex === -1) {