-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove SKIP_TESTS env var option #138
Conversation
@@ -23,8 +23,7 @@ Set environment variables to pass test target server details to the docker conta | |||
- `ACCESS_KEY` - Access Key of the server. Defaults to Minio Play Access Key. | |||
- `SECRET_KEY` - Secret Key of the server. Defaults to Minio Play Secret Key. | |||
- `ENABLE_HTTPS` - Set to 1 to send HTTPS requests on SSL enabled deployment. Defaults to 0. | |||
- `MINT_DATA_DIR` - Data directory for SDK tests. Defaults to data directory created by `build/data/install.sh` script. | |||
- `SKIP_TESTS` - `','` separated list of SDKs to ignore running. Empty by default. For example, to skip `minio-js` and `awscli` tests, use `export SKIP_TESTS=minio-js,awscli`. | |||
- `MINT_DATA_DIR` - Data directory for SDK tests. Defaults to data directory created by `build/data/install.sh` script. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is no build/data/install.sh
. I don't think you need to describe how it is created
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just removed reference to SKIP_TESTS
here. Will send a refactor/cleanup for README in a separate PR as a fix for #135
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. then you won't need to change this line in this PR
mint.sh
Outdated
@@ -76,16 +64,23 @@ function main() | |||
## $MINT_MODE is used inside every sdks. | |||
echo "To get intermittent logs, 'sudo docker cp ${CONTAINER_ID}:/mint/log /tmp/mint-logs'" | |||
|
|||
for sdk_dir in "$TESTS_DIR"/*; do | |||
if [ $# -gt 0 ]; then | |||
IFS=',' read -ra run_list <<<"${@}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- this needs to be in global
RUN_LIST=( "$@" )
is good enough for an array.- Write the logic below
if [ "${#RUN_LIST[@]}" -ne 0 ]; then
for sdk in "${RUN_LIST[@]}"; do
## run the test
done
else
for sdk in "$TEST_DIR"/*; do
## run the test
done
fi
mint.sh
Outdated
@@ -114,3 +109,5 @@ trap 'echo -e "\nAborting Mint..."; kill $main_pid' SIGINT SIGTERM | |||
|
|||
# wait for main to complete | |||
wait | |||
|
|||
exec |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you need exec
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is needed by Docker to properly pass arguments sent to docker run <image> <args>
.
Quote from docs:
Command line arguments to docker run <image> will be appended after all elements in
an exec form ENTRYPOINT, and will override all elements specified using CMD.
This allows arguments to be passed to the entry point, i.e., docker run <image> -d
will pass the -d argument to the entry point. You can override the ENTRYPOINT
instruction using the docker run --entrypoint flag.
Ref: https://docs.docker.com/engine/reference/builder/#entrypoint
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps a comment regarding this would be better.. because naked exec
might get removed in future without knowing this context.
mint.sh
Outdated
@@ -114,3 +109,5 @@ trap 'echo -e "\nAborting Mint..."; kill $main_pid' SIGINT SIGTERM | |||
|
|||
# wait for main to complete | |||
wait | |||
|
|||
exec |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps a comment regarding this would be better.. because naked exec
might get removed in future without knowing this context.
4ed2064
to
5b77315
Compare
updated the PR @harshavardhana @balamurugana please check |
docker-entrypoint.sh
Outdated
# limitations under the License. | ||
# | ||
|
||
run() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
run function is a overkill. you could simply have
./mint.sh "$@" &
mint_pid=$!
trap 'echo -e "\nAborting Mint on signal..."; kill $main_pid' SIGINT SIGTERM
wait
echo "done in $duration" | ||
else | ||
echo "FAILED in $duration" | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you would need to return $rv
mint.sh
Outdated
main "$@" & | ||
main_pid=$! | ||
trap 'echo -e "\nAborting Mint..."; kill $main_pid' SIGINT SIGTERM | ||
main |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you would still need to pass "$@" for future use
mint.sh
Outdated
main "$@" & | ||
main_pid=$! | ||
trap 'echo -e "\nAborting Mint..."; kill $main_pid' SIGINT SIGTERM | ||
main | ||
|
||
# wait for main to complete | ||
wait |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is no more applicable
Dockerfile.dev
Outdated
@@ -56,4 +56,5 @@ COPY postinstall.sh /mint | |||
RUN /mint/postinstall.sh | |||
|
|||
COPY mint.sh /mint/mint.sh | |||
CMD ["/mint/mint.sh"] | |||
COPY docker-entrypoint.sh /mint/docker-entrypoint.sh | |||
ENTRYPOINT ["/mint/docker-entrypoint.sh"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just entrypoint.sh
is more clear
5b77315
to
86121df
Compare
Updated @balamurugana |
entrypoint.sh
Outdated
|
||
./mint.sh "$@" & | ||
main_pid="$!" | ||
trap 'echo -e "\nAborting Mint..."; kill -SIGTERM $main_pid' SIGINT SIGTERM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you want send sigterm than default?
entrypoint.sh
Outdated
|
||
# A signal emitted while waiting will make the wait command return code > 128 | ||
# Wrap it in a loop that doesn't end before the process is indeed stopped | ||
while kill -0 $main_pid > /dev/null 2>&1; do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unable to understand why you need this while loop
86121df
to
595aa6e
Compare
There was some mixup while moving file contents, should be fine now @balamurugana |
# Get the pid to be used for kill command if required | ||
main_pid="$!" | ||
trap 'echo -e "\nAborting Mint..."; kill $main_pid' SIGINT SIGTERM | ||
wait |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add newline i.e. wait
doesn't end with newline
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
User can instead pass comma separated names of SDKs to be run in Mint tests Fixes minio#134
595aa6e
to
785ccc2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
User can pass comma separated names of SDKs to be run in Mint tests.
Fixes: #134