Update CI + add upgrade tests - #416
Conversation
| update_redmine: false | ||
| upgrade_range: [] | ||
| upgrade_range: | ||
| - pulp_python_branch: 3.2 |
There was a problem hiding this comment.
Branch should be created now. Do you also need a 3.3 branch?
There was a problem hiding this comment.
no, just the 3.2, I'll be adding the pre_upgrade tests there
fb4db18 to
cf9fa40
Compare
|
@fao89 You might want to remake this PR with the latest changes on master. |
c5e6d47 to
88c0a56
Compare
| sed -i "/require_pulp_plugins(/d" pulp_python/tests/functional/utils.py | ||
|
|
||
| # Running pre upgrade tests: | ||
| pytest -v -r sx --color=yes --pyargs -capture=no pulp_python.tests.upgrade.pre |
There was a problem hiding this comment.
@gerrod3 here is where the upgrade tests will start to run
|
@fao89 It seems that your upgrade tests don't account for changes in test_requirements.txt. Going from 3.2 -> 3.4 I think I added 1 or 2 requirements to run the tests. |
190332b to
cffda68
Compare
gerrod3
left a comment
There was a problem hiding this comment.
Looks good, just a couple questions before I approve.
| # Step 8 | ||
| self.assertIn("/pypi/pulp_post_upgrade_test/", distribution.base_url) | ||
|
|
There was a problem hiding this comment.
If these tests only run in the CI then the base url should be https://pulp:80/pypi/pulp_post_upgrade_test/ I think. It's fine this way too.
Also, I think the publication & distribution from the pre-test aren't destroyed correct? If not then should a test be added here to ensure you can access them from the new endpoint location?
There was a problem hiding this comment.
I think I can use the new endpoint when syncing, I'll change that
| def json_to_dict(data): | ||
| """ | ||
| Converts a JSON string into a Python dictionary. |
There was a problem hiding this comment.
This is interesting. Why is it needed? I see its use later on in another method, just safer this way?
There was a problem hiding this comment.
the post-test was breaking because the data was already a dict:
127.0.0.1 [24/Aug/2021:02:26:55 +0000] "GET /pulp/content/pulp_pre_upgrade_test/pypi/shelf-reader/json HTTP/1.0" 500 231 "-" "bandersnatch/4.4.0 (cpython 3.8.6-final0, Linux x86_64) (aiohttp 3.7.4.post0)"
File "/usr/local/lib/python3.8/site-packages/pulpcore/content/handler.py", line 212, in stream_content
return await self._match_and_stream(path, request)
File "/usr/local/lib/python3.8/site-packages/pulpcore/content/handler.py", line 454, in _match_and_stream
content_handler_result = distro.content_handler(rel_path)
File "/usr/local/lib/python3.8/site-packages/pulp_python/app/models.py", line 108, in content_handler
json_body = python_content_to_json(self.base_path, package_content, version=version)
File "/usr/local/lib/python3.8/site-packages/pulp_python/app/utils.py", line 127, in python_content_to_json
full_metadata.update({"info": python_content_to_info(latest_content[0])})
File "/usr/local/lib/python3.8/site-packages/pulp_python/app/utils.py", line 178, in python_content_to_info
"project_urls": json.loads(content.project_urls) or None,
File "/usr/lib64/python3.8/json/__init__.py", line 341, in loads
raise TypeError(f'the JSON object must be str, bytes or bytearray, '
TypeError: the JSON object must be str, bytes or bytearray, not dict
https://github.com/pulp/pulp_python/runs/3406807006?check_suite_focus=true#step:12:645
c1f33f3 to
be7c27c
Compare
closes #408