-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3084 from dhis2/dev
fix: merge to master
- Loading branch information
Showing
26 changed files
with
831 additions
and
728 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
const fs = require('fs') | ||
const path = require('path') | ||
|
||
const getAllFiles = (dirPath, arrayOfFiles = []) => { | ||
const files = fs.readdirSync(dirPath) | ||
|
||
files.forEach((file) => { | ||
if (fs.statSync(path.join(dirPath, file)).isDirectory()) { | ||
arrayOfFiles = getAllFiles(path.join(dirPath, file), arrayOfFiles) | ||
} else if (path.extname(file) === '.js') { | ||
arrayOfFiles.push(path.join(dirPath, file)) | ||
} | ||
}) | ||
|
||
return arrayOfFiles | ||
} | ||
|
||
const createGroups = (files, numberOfGroups = 5) => { | ||
const groups = [] | ||
for (let i = 0; i < numberOfGroups; i++) { | ||
groups.push([]) | ||
} | ||
|
||
files.forEach((file, index) => { | ||
groups[index % numberOfGroups].push(file) | ||
}) | ||
|
||
return groups.map((group, index) => ({ id: index + 1, tests: group })) | ||
} | ||
|
||
const cypressSpecsPath = './cypress/integration' | ||
const specs = getAllFiles(cypressSpecsPath) | ||
const groupedSpecs = createGroups(specs) | ||
|
||
console.log(JSON.stringify(groupedSpecs)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.