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

Updates pulp-smash for repo layout changes #1174

Merged

Conversation

bmbouter
Copy link
Member

@bmbouter bmbouter commented Feb 27, 2019

Updates pulp-smash for repo layout changes

This is designed to go along with these changes in Pulp 3.0

pulp/pulp#3896
pulp/pulpcore#2

The response format changed you we have to adjust how the utils parse
the response data for tests.

https://pulp.plan.io/issues/4283
re #4283

bmbouter pushed a commit to bmbouter/pulp that referenced this pull request Feb 27, 2019
The performance issue causes us to introduce a new model named
RepositoryVersionContentDetails. This is also a great opportunity to
update the content_summary of the RepositoryVersion serializer to match
the recent API changes.

Most of this code was inspired from a patch from @dalley.

Requires PR: pulp/pulp-smash#1174

https://pulp.plan.io/issues/4283
closes #4283
bmbouter pushed a commit to bmbouter/pulp that referenced this pull request Feb 27, 2019
The performance issue causes us to introduce a new model named
RepositoryVersionContentDetails. This is also a great opportunity to
update the content_summary of the RepositoryVersion serializer to match
the recent API changes.

Most of this code was inspired from a patch from @dalley.

Requires PR: pulp/pulp-smash#1174

https://pulp.plan.io/issues/4283
closes #4283
bmbouter pushed a commit to bmbouter/pulp that referenced this pull request Feb 27, 2019
The performance issue causes us to introduce a new model named
RepositoryVersionContentDetails. This is also a great opportunity to
update the content_summary of the RepositoryVersion serializer to match
the recent API changes.

Most of this code was inspired from a patch from @dalley.

Requires PR: pulp/pulp-smash#1174

https://pulp.plan.io/issues/4283
closes #4283
@bmbouter bmbouter force-pushed the updates-for-summary-response-changes branch from 39ae8cb to f67d322 Compare March 1, 2019 15:44
bmbouter pushed a commit to bmbouter/pulpcore that referenced this pull request Mar 1, 2019
The performance issue causes us to introduce a new model named
RepositoryVersionContentDetails. This is also a great opportunity to
update the content_summary of the RepositoryVersion serializer to match
the recent API changes.

Most of this code was inspired from a patch from @dalley.

This includes smash updates that are included in a separate PR.

Requires PR: pulp/pulp-smash#1174

https://pulp.plan.io/issues/4283
closes pulp#4283
@bmbouter bmbouter force-pushed the updates-for-summary-response-changes branch from f67d322 to 84cca3a Compare March 1, 2019 16:01
bmbouter pushed a commit to bmbouter/pulpcore that referenced this pull request Mar 1, 2019
The performance issue causes us to introduce a new model named
RepositoryVersionContentDetails. This is also a great opportunity to
update the content_summary of the RepositoryVersion serializer to match
the recent API changes.

Most of this code was inspired from a patch from @dalley.

This includes smash updates that are included in a separate PR.

Required PR: pulp/pulp-smash#1174

https://pulp.plan.io/issues/4283
closes pulp#4283
bmbouter pushed a commit to bmbouter/pulpcore that referenced this pull request Mar 1, 2019
The performance issue causes us to introduce a new model named
RepositoryVersionContentDetails. This is also a great opportunity to
update the content_summary of the RepositoryVersion serializer to match
the recent API changes.

Most of this code was inspired from a patch from @dalley.

This includes smash updates that are included in a separate PR.

Required PR: pulp/pulp-smash#1174

https://pulp.plan.io/issues/4283
closes pulp#4283
bmbouter pushed a commit to bmbouter/pulpcore that referenced this pull request Mar 1, 2019
The performance issue causes us to introduce a new model named
RepositoryVersionContentDetails. This is also a great opportunity to
update the content_summary of the RepositoryVersion serializer to match
the recent API changes.

Most of this code was inspired from a patch from @dalley.

This includes smash updates that are included in a separate PR.

Required PR: pulp/pulp-smash#1174

This also fixes travis script lines that weren't updated due to
pulp/pulp being moved to pulp/pulpcore. This PR needs that small fix to
pass also.

https://pulp.plan.io/issues/4283
closes pulp#4283
return client.get(version_href)[summary_field]
to_return = client.get(version_href)['content_summary'][summary_field]
for key in to_return:
to_return[key].pop('href') # Figure out how to assert on changing hrefs in response
Copy link
Member

Choose a reason for hiding this comment

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

@bmbouter I don't get why we need to remove the href from response here, can you elaborate a little more why this is being popped out?

Copy link
Member Author

Choose a reason for hiding this comment

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

Well it really shouldn't be but it's the best I can offer before I go away for 2 weeks.

So the response formats look like this:
screenshot from 2019-02-25 17-54-43

The href field changes depending on how many test have run before it so it can't easily be added to the fixture data. What do you think is the right way to resolve this issue in pulp smash?

Copy link
Contributor

Choose a reason for hiding this comment

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

Previously Pulp had a bunch of different fields on a repository named

  • content_summary
  • content_added_summary
  • content_removed_summary
  • content_hrefs
  • content_added_hrefs
  • content_removed_hrefs

These are all being merged together to look like this

"content_summary: {
    'added': {
        'file.file': {
            'count': 5,
            'href': '/pulp/api/v3/content/file/files/?repository_version_added=/pulp/api/v3/repositories/1/versions/1/'
        }
    },
    'present': {
        'file.file': {
            'count': 5,
            'href': '/pulp/api/v3/content/file/files/?repository_version=/pulp/api/v3/repositories/1/versions/1/'
        }
    },
    'removed': {}
}

Since the pulp_smash API is going to stay the same (for now at least), it's a hack to make it look the same as it did before.

Copy link
Member Author

Choose a reason for hiding this comment

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

Recapping our convo, I'm going to update this function to fully preserve the previous data layout and file a pulp-smash issue to handle creating a new util function with the new interface so users can port over.

Copy link
Member Author

Choose a reason for hiding this comment

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

That issue is here: #1175

bmbouter pushed a commit to bmbouter/pulpcore that referenced this pull request Mar 1, 2019
The performance issue causes us to introduce a new model named
RepositoryVersionContentDetails. This is also a great opportunity to
update the content_summary of the RepositoryVersion serializer to match
the recent API changes.

Most of this code was inspired from a patch from @dalley.

This includes smash updates that are included in a separate PR.

Required PR: pulp/pulp-smash#1174

This also fixes travis script lines that weren't updated due to
pulp/pulp being moved to pulp/pulpcore. This PR needs that small fix to
pass also.

You also need the pulp_file PR below because it has tests which need
updates to account for this backwards incompatible API change.

Required PR: pulp/pulp_file#183

https://pulp.plan.io/issues/4283
closes pulp#4283
This is designed to go along with these changes in Pulp 3.0

pulp/pulp#3896

The response format changed you we have to adjust how the utils parse
the response data for tests.

https://pulp.plan.io/issues/4283
re #4283
bmbouter pushed a commit to bmbouter/pulpcore that referenced this pull request Mar 1, 2019
The performance issue causes us to introduce a new model named
RepositoryVersionContentDetails. This is also a great opportunity to
update the content_summary of the RepositoryVersion serializer to match
the recent API changes.

Most of this code was inspired from a patch from @dalley.

This includes smash updates that are included in a separate PR to
preserve backwards compatability.

Required PR: pulp/pulp-smash#1174

This also fixes travis script lines that weren't updated due to
pulp/pulp being moved to pulp/pulpcore. This PR needs that small fix to
pass also.

https://pulp.plan.io/issues/4283
closes pulp#4283
@bmbouter bmbouter force-pushed the updates-for-summary-response-changes branch from 84cca3a to a153a5c Compare March 1, 2019 17:24
@rochacbruno rochacbruno merged commit 35a3eb9 into pulp:master Mar 1, 2019
@bmbouter bmbouter deleted the updates-for-summary-response-changes branch January 7, 2020 16:41
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.

3 participants