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

Fixes 164: properly set versions when de-dupeing #85

Merged
merged 1 commit into from
Aug 25, 2022

Conversation

jlsherrill
Copy link
Member

on hooks you have to call SetColumn, you cannot just
update the attribute directly, even if it works for creation

on hooks you have to call SetColumn, you cannot just
update the attribute directly, even if it works for creation
@jlsherrill
Copy link
Member Author

Create a repo:

curl -X POST http://localhost:8000/api/content_sources/v1/repositories/   -H "`scripts/header.sh 1 1`"  -d '{"url": "http://foo.com/bar", "versions": ["7"], "name": "foo"}'  -H "Content-Type: application/json"   -v

Then update it with duplicated versions (setting the right UUID):

 1137  curl -X PUT http://localhost:8000/api/content_sources/v1/repositories/29126567-ff05-4608-9bf4-4630148be298   -H "`scripts/header.sh 1 1`"  -d '{"url": "http://foo.com/bazr", "distribution_versions": ["7", "7"], "name": "foo2"}'  -H "Content-Type: application/json"   -v

Then fetch the repo:

curl -X GET http://localhost:8000/api/content_sources/v1/repositories/29126567-ff05-4608-9bf4-4630148be298  -H "`scripts/header.sh 1 1`" 

You shouldn't see duplicated versions, only "7"

@jlsherrill
Copy link
Member Author

fixes this iqe test:

tests.test_repositories.test_create_update_distro_version_is_unique (from pytest)

AssertionError: assert ['8', '8'] == ['8']
  Left contains one more item: '8'
  Full diff:
  - ['8']
  + ['8', '8']

@jlsherrill
Copy link
Member Author

@mshriver
Copy link
Member

Test failures aren't related to the intent of this PR, and are already being addressed.

The intended test failure has been addressed as demonstrated by the results in ci.int.devshift.
14:15:33 tests/test_repositories.py::test_create_update_distro_version_is_unique PASSED [ 96%]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants