[#228] add test container metrics #228

Merged
abereziny merged 1 commit from i.niyazov/frostfs-testcases:add-test-container-metric into master 2024-05-15 10:31:05 +00:00
Member

condition: TrueCloudLab/frostfs-testlib#220

Signed-off-by: Ilyas Niyazov i.niyazov@yadro.com

condition: https://git.frostfs.info/TrueCloudLab/frostfs-testlib/pulls/220 Signed-off-by: Ilyas Niyazov i.niyazov@yadro.com
anikeev-yadro requested review from qa-committers 2024-05-08 12:53:04 +00:00
anikeev-yadro requested review from qa-developers 2024-05-08 12:53:05 +00:00
i.niyazov force-pushed add-test-container-metric from f88eff9997 to 8fe37f8d42 2024-05-13 07:18:47 +00:00 Compare
i.niyazov force-pushed add-test-container-metric from 8fe37f8d42 to ce1b9aec12 2024-05-13 08:22:02 +00:00 Compare
abereziny reviewed 2024-05-13 10:33:11 +00:00
@ -0,0 +40,4 @@
def get_count_metric_type_from_stdout(metric_result_stdout: str, metric_type: str):
result = re.findall(rf'type="{metric_type}"}}\s(\d+)', metric_result_stdout)
return sum(map(int, result))
Member

need @allure.title("<Title for test case>")

need `@allure.title("<Title for test case>")`
abereziny marked this conversation as resolved
abereziny reviewed 2024-05-13 10:57:14 +00:00
@ -0,0 +42,4 @@
return sum(map(int, result))
def test_container_metrics(self, object_size: ObjectSize, default_wallet: WalletInfo, cluster: Cluster):
wallet = default_wallet
Member

wallet = default_wallet is a redundant line

`wallet = default_wallet` is a redundant line
abereziny marked this conversation as resolved
abereziny reviewed 2024-05-13 10:58:09 +00:00
@ -0,0 +43,4 @@
def test_container_metrics(self, object_size: ObjectSize, default_wallet: WalletInfo, cluster: Cluster):
wallet = default_wallet
if object_size.name == "complex":
Member

I'd suggest to make it more clear and universal like this

file_path = generate_file(object_size.value)
copies = 2
object_chunks  = 0
head_objects = 1
link_objects = 0
if object_size.value > max_object_size:
            object_chunks = math.ceil(object_size.value / max_object_size)
            link_objects = 1
tombstones  = head_objects + link_objects

And then use the appropriate counts in asserts like
(object_chunks + head_object + link_object) * copies

It will be much clearer where numbers came from

I'd suggest to make it more clear and universal like this ``` file_path = generate_file(object_size.value) copies = 2 object_chunks = 0 head_objects = 1 link_objects = 0 if object_size.value > max_object_size: object_chunks = math.ceil(object_size.value / max_object_size) link_objects = 1 tombstones = head_objects + link_objects ``` And then use the appropriate counts in asserts like `(object_chunks + head_object + link_object) * copies` It will be much clearer where numbers came from
abereziny marked this conversation as resolved
abereziny reviewed 2024-05-13 11:03:04 +00:00
@ -0,0 +86,4 @@
with reporter.step("Check metrics(Phy, Logic, User) in each nodes"):
self.check_sum_counter_metrics_in_nodes(cluster.cluster_nodes, cid, phy_exp=4, logic_exp=4, user_exp=0)
delete_container(wallet, cid, shell=self.shell, endpoint=self.cluster.default_rpc_endpoint)
Member

with reporter.step("Delete container"):

with reporter.step("Delete container"):
Author
Member

in the define function delete_container there is @reporter.step("Delete Container")
do I need to duplicate this message inside the test?

in the define function delete_container there is `@reporter.step("Delete Container")` do I need to duplicate this message inside the test?
Member

Yes, for better readability of test body.
Also, internal steps may contain dynamic info, may change in future or be absent

Yes, for better readability of test body. Also, internal steps may contain dynamic info, may change in future or be absent
JuliaKovshova reviewed 2024-05-14 07:17:47 +00:00
@ -0,0 +13,4 @@
@pytest.mark.container
@pytest.mark.sanity
Member

These are not sanity tests

These are not sanity tests
abereziny marked this conversation as resolved
i.niyazov force-pushed add-test-container-metric from ce1b9aec12 to 2eb0a23863 2024-05-14 12:03:49 +00:00 Compare
abereziny approved these changes 2024-05-14 20:37:41 +00:00
abereziny reviewed 2024-05-14 20:39:46 +00:00
@ -0,0 +42,4 @@
result = re.findall(rf'type="{metric_type}"}}\s(\d+)', metric_result_stdout)
return sum(map(int, result))
@allure.title("Container metrics (obj_size={object_size}, policy={placement_policy})")
Member

, policy={placement_policy} is redundant, there is no such parameter in this test

`, policy={placement_policy}` is redundant, there is no such parameter in this test
abereziny marked this conversation as resolved
anikeev-yadro approved these changes 2024-05-15 06:56:36 +00:00
i.niyazov force-pushed add-test-container-metric from 2eb0a23863 to 3941619431 2024-05-15 08:18:50 +00:00 Compare
abereziny approved these changes 2024-05-15 08:30:25 +00:00
abereziny requested review from qa-committers 2024-05-15 08:32:03 +00:00
abereziny requested review from qa-developers 2024-05-15 08:32:04 +00:00
anikeev-yadro approved these changes 2024-05-15 09:49:44 +00:00
abereziny merged commit 3941619431 into master 2024-05-15 10:31:04 +00:00
abereziny referenced this pull request from a commit 2024-05-15 10:31:21 +00:00
abereziny referenced this pull request from a commit 2024-05-16 08:18:38 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
4 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/frostfs-testcases#228
No description provided.