* 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)
| 238 | * @param {!Array<string>} globs array of glob strings for finding test file paths. |
| 239 | */ |
| 240 | function 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 | |
| 256 | module.exports = { |
| 257 | FILELIST_PATH, |
no test coverage detected