Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6bc3549

Browse files
committed
shuffle in a deterministic fashion
1 parent eb4cde3 commit 6bc3549

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

.circleci/orca_generate.sh

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,23 @@ BASELINES=$ROOT/test/image/baselines
77
TEST_IMAGES=$ROOT/build/test_images
88
DIFF_IMAGES=$ROOT/build/test_images_diff
99

10+
# Deterministic shuffling (https://www.gnu.org/software/coreutils/manual/html_node/Random-sources.html)
11+
get_seeded_random()
12+
{
13+
seed="$1"
14+
openssl enc -aes-256-ctr -pass pass:"$seed" -nosalt \
15+
</dev/zero 2>/dev/null
16+
}
17+
18+
deterministic_shuffle()
19+
{
20+
shuf --random-source=<(get_seeded_random "0")
21+
}
22+
1023
echo "Generating test images"
1124
ls $MOCKS/*.json | awk '!/mapbox/' | \
1225
# Shuffle to distribute randomly slow and fast mocks
13-
shuf | \
26+
deterministic_shuffle | \
1427
# head -n 10 | \
1528
# Split in chunks of 20
1629
xargs -P1 -n20 xvfb-run -a orca graph --verbose --output-dir $TEST_IMAGES

0 commit comments

Comments
 (0)