another test

This commit is contained in:
Liam DeBeasi
2023-05-19 11:04:35 -04:00
parent bd878f0349
commit d49e974203
4 changed files with 1085 additions and 8 deletions

View File

@ -18,12 +18,20 @@ runs:
find . -type f -name 'TestReport-*.zip' -exec unzip -q -o -d ../ {} \;
shell: bash
working-directory: ./artifacts
- name: test
run: ls && cd test-report-1-20 && ls
shell: bash
- name: Build Reporter
run: npm ci && npm run build
shell: bash
working-directory: ./core/test-reporter
- name: Generate Report
run: node dist/index.js ../../../test-report-*/*.json
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO_NAME: ${{ github.repository.repo }}
OWNER: ${{ github.repository.owner }}
ISSUE_NUMBER: ${{ github.event.number }}
shell: bash
working-directory: ./core/test-reporter
- uses: actions/github-script@v6

File diff suppressed because it is too large Load Diff

View File

@ -15,6 +15,7 @@
"typescript": "^5.0.4"
},
"dependencies": {
"glob": "^10.2.5"
"glob": "^10.2.5",
"octokit": "^2.0.16"
}
}

View File

@ -1,7 +1,12 @@
import { glob } from 'glob';
import * as fs from 'fs/promises';
import { Octokit } from 'octokit';
import type { PlaywrightTest, PlaywrightSpec, PlaywrightSuite, PlaywrightResults, FlakySuite, FlakySpec } from './types';
const octokit = new Octokit({ auth: process.env.GITHUB_TOKEN });
console.log(process.env.REPO_NAME, process.env.OWNER, process.env.ISSUE_NUMBER);
/**
* Find all of the flaky files within a
* single Playwright report.
@ -60,7 +65,7 @@ const findFlakyTestsInSpec = (spec: PlaywrightSpec, title: string): FlakySpec =>
const generateReport = async () => {
const files = await glob(__dirname + '/' + process.argv[2]);
console.log('got files',files, __dirname, process.argv[2])
console.log('got files',files, __dirname + '/' + process.argv[2])
const flakyDict = {}
let flakyFiles = [];
@ -82,7 +87,9 @@ console.log('got files',files, __dirname, process.argv[2])
console.log('done processing, generating table')
return generateTable(flakyDict);
const table = generateTable(flakyDict);
console.log('generated table, posting comment to PR')
}