Skip to content

Commit

Permalink
Update to track test timings separate for Azure and Actions (vercel#1…
Browse files Browse the repository at this point in the history
…2083)

* Update to track test timings separate for Azure and Actions

* Add azure test flag
  • Loading branch information
ijjk authored Apr 21, 2020
1 parent 07b24e6 commit d00180b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,5 @@ jobs:
displayName: 'Install dependencies'
- script: |
node run-tests.js -g $(group) --timings
node run-tests.js -g $(group) --timings --azure
displayName: 'Run tests'
10 changes: 8 additions & 2 deletions run-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const TIMINGS_API = `https://next-timings.jjsweb.site/api/timings`
parseInt(process.argv[concurrencyIdx + 1], 10) || DEFAULT_CONCURRENCY

const outputTimings = process.argv.indexOf('--timings') !== -1
const isAzure = process.argv.indexOf('--azure') !== -1
const groupIdx = process.argv.indexOf('-g')
const groupArg = groupIdx !== -1 && process.argv[groupIdx + 1]

Expand All @@ -38,7 +39,9 @@ const TIMINGS_API = `https://next-timings.jjsweb.site/api/timings`
if (outputTimings && groupArg) {
console.log('Fetching previous timings data')
try {
const timingsRes = await fetch(TIMINGS_API)
const timingsRes = await fetch(
`${TIMINGS_API}?which=${isAzure ? 'azure' : 'actions'}`
)

if (!timingsRes.ok) {
throw new Error(`request status: ${timingsRes.status}`)
Expand Down Expand Up @@ -237,7 +240,10 @@ const TIMINGS_API = `https://next-timings.jjsweb.site/api/timings`
headers: {
'content-type': 'application/json',
},
body: JSON.stringify({ timings: curTimings }),
body: JSON.stringify({
timings: curTimings,
which: isAzure ? 'azure' : 'actions',
}),
})

if (!timingsRes.ok) {
Expand Down

0 comments on commit d00180b

Please sign in to comment.