Unverified Commit 88601928 authored by Benjamin Woodruff's avatar Benjamin Woodruff Committed by GitHub

feat(turboyet): Upload test data for both bundlers (#76090)

Tested by commenting out the turbopack upload bits (since I don't want to risk messing up that dataset) and running:

```
TURBOYET_KV_REST_API_TOKEN="..." TURBOYET_KV_REST_API_URL="..." node .github/actions/upload-turboyet-data/dist/index.js
```

I got the API token from the areweturboyet deployment in the vercel dashboard.

I think it's fine and easiest to just use the same KV database for both bundlers with different key prefixes.
parent 16523bab
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -134,47 +134,65 @@ async function collectResults(manifestFile) { ...@@ -134,47 +134,65 @@ async function collectResults(manifestFile) {
} }
} }
async function collectAndUpload(kv, { jsonPrefix, kvPrefix }) {
const developmentResult = await collectResults(
`test/${jsonPrefix}dev-tests-manifest.json`
)
const productionResult = await collectResults(
`test/${jsonPrefix}build-tests-manifest.json`
)
const developmentExamplesResult = await collectExamplesResult(
`test/${jsonPrefix}dev-examples-manifest.json`
)
console.log('TEST RESULT DEVELOPMENT')
console.log(developmentResult.testRun)
console.log('TEST RESULT PRODUCTION')
console.log(productionResult.testRun)
console.log('EXAMPLES RESULT')
console.log(developmentExamplesResult.status)
await kv.rpush(`${kvPrefix}test-runs`, developmentResult.testRun)
await kv.rpush(`${kvPrefix}test-runs-production`, productionResult.testRun)
await kv.rpush(`${kvPrefix}examples-runs`, developmentExamplesResult.status)
console.log('SUCCESSFULLY SAVED RUNS')
await kv.set(`${kvPrefix}passing-tests`, developmentResult.passingTests)
await kv.set(
`${kvPrefix}passing-tests-production`,
productionResult.passingTests
)
console.log('SUCCESSFULLY SAVED PASSING')
await kv.set(`${kvPrefix}failing-tests`, developmentResult.failingTests)
await kv.set(
`${kvPrefix}failing-tests-production`,
productionResult.failingTests
)
console.log('SUCCESSFULLY SAVED FAILING')
await kv.set(`${kvPrefix}examples-data`, developmentExamplesResult.data)
console.log('SUCCESSFULLY SAVED EXAMPLES')
}
async function main() { async function main() {
try { try {
const developmentResult = await collectResults(
'test/turbopack-dev-tests-manifest.json'
)
const productionResult = await collectResults(
'test/turbopack-build-tests-manifest.json'
)
const developmentExamplesResult = await collectExamplesResult(
'test/turbopack-dev-examples-manifest.json'
)
const kv = createClient({ const kv = createClient({
url: process.env.TURBOYET_KV_REST_API_URL, url: process.env.TURBOYET_KV_REST_API_URL,
token: process.env.TURBOYET_KV_REST_API_TOKEN, token: process.env.TURBOYET_KV_REST_API_TOKEN,
}) })
console.log('### UPLOADING TURBOPACK DATA')
console.log('TEST RESULT DEVELOPMENT') await collectAndUpload(kv, {
console.log(developmentResult.testRun) jsonPrefix: 'turbopack-',
kvPrefix: '',
console.log('TEST RESULT PRODUCTION') })
console.log(productionResult.testRun) console.log('### UPLOADING RSPACK DATA')
await collectAndUpload(kv, {
console.log('EXAMPLES RESULT') jsonPrefix: 'rspack-',
console.log(developmentExamplesResult.status) kvPrefix: 'rspack-',
})
await kv.rpush('test-runs', developmentResult.testRun)
await kv.rpush('test-runs-production', productionResult.testRun)
await kv.rpush('examples-runs', developmentExamplesResult.status)
console.log('SUCCESSFULLY SAVED RUNS')
await kv.set('passing-tests', developmentResult.passingTests)
await kv.set('passing-tests-production', productionResult.passingTests)
console.log('SUCCESSFULLY SAVED PASSING')
await kv.set('failing-tests', developmentResult.failingTests)
await kv.set('failing-tests-production', productionResult.failingTests)
console.log('SUCCESSFULLY SAVED FAILING')
await kv.set('examples-data', developmentExamplesResult.data)
console.log('SUCCESSFULLY SAVED EXAMPLES')
} catch (error) { } catch (error) {
console.log(error) console.log(error)
} }
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment