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

qa/tasks/mgr/dashboard: accept headers as a param #47720

Merged
merged 1 commit into from Aug 22, 2022

Conversation

tchaikov
Copy link
Contributor

so we are able to pass headers to _get() in dashboard api tests.
without this change, we'd have following error when testing
test_force_no_gzip defined by tasks.mgr.dashboard.test_requests.RequestsTest:

traceback (most recent call last):
  File "/home/jenkins-build/build/workspace/ceph-api/src/pybind/mgr/dashboard/services/exception.py", line 47, in dashboard_exception_handler
    return handler(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/cherrypy/_cpdispatch.py", line 54, in __call__
    return self.callable(*self.args, **self.kwargs)
  File "/home/jenkins-build/build/workspace/ceph-api/src/pybind/mgr/dashboard/controllers/_base_controller.py", line 263, in inner
    ret = func(*args, **kwargs)
TypeError: Summary.__call__() got an unexpected keyword argument 'headers'

Signed-off-by: Kefu Chai tchaikov@gmail.com

Contribution Guidelines

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test dashboard cephadm
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox
  • jenkins test windows

@tchaikov tchaikov requested a review from a team as a code owner August 22, 2022 00:12
@tchaikov tchaikov requested review from nizamial09 and Pegonzal and removed request for a team August 22, 2022 00:12
@tchaikov tchaikov requested a review from zmc August 22, 2022 00:16
@tchaikov tchaikov force-pushed the wip-mgr-dashboard-test-with-headers branch from a87030f to f5488e9 Compare August 22, 2022 00:34
@github-actions github-actions bot added this to In progress in Dashboard Aug 22, 2022
@tchaikov tchaikov force-pushed the wip-mgr-dashboard-test-with-headers branch from f5488e9 to b2ce80f Compare August 22, 2022 01:03
@tchaikov tchaikov changed the title qa/tasks/mgr/dashboard: accept headers as an option param qa/tasks/mgr/dashboard: accept headers as a param Aug 22, 2022
* add optional "headers" parameter to _request() and _get()
* correct the test of test_force_no_gzip, as the header in response
  should be "application/vnd.ceph.api.v1.0+json", not "application/json"

with this change, we are able to pass headers to _get() in dashboard api
tests.

without this change, we'd have following error when testing
`test_force_no_gzip` defined by `tasks.mgr.dashboard.test_requests.RequestsTest`:

raceback (most recent call last):
  File "/home/jenkins-build/build/workspace/ceph-api/src/pybind/mgr/dashboard/services/exception.py", line 47, in dashboard_exception_handler
    return handler(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/cherrypy/_cpdispatch.py", line 54, in __call__
    return self.callable(*self.args, **self.kwargs)
  File "/home/jenkins-build/build/workspace/ceph-api/src/pybind/mgr/dashboard/controllers/_base_controller.py", line 263, in inner
    ret = func(*args, **kwargs)
TypeError: Summary.__call__() got an unexpected keyword argument 'headers'

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
@tchaikov tchaikov force-pushed the wip-mgr-dashboard-test-with-headers branch from b2ce80f to afe8058 Compare August 22, 2022 06:01
@tchaikov tchaikov requested a review from epuertat August 22, 2022 12:56
Dashboard automation moved this from In progress to Reviewer approved Aug 22, 2022
@tchaikov tchaikov merged commit 4bb9b6c into ceph:main Aug 22, 2022
Dashboard automation moved this from Reviewer approved to Done Aug 22, 2022
@tchaikov tchaikov deleted the wip-mgr-dashboard-test-with-headers branch August 22, 2022 14:35
@tchaikov
Copy link
Contributor Author

this change introduces https://tracker.ceph.com/issues/57256

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Dashboard
  
Done
2 participants