MCPcopy
hub / github.com/ampproject/amphtml / generateCircleCiShardTestFileList

Function generateCircleCiShardTestFileList

build-system/pr-check/utils.js:240–254  ·  view source on GitHub ↗

* Generates a file with a comma-separated list of test file paths that CircleCI * should execute in a parallelized job shard. * * @param {!Array } globs array of glob strings for finding test file paths.

(globs)

Source from the content-addressed store, hash-verified

238 * @param {!Array<string>} globs array of glob strings for finding test file paths.
239 */
240function generateCircleCiShardTestFileList(globs) {
241 const joinedGlobs = globs.map((glob) => `"${glob}"`).join(' ');
242 const fileList = getStdout(
243 `circleci tests glob ${joinedGlobs} | circleci tests split --split-by=timings`
244 )
245 .trim()
246 .replace(/\s+/g, ',');
247 fs.writeFileSync(FILELIST_PATH, fileList, 'utf8');
248 logWithoutTimestamp(
249 'Stored list of',
250 cyan(fileList.split(',').length),
251 'test files in',
252 cyan(FILELIST_PATH)
253 );
254}
255
256module.exports = {
257 FILELIST_PATH,

Callers 5

pushBuildWorkflowFunction · 0.85
prBuildWorkflowFunction · 0.85
runExperimentTestsFunction · 0.85
pushBuildWorkflowFunction · 0.85
prBuildWorkflowFunction · 0.85

Calls 4

getStdoutFunction · 0.85
logWithoutTimestampFunction · 0.85
cyanFunction · 0.85
replaceMethod · 0.45

Tested by

no test coverage detected