k.sosnovskikh
Find a file
Vladimir Domnich 6e23e7d454 Simplify test checks and fixtures:
Remove default SSH key path.
Replace multiple fixtures for file generation with single function.
Rename references to keyword modules.
Update pytest test cases to be consistent with new keywords.
Remove gas balance checks from container operations.
Add logic to run initial gas transfer only if storage is not free.
Remove robot testsuites for s3 and http gateways.
S3 and http tests are covered and will be maintained in the future in pytest.

Signed-off-by: Vladimir Domnich <v.domnich@yadro.com>
2022-07-08 17:45:32 +03:00
build_assets [#145][#153]: added neofs-keywords as a module 2022-02-17 14:34:47 +03:00
configuration added yaml configuration file for devenv 2022-06-30 18:11:39 +03:00
neofs-keywords@f66be076ac robot: Use hyphens in hostnames (#175) 2022-03-04 16:37:24 +03:00
neofs_cli_configs small fixes after [#237] 2022-06-29 16:30:45 +03:00
pytest_tests Simplify test checks and fixtures: 2022-07-08 17:45:32 +03:00
robot Simplify test checks and fixtures: 2022-07-08 17:45:32 +03:00
venv Add pytest tests. 2022-07-08 17:45:32 +03:00
.flake8 Add pytest tests. 2022-07-08 17:45:32 +03:00
.gitignore (#111): python virtualenv for users 2021-09-08 12:34:09 +03:00
.gitmodules fixes and refactoring in HTTP and S3 tests 2022-03-14 10:16:06 +03:00
Makefile Remove dockerfile and removed docker run command from Makefile to keep testcases environment agnostic. 2022-07-08 17:45:32 +03:00
README.md updated README.md 2022-05-17 15:07:14 +03:00
requirements.txt [#103] Test to check eACL filter keys for objects 2021-11-24 16:54:00 +03:00
venv_template.mk python3.8 -> python3.9 in venv.localtest 2022-05-16 12:58:57 +03:00

Testcases execution

Initial preparation

  1. Install neofs-cli

    • git clone git@github.com:nspcc-dev/neofs-node.git
    • cd neofs-node
    • make
    • sudo cp bin/neofs-cli /usr/local/bin/neofs-cli
  2. Install neofs-authmate

    • git clone git@github.com:nspcc-dev/neofs-s3-gw.git
    • cd neofs-s3-gw
    • make
    • sudo cp bin/neofs-authmate /usr/local/bin/neofs-authmate
  3. Install neo-go

    • git clone git@github.com:nspcc-dev/neo-go.git
    • cd neo-go
    • git checkout v0.92.0 (or the current version in the neofs-dev-env)
    • make
    • sudo cp bin/neo-go /usr/local/bin/neo-go or download binary from releases: https://github.com/nspcc-dev/neo-go/releases
  4. Clone neofs-dev-env git clone git@github.com:nspcc-dev/neofs-dev-env.git

Note that we expect neofs-dev-env to be located under the <testcases_root_dir>/../neofs-dev-env directory. If you put this repo in any other place, manually set the full path to neofs-dev-env in the environment variable DEVENV_PATH at this step.

  1. Make sure you have installed all of the following prerequisites on your machine
make
python3.9
python3.9-dev
libssl-dev

As we use neofs-dev-env, you'll also need to install prerequisites of this repository.

  1. Build virtual env

In the cloned neofs-testcases repo execute the following commands:

make venv.localtest
. venv.localtest/bin/activate

Test cases are designed to run on Python 3.9.

Run

To run an arbitrary UserScenario or testcase, you need to run the command: robot --outputdir artifacts/ robot/testsuites/integration/<UserScenario> or robot --outputdir artifacts/ robot/testsuites/integration/<UserScenario>/<testcase>.robot

Generation of documentation

To generate Keywords documentation:

python3 -m robot.libdoc robot/resources/lib/neofs.py docs/NeoFS_Library.html
python3 -m robot.libdoc robot/resources/lib/payment_neogo.py docs/Payment_Library.html

To generate testcases documentation:

python3 -m robot.testdoc robot/testsuites/integration/ docs/testcases.html

Testcases implementation

Source code overview

robot/ - Files related/depended on Robot Framework.

robot/resources/ - All resources (Robot Framework Keywords, Python Libraries, etc) which could be used for creating test suites.

robot/resources/lib/ - Common Python Libraries depended on Robot Framework (with Keywords). For example neofs.py, payment.py.

robot/variables/ - All variables for tests. It is possible to add the auto-loading logic of parameters from the smart-contract in the future. Contain python files.

robot/testsuites/ - Robot TestSuites and TestCases.

robot/testsuites/integration/ - Integration test suites and testcases

Code style

Robot Framework keyword should use space as a separator between particular words

The name of the library function in Robot Framework keyword usage and the name of the same function in the Python library must be identical.

The name of GLOBAL VARIABLE must be in UPPER CASE, the underscore ('_')' symbol must be used as a separator between words.

The name of local variable must be in lower case, the underscore symbol must be used as a separator between words.

The names of Python variables, functions and classes must comply with accepted rules, in particular: Name of variable/function must be in lower case with underscore symbol between words Name of class must start with a capital letter. It is not allowed to use underscore symbol in name, use capital for each particular word. For example: NeoFSConf

Name of other variables should not be ended with underscore symbol

On keywords definition, one should specify variable type, e.g. path: str

Robot style

You should always complete the [Tags] and [Documentation] sections for Testcases and Documentation for Test Suites.

Robot-framework User Guide

http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html