diff --git a/README.md b/README.md index 5aea41527..7853c9e82 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 diff --git a/neofs-testlib/neofs_testlib/env/templates/rest.yaml b/neofs-testlib/neofs_testlib/env/templates/rest.yaml index 791a8f63f..ba3d4f594 100644 --- a/neofs-testlib/neofs_testlib/env/templates/rest.yaml +++ b/neofs-testlib/neofs_testlib/env/templates/rest.yaml @@ -24,8 +24,26 @@ 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 @@ -33,15 +51,5 @@ server: # 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