mirror of
https://github.com/electron/electron.git
synced 2026-01-07 22:54:25 -05:00
chore: sort files alphabetically
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
const glob = require('glob');
|
||||
|
||||
const fs = require('node:fs');
|
||||
const path = require('node:path');
|
||||
|
||||
const currentShard = parseInt(process.argv[2], 10);
|
||||
@@ -14,15 +13,7 @@ for (let i = 0; i < shardCount; i++) {
|
||||
buckets.push([]);
|
||||
}
|
||||
|
||||
const testsInSpecFile = Object.create(null);
|
||||
for (const specFile of specFiles) {
|
||||
const testContent = fs.readFileSync(specFile, 'utf8');
|
||||
testsInSpecFile[specFile] = testContent.split('it(').length;
|
||||
}
|
||||
|
||||
specFiles.sort((a, b) => {
|
||||
return testsInSpecFile[b] - testsInSpecFile[a];
|
||||
});
|
||||
specFiles.sort();
|
||||
|
||||
let shard = 0;
|
||||
for (const specFile of specFiles) {
|
||||
|
||||
Reference in New Issue
Block a user