commit f2d088b04e6e6896f0df04f03e92b32a539b6917
Author: Eric Fried <email address hidden>
Date: Mon Mar 4 16:08:39 2019 -0600
Stop using PlacementDirect
PlacementDirect was integrated into a functional test suite when it was
first created as a way to prove that it worked [1] and demonstrate how
to use it.
However, it was a pain then, because the interceptor needs to be created
every time you want to use it; and since extracted placement started
diverging from in-tree placement, other problems started cropping up
(see the associated bug).
So this commit removes the use of PlacementDirect from nova. Details:
- test_report_client now uses PlacementFixture. So all the `with
interceptor` context management is gone. This accounts for the vast
majority of the apparent change, which is just outdenting those
contexts.
- SchedulerReportClientTestBase, which was doing some hocus pocus to
wrap the SchedulerReportClient such that we could do some microversion
checks, is removed. The test suite simply instantiates the
microversion-checking wrapper class directly as the client used by the
test cases.
- We were taking advantage of a PlacementDirect feature allowing us to
default to the latest microversion if not explicitly specified in the
request. Without this, we had to add the `version` kwarg to some of
the calls we were making to SchedulerReportClient primitives
(get/put/post/delete).
- A piece of test_update_from_provider_tree was using a
deliberately-broken interceptor to prove that the code in question
wasn't hitting the API. We replace this with a non-callable mock on
the Adapter's request method.
- test_global_request_id was taking advantage of the interceptor to
validate that the global request ID was making it to the "other side"
of the API boundary. This was fun, but overkill. We now simply assert
that the correct HTTP header is making it into the ksa Adapter's
request method.
- Functional test suite test_resource_tracker.IronicResourceTrackerTest
was inheriting from the SchedulerReportClientTestBase class, but not
using the interceptor anywhere. Can't tell you why that was done. So
now it just uses the plain old test.TestCase like everyone else.
Reviewed: https:/ /review. opendev. org/640887 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=f2d088b04e6 e6896f0df04f03e 92b32a539b6917
Committed: https:/
Submitter: Zuul
Branch: master
commit f2d088b04e6e689 6f0df04f03e92b3 2a539b6917
Author: Eric Fried <email address hidden>
Date: Mon Mar 4 16:08:39 2019 -0600
Stop using PlacementDirect
PlacementDirect was integrated into a functional test suite when it was
first created as a way to prove that it worked [1] and demonstrate how
to use it.
However, it was a pain then, because the interceptor needs to be created
every time you want to use it; and since extracted placement started
diverging from in-tree placement, other problems started cropping up
(see the associated bug).
So this commit removes the use of PlacementDirect from nova. Details:
- test_report_client now uses PlacementFixture. So all the `with ClientTestBase, which was doing some hocus pocus to Client such that we could do some microversion ion-checking wrapper class directly as the client used by the Client primitives get/put/ post/delete) . from_provider_ tree was using a ely-broken interceptor to prove that the code in question request_ id was taking advantage of the interceptor to tracker. IronicResourceT rackerTest ClientTestBase class, but not
interceptor` context management is gone. This accounts for the vast
majority of the apparent change, which is just outdenting those
contexts.
- SchedulerReport
wrap the SchedulerReport
checks, is removed. The test suite simply instantiates the
microvers
test cases.
- We were taking advantage of a PlacementDirect feature allowing us to
default to the latest microversion if not explicitly specified in the
request. Without this, we had to add the `version` kwarg to some of
the calls we were making to SchedulerReport
(
- A piece of test_update_
deliberat
wasn't hitting the API. We replace this with a non-callable mock on
the Adapter's request method.
- test_global_
validate that the global request ID was making it to the "other side"
of the API boundary. This was fun, but overkill. We now simply assert
that the correct HTTP header is making it into the ksa Adapter's
request method.
- Functional test suite test_resource_
was inheriting from the SchedulerReport
using the interceptor anywhere. Can't tell you why that was done. So
now it just uses the plain old test.TestCase like everyone else.
[1] This commit does remove all of nova's testing of PlacementDirect. /github. com/openstack/ placement/ blob/69b9659a45 7b6d715ed47e6bd 6d3b923d548c620 /placement/ tests/functiona l/test_ direct. py
However, it is still tested in the placement repository itself:
https:/
Change-Id: Icb889c09a69e7c 5cbf9330e5d9917 d6ab3ac3dc5
Related-Bug: #1818560