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
Running tests on minio #358
Conversation
f77b79d
to
0b953ef
Compare
9ca9765
to
109315c
Compare
|
pulpcore tests are failing |
.travis/before_install.sh
Outdated
| # Hacking botocore: | ||
| sed -i "/gunicorn/a RUN sed -i \"s/hasattr(body, 'read')/getattr(body, '_size', None)/g\" \$(pip show botocore | grep -i location | awk '{ print \$2 }')/botocore/handlers.py" ./containers/images/pulp/Dockerfile.j2 | ||
| cat ./containers/images/pulp/Dockerfile.j2 |
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.
thank you @daviddavis
your tip led me to open this PR:
boto/botocore#1990
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.
Excellent I've subscribed to the PR and plan on following up next week if no one responds.
Can you add a link to your PR in the comments?
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.
sure!
.travis/script.sh
Outdated
| @@ -89,8 +89,10 @@ export CMD_STDIN_PREFIX="sudo kubectl exec -i $PULP_API_POD --" | |||
| cat unittest_requirements.txt | $CMD_STDIN_PREFIX bash -c "cat > /tmp/test_requirements.txt" | |||
| $CMD_PREFIX pip3 install -r /tmp/test_requirements.txt | |||
|
|
|||
| # Run unit tests. | |||
| $CMD_PREFIX bash -c "PULP_DATABASES__default__USER=postgres django-admin test --noinput /usr/local/lib/python${TRAVIS_PYTHON_VERSION}/site-packages/pulp_file/tests/unit/" | |||
| if [[ "$TEST" != 's3' ]]; then | |||
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 are we skipping the unit tests for s3?
|
|
||
| def pytest_runtest_setup(item): | ||
| """Adding delay.""" | ||
| time.sleep(0.5) |
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 adds a 0.5 sleep before every test? Is that needed to throttle connections to minio?
If so, I wonder if we should make this a configuration setting so it doesn't impact non-minio test runs?
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 forgot to remove that
| @@ -173,7 +173,7 @@ def monitor_task(task_href): | |||
| completed = ["completed", "failed", "canceled"] | |||
| task = tasks.read(task_href) | |||
| while task.state not in completed: | |||
| sleep(2) | |||
| sleep(1) | |||
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 this just an optimization or is it minio related?
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 an optimization, I think 2 seconds is too much
|
Overall, great job. I think I like this solution better than the localstack one. What do you think? |
I agree minio is simpler |
.travis/script.sh
Outdated
| @@ -106,6 +113,11 @@ export PYTHONPATH=$TRAVIS_BUILD_DIR:$TRAVIS_BUILD_DIR/../pulpcore:${PYTHONPATH} | |||
|
|
|||
| set -u | |||
|
|
|||
| if [[ "$TEST" == 's3' ]]; then | |||
| pytest -v -r sx --color=yes --pyargs pulp_file.tests.functional || show_logs_and_return_non_zero | |||
| exit | |||
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 this to not run the pulpcore tests? If so, I have a PR to get them passing:
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.
yes, it was because of that, I'm linking your PR as Required PR here
4ee1ecb
to
0ffe3db
Compare
|
@mikedep333 @dkliban either of you want to review this before we merge and apply this to the plugin_template? |
Required PR: pulp/pulp_file#358 https://pulp.plan.io/issues/6155 closes #6155
Required PR: pulp/pulp_file#358 https://pulp.plan.io/issues/6155 closes #6155
Required PR: pulp/pulp_file#358 https://pulp.plan.io/issues/6155 closes #6155
Required PR: pulp/pulp_file#358 https://pulp.plan.io/issues/6155 closes #6155
Required PR: pulp/pulp_file#358 https://pulp.plan.io/issues/6155 closes #6155
Required PR: pulp/pulp_file#358 https://pulp.plan.io/issues/6155 closes #6155
Required PR: pulp/pulp_file#358 https://pulp.plan.io/issues/6155 closes #6155
Required PR: pulp/pulp_file#358 Required PR: pulp/pulp-operator#35 https://pulp.plan.io/issues/6155 closes #6155
template_config.yml
Outdated
| aws_storage_bucket_name: '"pulp3"' | ||
| default_file_storage: '"storages.backends.s3boto3.S3Boto3Storage"' | ||
| media_root: '' | ||
| s3_use_sigv4: 'true' |
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 think this needs to be removed?
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.
yep, I forgot to run plugin_template after the last change, I'll do it for all PRs
Required PR: pulp/pulp_file#358 Required PR: pulp/pulp-operator#35 https://pulp.plan.io/issues/6155 closes #6155
Required PR: pulp/pulp-operator#35 Required PR: pulp/pulpcore#568 https://pulp.plan.io/issues/6155 ref #6155
Required PR: pulp/pulp_file#358 Required PR: pulp/pulp-operator#35 https://pulp.plan.io/issues/6155 closes #6155
https://pulp.plan.io/issues/6155
ref #6155