| 4 | import { coderdPProfPort } from "./constants"; |
| 5 | |
| 6 | class CoderReporter implements Reporter { |
| 7 | async onTestEnd(test: TestCase, result: TestResult) { |
| 8 | if (test.expectedStatus === "skipped") { |
| 9 | return; |
| 10 | } |
| 11 | |
| 12 | if (result.status === "passed") { |
| 13 | return; |
| 14 | } |
| 15 | |
| 16 | const fsTestTitle = test.title.replaceAll(" ", "-"); |
| 17 | const outputFile = `test-results/debug-pprof-goroutine-${fsTestTitle}.txt`; |
| 18 | await exportDebugPprof(outputFile); |
| 19 | |
| 20 | console.info(`Data from pprof has been saved to ${outputFile}`); |
| 21 | console.info("==> Output"); |
| 22 | } |
| 23 | } |
| 24 | |
| 25 | const exportDebugPprof = async (outputFile: string) => { |
| 26 | const axiosInstance = API.getAxiosInstance(); |
nothing calls this directly
no outgoing calls
no test coverage detected