Skip to content
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

Merged
merged 1 commit into from
Sep 18, 2017
Merged

Conversation

nitisht
Copy link
Contributor

@nitisht nitisht commented Sep 14, 2017

User can pass comma separated names of SDKs to be run in Mint tests.

Fixes: #134

@@ -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.
Copy link
Member

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

Copy link
Contributor Author

@nitisht nitisht Sep 14, 2017

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

Copy link
Member

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 <<<"${@}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. this needs to be in global
  2. RUN_LIST=( "$@" ) is good enough for an array.
  3. 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
Copy link
Member

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?

Copy link
Contributor Author

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

Copy link
Member

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
Copy link
Member

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.

@nitisht
Copy link
Contributor Author

nitisht commented Sep 15, 2017

updated the PR @harshavardhana @balamurugana please check

# limitations under the License.
#

run() {
Copy link
Member

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
Copy link
Member

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
Copy link
Member

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
Copy link
Member

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"]
Copy link
Member

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

@nitisht
Copy link
Contributor Author

nitisht commented Sep 18, 2017

Updated @balamurugana

entrypoint.sh Outdated

./mint.sh "$@" &
main_pid="$!"
trap 'echo -e "\nAborting Mint..."; kill -SIGTERM $main_pid' SIGINT SIGTERM
Copy link
Member

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
Copy link
Member

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

@nitisht
Copy link
Contributor Author

nitisht commented Sep 18, 2017

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
Copy link
Member

@balamurugana balamurugana Sep 18, 2017

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

Copy link
Contributor Author

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
Copy link
Member

@harshavardhana harshavardhana left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nitisht nitisht merged commit 703f237 into minio:master Sep 18, 2017
@nitisht nitisht deleted the remove-skip-tests branch September 18, 2017 20:19
@halfcrazy halfcrazy mentioned this pull request Apr 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants