Unverified Commit 859605a5 authored by Tim Neutkens's avatar Tim Neutkens Committed by GitHub

Add reporting of turbopack-dev-examples-manifest.json (#63521)

## What?

Adds a manifest to track which examples have been checked with `next dev
--turbo` and reports it to areweturboyet.com

<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

- Run `pnpm prettier-fix` to fix formatting issues before opening the
PR.
- Read the Docs Contribution Guide to ensure your contribution follows
the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

### Adding or Updating Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->


Closes NEXT-2878
parent 1c998d86
......@@ -3,17 +3,46 @@ const path = require('path')
const { createClient } = require('@vercel/kv')
async function collectExamplesResult(manifestFile) {
const file = path.join(process.cwd(), manifestFile)
const contents = await fs.readFile(file, 'utf-8')
const results = JSON.parse(contents)
let failingCount = 0
let passingCount = 0
const currentDate = new Date()
const isoString = currentDate.toISOString()
const timestamp = isoString.slice(0, 19).replace('T', ' ')
for (const isPassing of Object.values(results)) {
if (isPassing) {
passingCount += 1
} else {
failingCount += 1
}
}
const status = `${process.env.GITHUB_SHA}\t${timestamp}\t${passingCount}/${
passingCount + failingCount
}`
return {
status,
// Uses JSON.stringify to create minified JSON, otherwise whitespace is preserved.
data: JSON.stringify(results),
}
}
async function collectResults(manifestFile) {
const file = path.join(process.cwd(), manifestFile)
const contents = await fs.readFile(file, 'utf-8')
const results = JSON.parse(contents)
let passingTests = ''
let failingTests = ''
let passCount = 0
let failCount = 0
const contents = await fs.readFile(file, 'utf-8')
const results = JSON.parse(contents)
const currentDate = new Date()
const isoString = currentDate.toISOString()
const timestamp = isoString.slice(0, 19).replace('T', ' ')
......@@ -110,10 +139,12 @@ async function main() {
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({
url: process.env.TURBOYET_KV_REST_API_URL,
......@@ -126,8 +157,12 @@ async function main() {
console.log('TEST RESULT PRODUCTION')
console.log(productionResult.testRun)
console.log('EXAMPLES RESULT')
console.log(developmentExamplesResult.status)
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)
......@@ -137,6 +172,9 @@ async function main() {
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) {
console.log(error)
}
......
......@@ -203,4 +203,4 @@ jobs:
DD_ENV: 'ci'
run: |
# We'll tag this to the "Turbopack" datadog service, not "nextjs"
npx @datadog/datadog-ci@2.23.1 junit upload --tags test.type:turbopack-build.daily --service Turbopack ./test/reports
npx @datadog/datadog-ci@2.23.1 junit upload --tags test.type:turbopack-build.daily --service Turbopack-build ./test/reports
{
"active-class-name": true,
"amp": false,
"analyze-bundles": true,
"api-routes": true,
"api-routes-apollo-server": true,
"api-routes-apollo-server-and-client": true,
"api-routes-apollo-server-and-client-auth": true,
"api-routes-cors": true,
"api-routes-graphql": true,
"api-routes-middleware": true,
"api-routes-rate-limit": true,
"api-routes-rest": true,
"app-dir-i18n-routing": true,
"app-dir-mdx": true,
"auth": true,
"auth-with-stytch": true,
"auth0": true,
"basic-css": true,
"basic-export": true,
"blog-starter": true,
"blog-with-comment": true,
"cache-handler-redis": true,
"catch-all-routes": true,
"cloudflare-turnstile": true,
"cms-agilitycms": true,
"cms-builder-io": true,
"cms-buttercms": true,
"cms-contentful": true,
"cms-cosmic": true,
"cms-datocms": true,
"cms-drupal": true,
"cms-enterspeed": true,
"cms-ghost": true,
"cms-graphcms": true,
"cms-keystonejs-embedded": true,
"cms-kontent-ai": true,
"cms-makeswift": true,
"cms-plasmic": true,
"cms-prepr": true,
"cms-prismic": true,
"cms-sanity": true,
"cms-sitefinity": true,
"cms-storyblok": true,
"cms-tina": true,
"cms-umbraco-heartcore": true,
"cms-webiny": true,
"cms-wordpress": true,
"convex": true,
"custom-routes-proxying": true,
"dynamic-routing": true,
"environment-variables": true,
"github-pages": true,
"head-elements": true,
"headers": true,
"hello-world": true,
"i18n-routing": true,
"image-component": true,
"image-legacy-component": true,
"inngest": true,
"layout-component": true,
"middleware": true,
"middleware-matcher": true,
"modularize-imports": true,
"nested-components": true,
"next-css": true,
"next-offline": true,
"panda-css": true,
"progressive-web-app": true,
"radix-ui": true,
"redirects": true,
"reproduction-template": true,
"reproduction-template-pages": true,
"rewrites": true,
"script-component": true,
"server-actions-upload": true,
"ssr-caching": true,
"svg-components": true,
"with-ably": true,
"with-absolute-imports": true,
"with-algolia-react-instantsearch": true,
"with-ant-design": true,
"with-apivideo": true,
"with-apollo": true,
"with-apollo-and-redux": true,
"with-axiom": true,
"with-azure-cosmos": true,
"with-chakra-ui": true,
"with-clerk": true,
"with-cloudinary": true,
"with-context-api": true,
"with-cookies-next": true,
"with-cxs": true,
"with-cypress": true,
"with-docker": true,
"with-docker-compose": true,
"with-docker-multi-env": true,
"with-draft-js": true,
"with-dynamic-import": true,
"with-elasticsearch": true,
"with-electron": true,
"with-electron-typescript": true,
"with-emotion-swc": true,
"with-eslint": true,
"with-facebook-pixel": true,
"with-fauna": true,
"with-fela": true,
"with-fingerprintjs-pro": true,
"with-firebase": true,
"with-firebase-cloud-messaging": true,
"with-firebase-hosting": true,
"with-formspree": true,
"with-framer-motion": true,
"with-goober": true,
"with-google-analytics": true,
"with-google-maps-embed": true,
"with-grafbase": true,
"with-graphql-gateway": true,
"with-graphql-hooks": true,
"with-graphql-react": true,
"with-gsap": true,
"with-hls-js": true,
"with-http2": true,
"with-i18n-next-intl": true,
"with-i18n-rosetta": true,
"with-ionic-typescript": true,
"with-iron-session": true,
"with-jest": true,
"with-jest-babel": true,
"with-joi": true,
"with-jotai": true,
"with-knex": false,
"with-magic": true,
"with-mantine": true,
"with-mdbreact": true,
"with-mdx-remote": true,
"with-mobx": true,
"with-mobx-state-tree": true,
"with-mongodb": true,
"with-mongodb-mongoose": true,
"with-mqtt-js": true,
"with-msw": true,
"with-mux-video": true,
"with-mysql": true,
"with-neo4j": true,
"with-next-page-transitions": true,
"with-next-sass": true,
"with-next-seo": true,
"with-next-sitemap": true,
"with-next-ui": true,
"with-nhost-auth-realtime-graphql": true,
"with-opentelemetry": true,
"with-overmind": true,
"with-particles": true,
"with-passport": true,
"with-passport-and-next-connect": true,
"with-paste-typescript": true,
"with-plausible": true,
"with-playwright": true,
"with-polyfills": true,
"with-portals": true,
"with-portals-ssr": true,
"with-postgres": true,
"with-prefetching": true,
"with-quill-js": true,
"with-rbx-bulma-pro": true,
"with-react-bootstrap": true,
"with-react-foundation": true,
"with-react-ga4": true,
"with-react-hook-form": true,
"with-react-jss": true,
"with-react-md-typescript": true,
"with-react-multi-carousel": true,
"with-react-toolbox": true,
"with-react-with-styles": true,
"with-reactstrap": true,
"with-realm-web": true,
"with-reasonml-todo": true,
"with-rebass": true,
"with-recoil": true,
"with-redis": true,
"with-redux": true,
"with-reflexjs": true,
"with-reflux": true,
"with-rematch": true,
"with-route-as-modal": true,
"with-segment-analytics": true,
"with-segment-analytics-pages-router": true,
"with-semantic-ui": true,
"with-sentry": true,
"with-service-worker": true,
"with-sfcc": true,
"with-shallow-routing": true,
"with-sitemap": true,
"with-slate": true,
"with-static-export": true,
"with-stencil": true,
"with-stitches": true,
"with-storybook": true,
"with-strict-csp": true,
"with-stripe-typescript": true,
"with-styled-components": true,
"with-styled-components-rtl": true,
"with-styled-jsx": true,
"with-styletron": true,
"with-supabase": true,
"with-supertokens": true,
"with-three-js": true,
"with-tigris": true,
"with-turbopack": true,
"with-turbopack-loaders": true,
"with-typescript": true,
"with-typescript-graphql": true,
"with-typescript-types": true,
"with-unsplash": true,
"with-unstated": true,
"with-urql": true,
"with-userbase": true,
"with-vercel-fetch": true,
"with-videojs": true,
"with-vitest": true,
"with-web-worker": true,
"with-webassembly": true,
"with-xata": true,
"with-xstate": true,
"with-yarn-workspaces": true,
"with-yoga": true,
"with-youtube-embed": true,
"with-zones": true,
"with-zustand": true
}
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