Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/canary' into wbinnssmith/decode-…
Browse files Browse the repository at this point in the history
…source-url
  • Loading branch information
wbinnssmith committed Mar 8, 2024
2 parents 2ae6a3f + a767aa8 commit 4b61d8b
Show file tree
Hide file tree
Showing 65 changed files with 690 additions and 493 deletions.
64 changes: 28 additions & 36 deletions .github/actions/upload-turboyet-data/dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .github/actions/upload-turboyet-data/dist/index.js.map

Large diffs are not rendered by default.

40 changes: 16 additions & 24 deletions .github/actions/upload-turboyet-data/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ const { createClient } = require('@vercel/kv')

async function main() {
try {
const file = path.join(
process.cwd(),
'./test-results/nextjs-test-results.json'
)
const file = path.join(process.cwd(), 'test/turbopack-tests-manifest.json')

let passingTests = ''
let failingTests = ''
Expand All @@ -17,39 +14,34 @@ async function main() {

const contents = await fs.readFile(file, 'utf-8')
const results = JSON.parse(contents)
let { ref } = results

const currentDate = new Date()
const isoString = currentDate.toISOString()
const timestamp = isoString.slice(0, 19).replace('T', ' ')

for (const result of results.result) {
for (const [testFileName, result] of Object.entries(results)) {
let suitePassCount = 0
let suiteFailCount = 0

suitePassCount += result.data.numPassedTests
suiteFailCount += result.data.numFailedTests
suitePassCount += result.passed.length
suiteFailCount += result.failed.length

let suiteName = result.data.testResults[0].name
// remove "/root/actions-runner/_work/next.js/next.js/" from the beginning of suiteName
suiteName = suiteName.slice(
'/root/actions-runner/_work/next.js/next.js/'.length
)
if (suitePassCount > 0) {
passingTests += `${suiteName}\n`
passingTests += `${testFileName}\n`
}

if (suiteFailCount > 0) {
failingTests += `${suiteName}\n`
failingTests += `${testFileName}\n`
}

for (const passed of result.passed) {
const passedName = passed.replaceAll('`', '\\`')
passingTests += `* ${passedName}\n`
}

for (const assertionResult of result.data.testResults[0]
.assertionResults) {
let assertion = assertionResult.fullName.replaceAll('`', '\\`')
if (assertionResult.status === 'passed') {
passingTests += `* ${assertion}\n`
} else if (assertionResult.status === 'failed') {
failingTests += `* ${assertion}\n`
}
for (const passed of result.failed) {
const failedName = passed.replaceAll('`', '\\`')
failingTests += `* ${failedName}\n`
}

passCount += suitePassCount
Expand All @@ -69,7 +61,7 @@ async function main() {
token: process.env.TURBOYET_KV_REST_API_TOKEN,
})

const testRun = `${ref}\t${timestamp}\t${passCount}/${
const testRun = `${process.env.GITHUB_SHA}\t${timestamp}\t${passCount}/${
passCount + failCount
}`

Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/turbo-daily-integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
upload_test_results:
name: Upload test results
needs: [next_js_integration]
if: github.repository_owner == 'vercel' && ${{ github.event_name == 'schedule' }} && always()
# if: github.repository_owner == 'vercel' && ${{ github.event_name == 'schedule' }} && always()
if: always()
uses: ./.github/workflows/upload-nextjs-integration-test-results.yml
secrets: inherit
30 changes: 15 additions & 15 deletions .github/workflows/upload-nextjs-integration-test-results.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,26 @@ jobs:
name: Upload test results
runs-on: ubuntu-latest
steps:
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_LTS_VERSION }}
check-latest: true

- name: Checkout
uses: actions/checkout@v4

# Download test results into the `test-results` directory from the artifact created by `nextjs-integration-test`.
- name: Download test results artifact
uses: actions/download-artifact@v4
with:
name: test-results
path: test-results
- run: corepack enable

# Read next.js version from test results, set necessary environment variables.
- name: Print test results
run: |
echo "::group::Passed test paths"
cat ./test-results/passed-test-path-list.json
echo "::endgroup::"
- name: Install dependencies
shell: bash
run: pnpm i

echo "::group::Failed test paths"
cat ./test-results/failed-test-path-list.json
echo "::endgroup::"
# Always run build manifest script to get the latest value
- run: |
node ./test/build-turbopack-tests-manifest.js
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_PULL_REQUESTS }}
- name: 'Upload results to "Are We Turbo Yet" KV'
env:
Expand Down
Loading

0 comments on commit 4b61d8b

Please sign in to comment.