diff options
author | Gwenael Lambrouin <gwenael.lambrouin@orange.com> | 2022-06-03 17:54:16 +0200 |
---|---|---|
committer | Gwenael Lambrouin <gwenael.lambrouin@orange.com> | 2022-10-27 15:52:22 +0200 |
commit | 87d88eab6fe50101abc607857f13af9273aef80a (patch) | |
tree | 3cbe2963b8998b949b95ce8bea7a76378732dccf /test/ut_behave_tests/test_testapi.py | |
parent | e2faa91512043386aa3a11ca44792bd3c009db76 (diff) |
behave_tests: refactor TestAPI DB lookup
- use testapi.TestapiClient everywhere
- relax search constraints: match only project name (nfvbench), test
case name (characterization or non-regression), scenario tag
(throughput or latency) and user_label (test chain identifier:
identifies, among other things, the platform, the compute class under
test, ...)
- add unit tests for some of the related behave steps
Change-Id: I26763f845c2286601cb958b326525b29320a1627
Signed-off-by: Gwenael Lambrouin <gwenael.lambrouin@orange.com>
Diffstat (limited to 'test/ut_behave_tests/test_testapi.py')
-rw-r--r-- | test/ut_behave_tests/test_testapi.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/ut_behave_tests/test_testapi.py b/test/ut_behave_tests/test_testapi.py index 2b57483..0fbcd96 100644 --- a/test/ut_behave_tests/test_testapi.py +++ b/test/ut_behave_tests/test_testapi.py @@ -109,3 +109,24 @@ class TestTestapiClient(unittest.TestCase): with self.assertRaises(ValueError): client.find_last_result(testapi_params, scenario_tag="throughput", nfvbench_test_input=nfvbench_test_input) + + def test_flavor_is_ignored(self): + """Check that lookup in TestAPI does not filter on the flavor_type.""" + client = TestapiClient("http://127.0.0.1:8000/api/v1/results") + testapi_params = {"project_name": "nfvbench", "case_name": "characterization"} + nfvbench_test_input = {"frame_sizes": ['64'], + "flow_count": "100k", + "duration_sec": '10', + "rate": "ndr", + "user_label": "amical_tc18_loopback", + "flavor_type": "no_such_flavor"} + last_result = client.find_last_result(testapi_params, + scenario_tag="throughput", + nfvbench_test_input=nfvbench_test_input) + self.assertIsNotNone(last_result) + self.assertEqual(16765582, last_result["synthesis"]["total_tx_rate"]) + self.assertEqual(25, round(last_result["synthesis"]["avg_delay_usec"])) + + self.mock_requests.get.assert_called_once_with( + "http://127.0.0.1:8000/api/v1/results?" + "project=nfvbench&case=characterization&criteria=PASS&page=1") |