load_time in the format of days, hours and minutes #156

Merged
abereziny merged 1 commit from EliChin/frostfs-testlib:feature/load into master 2024-01-12 16:37:42 +00:00
Member

Signed-off-by: Liza e.chichindaeva@yadro.com

Signed-off-by: Liza <e.chichindaeva@yadro.com>
EliChin force-pushed feature/load from cd07e895e7 to de7aaeacfc 2024-01-11 16:51:09 +00:00 Compare
EliChin requested review from qa-committers 2024-01-11 16:52:02 +00:00
EliChin requested review from qa-developers 2024-01-11 16:52:02 +00:00
EliChin changed title from [OBJECT-4944] load_time in the format of days, hours and minutes to load_time in the format of days, hours and minutes 2024-01-12 07:22:09 +00:00
EliChin force-pushed feature/load from de7aaeacfc to 259cf9f80d 2024-01-12 10:55:23 +00:00 Compare
abereziny reviewed 2024-01-12 11:16:28 +00:00
@ -201,3 +201,3 @@
# ------- COMMON SCENARIO PARAMS -------
# Load time is the maximum duration for k6 to give load. Default is the BACKGROUND_LOAD_DEFAULT_TIME value.
load_time: Optional[int] = metadata_field(all_load_scenarios, None, "DURATION", False)
load_time: Optional[str] = metadata_field(all_load_scenarios, None, "DURATION", False)
Member

Optional[Union[int, str]]

`Optional[Union[int, str]]`
abereziny marked this conversation as resolved
abereziny reviewed 2024-01-12 11:23:21 +00:00
@ -531,6 +531,15 @@ class TestLoadConfig:
self._check_env_vars(load_params, expected_env_vars)
def test_convert_time_to_seconds(self, load_params: LoadParams):
Member

Change all of this to

    @pytest.mark.parametrize(
        "load_params, load_type",
        [(LoadScenario.gRPC, LoadType.gRPC)],
        indirect=True,
    )
    @pytest.mark.parametrize("load_time, expected_seconds", 
                             [(300, 300), 
                              ("2d3h45min", 186300), 
                              ("1d6h", 108000),
                              ("1d", 86400),
                              ("1d1min", 86460),
                              ("2h", 7200),
                              ("2h2min", 7320)])
    def test_convert_time_to_seconds(self, load_params: LoadParams, load_time: str | int, expected_seconds: int):    
        load_params.load_time = load_time
        time_in_seconds = load_params.convert_time_to_seconds()
        assert time_in_seconds == expected_seconds
Change all of this to ``` @pytest.mark.parametrize( "load_params, load_type", [(LoadScenario.gRPC, LoadType.gRPC)], indirect=True, ) @pytest.mark.parametrize("load_time, expected_seconds", [(300, 300), ("2d3h45min", 186300), ("1d6h", 108000), ("1d", 86400), ("1d1min", 86460), ("2h", 7200), ("2h2min", 7320)]) def test_convert_time_to_seconds(self, load_params: LoadParams, load_time: str | int, expected_seconds: int): load_params.load_time = load_time time_in_seconds = load_params.convert_time_to_seconds() assert time_in_seconds == expected_seconds ```
abereziny marked this conversation as resolved
EliChin force-pushed feature/load from 259cf9f80d to b48e2aaa74 2024-01-12 13:33:26 +00:00 Compare
EliChin force-pushed feature/load from b48e2aaa74 to df8d99d83c 2024-01-12 13:45:44 +00:00 Compare
abereziny approved these changes 2024-01-12 13:47:07 +00:00
abereziny requested review from qa-committers 2024-01-12 13:47:12 +00:00
anikeev-yadro approved these changes 2024-01-12 16:04:41 +00:00
abereziny merged commit df8d99d83c into master 2024-01-12 16:37:42 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 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-testlib#156
No description provided.