Skip to content

Instantly share code, notes, and snippets.

@antonfisher
Last active March 16, 2020 12:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save antonfisher/e4cd3e1176b77663ccbc3adf6071187d to your computer and use it in GitHub Desktop.
Save antonfisher/e4cd3e1176b77663ccbc3adf6071187d to your computer and use it in GitHub Desktop.
Add BAIL and TEST_ONLY options to minio/mint tests runner
diff --git a/mint/mint.sh b/mint/mint.sh
index 5d9e997..952dc16 100755
--- a/mint/mint.sh
+++ b/mint/mint.sh
@@ -139,6 +139,7 @@ function main()
export ENABLE_VIRTUAL_STYLE
export GO111MODULE
export GOPROXY
+ export BAIL
echo "Running with"
echo "SERVER_ENDPOINT: $SERVER_ENDPOINT"
@@ -149,6 +150,7 @@ function main()
echo "MINT_DATA_DIR: $MINT_DATA_DIR"
echo "MINT_MODE: $MINT_MODE"
echo "ENABLE_VIRTUAL_STYLE: $ENABLE_VIRTUAL_STYLE"
+ echo "BAIL: $BAIL"
echo
echo "To get logs, run 'docker cp ${CONTAINER_ID}:/mint/log /tmp/mint-logs'"
echo
@@ -172,6 +174,10 @@ function main()
fi
for sdk in "${sdks[@]}"; do
+ if [ -n "$TEST_ONLY" ] && [ "$sdk" != "$TEST_ONLY" ]; then
+ continue
+ fi
+
if [ "$sdk" == "worm" ]; then
echo "worm test cannot be run without worm mode"
exit 1
@@ -193,7 +199,10 @@ function main()
echo -n "($i/$count) Running $sdk_name tests ... "
if ! run_test "$sdk_dir"; then
(( i-- ))
- break
+ if [ "$BAIL" != "false" ]; then
+ echo "BREAK"
+ break
+ fi
fi
done
#!/usr/bin/env bash
# !!! after applying the diff file, build docker container:
# docker build --no-cache -t minio/mint:local . -f Dockerfile.dev
# New options:
# -e BAIL=false - do not exit on the first fail
# -e TEST_ONLY=$1 - run only single test set, should be folder name from there:
# https://github.com/minio/minio/tree/master/mint/build
# To use this option run: `run-mint-test.sh aws-sdk-go`
# Modes:
# - core
# - full
# - worn
set -x;
set -e;
# minio edge
docker run \
--name mint \
--rm \
-it \
-e SERVER_ENDPOINT=1.1.1.1:9000 \
-e ACCESS_KEY=lololol \
-e SECRET_KEY=kekekek \
-e ENABLE_HTTPS=0 \
-e ENABLE_VIRTUAL_STYLE=0 \
-e MINT_MODE=core \
-e BAIL=false \
-e TEST_ONLY=$1 \
minio/mint:local
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment