Skip to content

Commit

Permalink
tests: adapt rest gw tests to update network info
Browse files Browse the repository at this point in the history
closes #882

Signed-off-by: Evgeniy Zayats <zayatsevgeniy@nspcc.io>
  • Loading branch information
Evgeniy Zayats committed Oct 24, 2024
1 parent 4a25bd2 commit d4271c4
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 3 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,24 @@ jobs:
make build
working-directory: xk6-neofs

- name: Checkout neofs-rest-gw repository
uses: actions/checkout@v4
with:
ref: master
path: neofs-rest-gw

- name: Build neofs-rest-gw
run: |
make all
working-directory: neofs-rest-gw

- name: Copy and chmod built neofs-rest-gw
timeout-minutes: 30
run: |
cp ../neofs-rest-gw/bin/* .
sudo chmod a+x neofs-rest-gw
working-directory: neofs-rest-gw

- name: Prepare venv
id: prepare_venv
timeout-minutes: 30
Expand Down
16 changes: 13 additions & 3 deletions pytest_tests/tests/services/rest_gate/test_rest_system_header.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from helpers.neofs_verbs import get_netmap_netinfo, get_object_from_random_node, head_object
from helpers.rest_gate import (
attr_into_str_header,
get_epoch_duration_via_rest_gate,
try_to_get_object_and_expect_error,
upload_via_rest_gate,
)
Expand Down Expand Up @@ -251,7 +252,10 @@ def test_http_attr_priority_dur_timestamp(
):
self.tick_epochs_and_wait(1)
epoch_count = 2
expected_epoch = neofs_epoch.get_epoch(self.neofs_env) + epoch_count
if self.neofs_env.rest_gw._get_version() <= "0.11.0":
expected_epoch = neofs_epoch.get_epoch(self.neofs_env) + epoch_count
else:
expected_epoch = int(get_epoch_duration_via_rest_gate(gw_endpoint)) + epoch_count
logger.info(
f"epoch duration={epoch_duration}, current_epoch= {neofs_epoch.get_epoch(self.neofs_env)} expected_epoch {expected_epoch}"
)
Expand Down Expand Up @@ -307,7 +311,10 @@ def test_http_attr_priority_timestamp_rfc(
):
self.tick_epochs_and_wait(1)
epoch_count = 2
expected_epoch = neofs_epoch.get_epoch(self.neofs_env) + epoch_count
if self.neofs_env.rest_gw._get_version() <= "0.11.0":
expected_epoch = neofs_epoch.get_epoch(self.neofs_env) + epoch_count
else:
expected_epoch = int(get_epoch_duration_via_rest_gate(gw_endpoint)) + epoch_count
logger.info(
f"epoch duration={epoch_duration}, current_epoch= {neofs_epoch.get_epoch(self.neofs_env)} expected_epoch {expected_epoch}"
)
Expand Down Expand Up @@ -363,7 +370,10 @@ def test_http_rfc_object_unavailable_after_expir(
):
self.tick_epochs_and_wait(1)
epoch_count = 2
expected_epoch = neofs_epoch.get_epoch(self.neofs_env) + epoch_count
if self.neofs_env.rest_gw._get_version() <= "0.11.0":
expected_epoch = neofs_epoch.get_epoch(self.neofs_env) + epoch_count
else:
expected_epoch = int(get_epoch_duration_via_rest_gate(gw_endpoint)) + epoch_count
logger.info(
f"epoch duration={epoch_duration}, current_epoch= {neofs_epoch.get_epoch(self.neofs_env)} expected_epoch {expected_epoch}"
)
Expand Down

0 comments on commit d4271c4

Please sign in to comment.