forked from mamba-org/micromamba-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.sh
More file actions
executable file
·24 lines (22 loc) · 736 Bytes
/
test.sh
File metadata and controls
executable file
·24 lines (22 loc) · 736 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash
set -eu -o pipefail
FLAGS=
if which parallel > /dev/null; then
if [[ $(uname -s) == "Darwin" ]]; then
NUM_CPUS=$(sysctl -n hw.ncpu)
else
NUM_CPUS=$(nproc)
fi
FLAGS="--jobs $NUM_CPUS"
if [ "$NUM_CPUS" -gt "1" ]; then
PROJECT_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
# build main test image here so that each *.bats file doesn't do this work in
# parallel. The *.bats files will still run this docker command, but it will
# just be a cache hit.
docker build --quiet \
--tag=micromamba:test \
"--file=${PROJECT_ROOT}/Dockerfile" \
"$PROJECT_ROOT" > /dev/null
fi
fi
./test/bats/bin/bats $FLAGS $@ test/