Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update configuration for the REST gateway #792

Merged
merged 3 commits into from
Apr 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ $ make venv.pytest
$ . venv.pytest/bin/activate
```

If you want to exit from the current venv for any reason, use the `deactivate` command.

3. Setup pre-commit hooks to run code formatters on staged files before you run a `git commit` command:

```shell
Expand Down Expand Up @@ -93,6 +95,19 @@ Make sure that the virtualenv is activated, then execute the following command t
$ pytest --alluredir my-allure-123 -s -k test_get_object_api pytest_tests/tests/object/test_object_api.py
```

If you are going to run tests several times in the same dev environment,
you can use the `--persist-env` key to initiate keeping the test environment.
As a result, you'll find something like `Persist env at: env_files/*` in the report.
For example:
```shell
[MainThread] 2024-04-27 18:31:55 [INFO] Persist env at: env_files/persisted_env_awxyrbxdwu
```
After that, you can run tests faster by adding the `--load-env` flag along with
the received value. This way you won't waste time redeploy the environment.
For example:
```shell
pytest --alluredir my-allure-234 -s pytest_tests/tests/services/rest_gate/test_rest_bearer.py --load-env env_files/persisted_env_awxyrbxdwu
```
If anything goes wrong, first advice is to check .github/workflows/run-tests.yml, to ensure you've done all required steps.

3. Generate report
Expand Down
32 changes: 20 additions & 12 deletions neofs-testlib/neofs_testlib/env/templates/rest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,32 @@ pool:
error-threshold: 100

server:
# The listeners to enable, this can be repeated and defaults to the schemes in the swagger spec.
scheme: [ http ]
endpoints:
# The IP and port to listen on.
- address: {{ address }}
tls:
# Use TLS for a gRPC connection (min version is TLS 1.2).
enabled: false
# The certificate file to use for secure connections.
certificate: /path/to/tls/cert
# The private key file to use for secure connections (without passphrase).
key: /path/to/tls/key
# The certificate authority certificate file to be used with mutual tls auth.
ca-certificate: /path/to/tls/ca
# Sets the TCP keep-alive timeouts on accepted connections.
# It prunes dead TCP connections ( e.g. closing laptop mid-download).
keep-alive: 3m
# Maximum duration before timing out read of the request.
read-timeout: 30s
# Maximum duration before timing out write of the response.
write-timeout: 30s

# Grace period for which to wait before killing idle connections
cleanup-timeout: 10s
# Grace period for which to wait before shutting down the server
graceful-timeout: 15s
# Controls the maximum number of bytes the server will read parsing the request header's keys and values,
# including the request line. It does not limit the size of the request body.
max-header-size: 1000000

# The IP and port to listen on.
listen-address: {{ address }}
# Limit the number of outstanding requests.
listen-limit: 0
# Sets the TCP keep-alive timeouts on accepted connections.
# It prunes dead TCP connections ( e.g. closing laptop mid-download).
keep-alive: 3m
# Maximum duration before timing out read of the request.
read-timeout: 30s
# Maximum duration before timing out write of the response.
write-timeout: 30s
Loading