-
Notifications
You must be signed in to change notification settings - Fork 329
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
Run tests with both python2 and python3 #535
Conversation
tests/functional/tests.py
Outdated
@@ -52,7 +52,6 @@ def main(): | |||
# client.trace_on(sys.stderr) | |||
|
|||
# Make a new bucket. | |||
bucket_name = 'minio-pytest' |
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.
Is it safe to remove this ?
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.
line 48: bucket_name = uuid.uuid4().str() will generate a unique bucket name. Otherwise the make_bucket test will fail with hardcoded bucket name.
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.
@harshavardhana , I will rebase after #534 is merged to master.
a76fb38
to
394bc44
Compare
Can you rebase this @poornas ? |
@harshavardhana , rebased.. |
tests/functional_test.sh
Outdated
run() { | ||
echo "running..." | ||
if [[ $py2flag = 1 ]]; then | ||
python ./functional/tests.py |
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.
Some tabbing problem.
tests/functional_test.sh
Outdated
@@ -0,0 +1,64 @@ | |||
#!/usr/bin/env bash | |||
#!/usr/bin/expect -f |
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 is expect
used here?
tests/functional_test.sh
Outdated
#!/usr/bin/env bash | ||
#!/usr/bin/expect -f | ||
# | ||
# Minio Cloud Storage, (C) 2017 Minio, Inc. |
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.
Have python licensing heading here.
tests/unit_test.sh
Outdated
# | ||
|
||
#Make sure following packages are installed on your computer: | ||
#pip install nosetests |
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.
Comments should have #<space>
and also why are these written 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.
@vadmeste waiting on your review.
tests/functional_test.sh
Outdated
|
||
# invoke the script | ||
|
||
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.
@poornas, if you start the script from any directory (minio-py
for example), you will get an error. The solution is to make the script to change the current directory to where the script lives and then invoke the command.
The diff below will fix the problem:
diff --git a/tests/functional_test.sh b/tests/functional_test.sh
index 06b1581f..32711571 100755
--- a/tests/functional_test.sh
+++ b/tests/functional_test.sh
@@ -58,6 +58,6 @@ main () {
}
-# invoke the script
-
-main "$@"
+# Move to the directory which contains this script and invoke it
+cd $(dirname $(realpath $0)) ; \
+ 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.
@vadmeste, done
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.
One minor change needed
@vadmeste, your comments were addressed |
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 and tested
Fixes #532
This is just a convenience script for developers to ensure that unit tests and functional tests pass with both python2 and python3
Commit 2c2046e is identical to fix by @vadmeste for #533