Skip to content

Commit

Permalink
log allocated shards
Browse files Browse the repository at this point in the history
  • Loading branch information
alexprudhomme committed Oct 28, 2024
1 parent 1143cae commit af2fa9c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ export function buildFacet(engine: SearchEngine, props: FacetProps): Facet {
}

const {dispatch} = engine;
console.log('alex');
const coreController = buildCoreFacet(
engine,
{
Expand Down
6 changes: 6 additions & 0 deletions scripts/ci/determine-shard.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,24 @@ function getOutputName() {
function allocateShards(testCount, maximumShards) {
const shardTotal =
testCount === 0 ? maximumShards : Math.min(testCount, maximumShards);
console.log('shardTotal:', shardTotal);
const shardIndex = Array.from({length: shardTotal}, (_, i) => i + 1);
console.log('shardIndex:', shardIndex);
return [shardIndex, [shardTotal]];
}

const testsToRun = process.env.testsToRun.split(' ');
console.log('testsToRun:', testsToRun);
const maximumShards = parseInt(process.env.maximumShards, 10);
console.log('maximumShards:', maximumShards);

const [shardIndexOutputName, shardTotalOutputName] = getOutputName();
console.log('shardIndexOutputName:', shardIndexOutputName);
const [shardIndex, shardTotal] = allocateShards(
testsToRun.length,
maximumShards
);
console.log('shardIndex:', shardIndex);

setOutput(shardIndexOutputName, shardIndex);
setOutput(shardTotalOutputName, shardTotal);

0 comments on commit af2fa9c

Please sign in to comment.