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,23 +134,17 @@ async function collectResults(manifestFile) { ...@@ -134,23 +134,17 @@ async function collectResults(manifestFile) {
} }
} }
async function main() { async function collectAndUpload(kv, { jsonPrefix, kvPrefix }) {
try {
const developmentResult = await collectResults( const developmentResult = await collectResults(
'test/turbopack-dev-tests-manifest.json' `test/${jsonPrefix}dev-tests-manifest.json`
) )
const productionResult = await collectResults( const productionResult = await collectResults(
'test/turbopack-build-tests-manifest.json' `test/${jsonPrefix}build-tests-manifest.json`
) )
const developmentExamplesResult = await collectExamplesResult( const developmentExamplesResult = await collectExamplesResult(
'test/turbopack-dev-examples-manifest.json' `test/${jsonPrefix}dev-examples-manifest.json`
) )
const kv = createClient({
url: process.env.TURBOYET_KV_REST_API_URL,
token: process.env.TURBOYET_KV_REST_API_TOKEN,
})
console.log('TEST RESULT DEVELOPMENT') console.log('TEST RESULT DEVELOPMENT')
console.log(developmentResult.testRun) console.log(developmentResult.testRun)
...@@ -160,21 +154,45 @@ async function main() { ...@@ -160,21 +154,45 @@ async function main() {
console.log('EXAMPLES RESULT') console.log('EXAMPLES RESULT')
console.log(developmentExamplesResult.status) console.log(developmentExamplesResult.status)
await kv.rpush('test-runs', developmentResult.testRun) await kv.rpush(`${kvPrefix}test-runs`, developmentResult.testRun)
await kv.rpush('test-runs-production', productionResult.testRun) await kv.rpush(`${kvPrefix}test-runs-production`, productionResult.testRun)
await kv.rpush('examples-runs', developmentExamplesResult.status) await kv.rpush(`${kvPrefix}examples-runs`, developmentExamplesResult.status)
console.log('SUCCESSFULLY SAVED RUNS') console.log('SUCCESSFULLY SAVED RUNS')
await kv.set('passing-tests', developmentResult.passingTests) await kv.set(`${kvPrefix}passing-tests`, developmentResult.passingTests)
await kv.set('passing-tests-production', productionResult.passingTests) await kv.set(
`${kvPrefix}passing-tests-production`,
productionResult.passingTests
)
console.log('SUCCESSFULLY SAVED PASSING') console.log('SUCCESSFULLY SAVED PASSING')
await kv.set('failing-tests', developmentResult.failingTests) await kv.set(`${kvPrefix}failing-tests`, developmentResult.failingTests)
await kv.set('failing-tests-production', productionResult.failingTests) await kv.set(
`${kvPrefix}failing-tests-production`,
productionResult.failingTests
)
console.log('SUCCESSFULLY SAVED FAILING') console.log('SUCCESSFULLY SAVED FAILING')
await kv.set('examples-data', developmentExamplesResult.data) await kv.set(`${kvPrefix}examples-data`, developmentExamplesResult.data)
console.log('SUCCESSFULLY SAVED EXAMPLES') console.log('SUCCESSFULLY SAVED EXAMPLES')
}
async function main() {
try {
const kv = createClient({
url: process.env.TURBOYET_KV_REST_API_URL,
token: process.env.TURBOYET_KV_REST_API_TOKEN,
})
console.log('### UPLOADING TURBOPACK DATA')
await collectAndUpload(kv, {
jsonPrefix: 'turbopack-',
kvPrefix: '',
})
console.log('### UPLOADING RSPACK DATA')
await collectAndUpload(kv, {
jsonPrefix: 'rspack-',
kvPrefix: 'rspack-',
})
} 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