diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 809bd0161..4bb584cd4 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -140,25 +140,13 @@ jobs: file: 'neofs-s3-authmate-linux-amd64' target: 'neofs-testcases/neofs-s3-authmate' - - name: Checkout neofs-rest-gw repository - uses: actions/checkout@v4 + - name: Download latest stable neofs-rest-gw + uses: dsaltares/fetch-gh-release-asset@1.1.1 with: - repository: nspcc-dev/neofs-rest-gw - ref: v0.9.0 - path: neofs-rest-gw - - - name: Build neofs-rest-gw - timeout-minutes: 5 - run: | - make all - echo "$(pwd)/bin" >> $GITHUB_PATH - working-directory: neofs-rest-gw - - - name: Copy built binaries - timeout-minutes: 30 - run: | - cp ../neofs-rest-gw/bin/neofs-rest-gw . - working-directory: neofs-testcases + repo: 'nspcc-dev/neofs-rest-gw' + version: 'tags/v0.10.0' + file: 'neofs-rest-gw-linux-amd64' + target: 'neofs-testcases/neofs-rest-gw' - name: Download latest stable neo-go uses: dsaltares/fetch-gh-release-asset@1.1.1 diff --git a/.gitignore b/.gitignore index da1e6db74..1483aa49c 100644 --- a/.gitignore +++ b/.gitignore @@ -38,3 +38,5 @@ neofs-node neofs-rest-gw neofs-s3-authmate neofs-s3-gw +neofs_env_*.zip +temp_files.zip diff --git a/neofs-testlib/neofs_testlib/env/templates/neofs_env_config.yaml b/neofs-testlib/neofs_testlib/env/templates/neofs_env_config.yaml index 3ab98d446..d01453486 100644 --- a/neofs-testlib/neofs_testlib/env/templates/neofs_env_config.yaml +++ b/neofs-testlib/neofs_testlib/env/templates/neofs_env_config.yaml @@ -36,7 +36,7 @@ binaries: neofs_rest_gw: repo: 'nspcc-dev/neofs-rest-gw' - version: 'v0.9.0' + version: 'v0.10.0' file: 'neofs-rest-gw-linux-amd64' neo_go: diff --git a/pytest_tests/tests/services/rest_gate/test_rest_streaming.py b/pytest_tests/tests/services/rest_gate/test_rest_streaming.py index 73c0294c5..48116f42b 100644 --- a/pytest_tests/tests/services/rest_gate/test_rest_streaming.py +++ b/pytest_tests/tests/services/rest_gate/test_rest_streaming.py @@ -2,12 +2,12 @@ import allure import pytest +import requests from helpers.container import create_container from helpers.file_helper import generate_file -from helpers.rest_gate import upload_via_rest_gate from helpers.wellknown_acl import PUBLIC_ACL -from rest_gw.rest_utils import get_object_and_verify_hashes from neofs_env.neofs_env_test_base import NeofsEnvTestBase +from rest_gw.rest_utils import get_object_and_verify_hashes logger = logging.getLogger("NeoLogger") @@ -54,7 +54,22 @@ def test_object_can_be_put_get_by_streaming(self, object_size: int, gw_endpoint) file_path = generate_file(object_size) with allure.step("Put objects and Get object and verify hashes [ get/$CID/$OID ]"): - oid = upload_via_rest_gate(cid=cid, path=file_path, endpoint=gw_endpoint) + # https://docs.python-requests.org/en/latest/user/advanced/#streaming-uploads + with open(file_path, "rb") as file: + resp = requests.post(f"{gw_endpoint}/objects/{cid}", data=file) + + if not resp.ok: + raise Exception( + f"""Failed to stream object via REST gate: + request: {resp.request.path_url}, + response: {resp.text}, + status code: {resp.status_code} {resp.reason}""" + ) + + assert resp.json().get("object_id"), f"OID found in response {resp}" + + oid = resp.json().get("object_id") + get_object_and_verify_hashes( oid=oid, file_name=file_path,