mirror of
https://github.com/clearlinux/swupd-client.git
synced 2026-04-28 19:03:46 +00:00
2 groups were created: - slow: Tests that are very slow because of sleeps, so we can run them all in parallel - system: Tests that make change to the system, so they can cause problems when running in parallel, so we run them in series. Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
21 lines
440 B
Bash
Executable File
21 lines
440 B
Bash
Executable File
#!/bin/bash
|
|
MAX_WEIGHT=40
|
|
|
|
if [ -z "$1" ]; then
|
|
TESTS=$(find test/functional/ -name "*.bats" \( ! -path "*only_in_ci*" \))
|
|
else
|
|
TESTS="$*"
|
|
fi
|
|
|
|
for t in $TESTS; do
|
|
echo "Running $t"
|
|
WEIGHT=$(($(/usr/bin/time -f %e "$t" 2>&1 |tail -n 1 |cut -d '.' -f 1)+1))
|
|
echo "$WEIGHT"
|
|
if [ $WEIGHT -gt "$MAX_WEIGHT" ]; then
|
|
WEIGHT="$MAX_WEIGHT"
|
|
fi
|
|
|
|
sed -i "/#WEIGHT/d" "$t"
|
|
echo "#WEIGHT=$WEIGHT" >> "$t"
|
|
done
|