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 ../ {} \; find . -type f -name 'TestReport-*.zip' -exec unzip -q -o -d ../ {} \;
shell: bash shell: bash
working-directory: ./artifacts working-directory: ./artifacts
- name: test
run: ls && cd test-report-1-20 && ls
shell: bash
- name: Build Reporter - name: Build Reporter
run: npm ci && npm run build run: npm ci && npm run build
shell: bash shell: bash
working-directory: ./core/test-reporter working-directory: ./core/test-reporter
- name: Generate Report - name: Generate Report
run: node dist/index.js ../../../test-report-*/*.json 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 shell: bash
working-directory: ./core/test-reporter working-directory: ./core/test-reporter
- uses: actions/github-script@v6 - 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" "typescript": "^5.0.4"
}, },
"dependencies": { "dependencies": {
"glob": "^10.2.5" "glob": "^10.2.5",
"octokit": "^2.0.16"
} }
} }

View File

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