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

Fix test SyncPublishDownloadPolicyTestCase #1299

Merged
merged 1 commit into from Mar 26, 2019
Merged

Fix test SyncPublishDownloadPolicyTestCase #1299

merged 1 commit into from Mar 26, 2019

Conversation

nixocio
Copy link

@nixocio nixocio commented Mar 13, 2019

Fix test SyncPublishDownloadPolicyTestCase. Add publish step.

https://pulp.plan.io/issues/4418
ref: #4418

@nixocio nixocio requested a review from a team March 13, 2019 17:27
@nixocio
Copy link
Author

nixocio commented Mar 13, 2019

This one will be rebased after #1298 is merged.

@goosemania
Copy link
Member

@kersommoura , why is it still passing? I thought it should fail without a fix from #1298.

@nixocio
Copy link
Author

nixocio commented Mar 14, 2019

@goosemania, I will double check.

@nixocio
Copy link
Author

nixocio commented Mar 14, 2019

'Task report /pulp/api/v3/tasks/0afdc1fb-559b-4cdb-a026-b03b2fd1c97e/ '
 'contains a error: {\'code\': None, \'description\': "\'NoneType\' object has '
 'no attribute \'file\'", \'traceback\': \'  File '
 '"/usr/local/lib/pulp/lib64/python3.7/site-packages/rq/worker.py", line 799, '
 'in perform_job\\n    rv = job.perform()\\n  File '
 '"/usr/local/lib/pulp/lib64/python3.7/site-packages/rq/job.py", line 600, in '
 'perform\\n    self._result = self._execute()\\n  File '
 '"/usr/local/lib/pulp/lib64/python3.7/site-packages/rq/job.py", line 606, in '
 '_execute\\n    return self.func(*self.args, **self.kwargs)\\n  File '
 '"/usr/local/lib/pulp/lib64/python3.7/site-packages/pulp_rpm/app/tasks/publishing.py", '
 'line 132, in publish\\n    pkg = '
 "cr.package_from_rpm(artifact.content_artifact.artifact.file.path)\\n'}\n"
 "Full task report: {'_href': "
 "'/pulp/api/v3/tasks/0afdc1fb-559b-4cdb-a026-b03b2fd1c97e/', '_created': "
 "'2019-03-14T17:19:11.000980Z', 'job_id': "
 "'b266e8d6-872c-47a6-b921-f15ae57519a2', 'state': 'failed', 'name': "
 "'pulp_rpm.app.tasks.publishing.publish', 'started_at': "
 "'2019-03-14T17:19:11.078500Z', 'finished_at': '2019-03-14T17:19:11.313561Z', "
 "'non_fatal_errors': [], 'error': {'code': None, 'description': "
 '"\'NoneType\' object has no attribute \'file\'", \'traceback\': \'  File '
 '"/usr/local/lib/pulp/lib64/python3.7/site-packages/rq/worker.py", line 799, '
 'in perform_job\\n    rv = job.perform()\\n  File '
 '"/usr/local/lib/pulp/lib64/python3.7/site-packages/rq/job.py", line 600, in '
 'perform\\n    self._result = self._execute()\\n  File '
 '"/usr/local/lib/pulp/lib64/python3.7/site-packages/rq/job.py", line 606, in '
 '_execute\\n    return self.func(*self.args, **self.kwargs)\\n  File '
 '"/usr/local/lib/pulp/lib64/python3.7/site-packages/pulp_rpm/app/tasks/publishing.py", '
 'line 132, in publish\\n    pkg = '
 "cr.package_from_rpm(artifact.content_artifact.artifact.file.path)\\n'}, "
 "'worker': '/pulp/api/v3/workers/907c9b9a-bbc8-4fb1-b5e1-a8f8e74c8473/', "
 "'parent': None, 'spawned_tasks': [], 'progress_reports': [], "
 "'created_resources': []}",
 {'_created': '2019-03-14T17:19:11.000980Z',
  '_href': '/pulp/api/v3/tasks/0afdc1fb-559b-4cdb-a026-b03b2fd1c97e/',
  'created_resources': [],
  'error': {'code': None,
            'description': "'NoneType' object has no attribute 'file'",
            'traceback': '  File '
                         '"/usr/local/lib/pulp/lib64/python3.7/site-packages/rq/worker.py", '
                         'line 799, in perform_job\n'
                         '    rv = job.perform()\n'
                         '  File '
                         '"/usr/local/lib/pulp/lib64/python3.7/site-packages/rq/job.py", '
                         'line 600, in perform\n'
                         '    self._result = self._execute()\n'
                         '  File '
                         '"/usr/local/lib/pulp/lib64/python3.7/site-packages/rq/job.py", '
                         'line 606, in _execute\n'
                         '    return self.func(*self.args, **self.kwargs)\n'
                         '  File '
                         '"/usr/local/lib/pulp/lib64/python3.7/site-packages/pulp_rpm/app/tasks/publishing.py", '
                         'line 132, in publish\n'
                         '    pkg = '
                         'cr.package_from_rpm(artifact.content_artifact.artifact.file.path)\n'},
  'finished_at': '2019-03-14T17:19:11.313561Z',
  'job_id': 'b266e8d6-872c-47a6-b921-f15ae57519a2',
  'name': 'pulp_rpm.app.tasks.publishing.publish',
  'non_fatal_errors': [],
  'parent': None,
  'progress_reports': [],
  'spawned_tasks': [],
  'started_at': '2019-03-14T17:19:11.078500Z',
  'state': 'failed',
  'worker': '/pulp/api/v3/workers/907c9b9a-bbc8-4fb1-b5e1-a8f8e74c8473/'})

Before I sent this PR I ran the test locally with a fresh Pulp installation from yesterday.
I installed Pulp today without the fix for #1298, and the test failed locally again. See traceback above.

I will take a look into Travis, and double check if there is anything that can be improved in the test itself.

Copy link
Member

@dkliban dkliban left a comment

Choose a reason for hiding this comment

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

This PR is passing on Travis because by the time these 2 tests run, a previous test has already populated Pulp with the artifacts needed during the publish part of the test. These two tests should either use a different fixture repository than the other tests or we need to clean up orphans before running the test.

Fix test `SyncPublishDownloadPolicyTestCase`. Add publish step.

https://pulp.plan.io/issues/4412

https://pulp.plan.io/issues/4418
ref: #4418
@nixocio
Copy link
Author

nixocio commented Mar 25, 2019

@dkliban, added the clean up, tests failed as expected.

@dkliban
Copy link
Member

dkliban commented Mar 25, 2019

Looks like this change affected a couple of other tests also. However, the failures look exactly the same as the other publishing errors. @goosemania, merge when you think it's appropriate.

@goosemania
Copy link
Member

Merging. Tests are supposed to fail, a follow-up PR which fixes publish will be merged shortly.

@goosemania goosemania merged commit 853737b into pulp:master Mar 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants