MCPcopy
hub / github.com/vercel/next.js / fetchTestResults

Function fetchTestResults

test/update-bundler-manifest.js:126–159  ·  view source on GitHub ↗

* @returns {Promise<TestResultManifest>}

()

Source from the content-addressed store, hash-verified

124 * @returns {Promise<TestResultManifest>}
125 */
126async function fetchTestResults() {
127 const artifact = await fetchLatestTestArtifact()
128
129 const subprocess = exec('Downloading artifact archive', 'gh', [
130 'api',
131 `/repos/vercel/next.js/actions/artifacts/${artifact.id}/zip`,
132 ])
133
134 const filePath = path.join(
135 os.tmpdir(),
136 `next-test-results.${Math.floor(Math.random() * 100000).toString(16)}.zip`
137 )
138
139 let file
140 try {
141 file = await fs.open(filePath, 'w')
142
143 subprocess.stdout.pipe(file.createWriteStream())
144
145 await subprocess
146 } finally {
147 await file.close()
148 }
149
150 const { stdout } = await exec('Extracting test results manifest', 'unzip', [
151 '-pj',
152 filePath,
153 'nextjs-test-results.json',
154 ])
155
156 await fs.unlink(filePath)
157
158 return JSON.parse(stdout)
159}
160
161async function updatePassingTests() {
162 const results = await fetchTestResults()

Callers 1

updatePassingTestsFunction · 0.85

Calls 9

fetchLatestTestArtifactFunction · 0.85
createWriteStreamMethod · 0.80
execFunction · 0.70
closeMethod · 0.65
joinMethod · 0.45
toStringMethod · 0.45
openMethod · 0.45
pipeMethod · 0.45
parseMethod · 0.45

Tested by

no test coverage detected