2020-12-16 11:19:24 +00:00
## Testcases execution
2020-07-01 02:28:31 +00:00
2020-12-16 11:19:24 +00:00
### Initial preparation
2020-12-11 11:35:02 +00:00
2021-01-17 11:55:10 +00:00
1. Install neofs-cli
2020-12-11 11:35:02 +00:00
- `git clone git@github.com:nspcc-dev/neofs-node.git`
2021-01-17 11:55:10 +00:00
- `cd neofs-node`
2020-12-11 11:35:02 +00:00
- `make`
2021-01-17 11:55:10 +00:00
- `sudo cp bin/neofs-cli /usr/local/bin/neofs-cli` , add alias path to
bin/neofs-cli or run `export NEOFS_CLI_EXEC=<path_to_binary>`
2020-12-11 11:35:02 +00:00
2020-12-16 11:19:24 +00:00
2. Install cdn-authmate
2020-12-11 11:35:02 +00:00
- `git clone git@github.com:nspcc-dev/cdn-authmate.git`
- `cd cdn-authmate`
- `make build`
2021-01-17 11:55:10 +00:00
- `sudo cp bin/cdn-authmate /usr/local/bin/cdn-authmate` , add alias path to
bin/cdn-authmate or run `export CDNAUTH_EXEC=<path_to_binary>`
2020-12-11 11:35:02 +00:00
2021-02-01 16:43:35 +00:00
3. Install neo-go
- `git clone git@github.com:nspcc-dev/neo-go.git`
- `cd neo-go`
- `make`
- `sudo cp bin/neo-go /usr/local/bin/neo-go` , add alias path to bin/neo-go
or run `export NEOGO_CLI_EXEC=<path_to_binary>`
4. Install Testcases dependencies
2021-01-17 11:55:10 +00:00
- `pip3 install -r requirements.txt`
2020-07-01 02:28:31 +00:00
2020-12-16 11:19:24 +00:00
(replace pip3 with the appropriate python package manager on the system).
2020-07-01 02:28:31 +00:00
2020-12-16 11:19:24 +00:00
In this case, dev-env should be running with the tested environment.
2020-07-01 02:28:31 +00:00
2020-12-16 11:19:24 +00:00
### Run
2020-12-11 11:35:02 +00:00
2020-12-16 11:19:24 +00:00
1. Execute the command `make run`
2020-12-11 11:35:02 +00:00
2020-12-16 11:19:24 +00:00
2. Logs will be available in the artifacts/ directory after tests with any of the statuses are completed.
2020-07-01 02:28:31 +00:00
2020-12-16 11:19:24 +00:00
### Running an arbitrary test case
2020-11-28 22:16:52 +00:00
2020-12-16 11:19:24 +00:00
To run an arbitrary testcase, you need to run the command:
2020-12-29 19:55:33 +00:00
`robot --outputdir artifacts/ robot/testsuites/integration/<testsuite name>.robot `
2020-08-13 22:09:00 +00:00
2020-12-16 11:19:24 +00:00
The following scripts are available for execution:
2020-11-29 00:51:38 +00:00
2021-01-17 11:55:10 +00:00
* acl_basic.robot
* acl_extended.robot
* acl_baearer.robot
* object_complex.robot
* object_simple.robot
* withdraw.robot
* netmap_simple.robot
* replication.robot
* http_gate.robot
* s3_gate.robot
2020-08-13 22:09:00 +00:00
2020-11-28 22:16:52 +00:00
2020-12-16 11:19:24 +00:00
## Smoke test execution
2020-07-01 02:28:31 +00:00
2020-12-16 11:19:24 +00:00
There is a suite with smoke tests for CDN gates `robot/testsuites/smoke/selectelcdn_smoke.robot` .
2020-07-01 02:28:31 +00:00
2020-12-16 11:19:24 +00:00
By default, keywords use variables from a file `robot/resources/lib/neofs_int_vars.py` .
2020-07-01 02:28:31 +00:00
```
2020-12-11 11:35:02 +00:00
robot --outputdir artifacts/ robot/testsuites/smoke/selectelcdn_smoke.robot
2020-07-01 02:28:31 +00:00
```
2020-11-28 22:16:52 +00:00
2020-12-16 11:19:24 +00:00
### Initial preparation
2020-11-30 10:53:28 +00:00
2020-12-16 11:19:24 +00:00
1. It requires separate variables, unlike the NeoFS suites, which run on
dev-env. In order for the keyword libraries to use them, you need to set the environment variable
2020-11-30 10:53:28 +00:00
```
export ROBOT_PROFILE=selectel_smoke
```
2020-12-11 11:35:02 +00:00
2020-12-16 11:19:24 +00:00
Dev-env is not needed. But you need to install neo-go.
2020-12-11 11:35:02 +00:00
2021-02-01 16:43:35 +00:00
2. To run smoke test: `robot --outputdir artifacts/ robot/testsuites/smoke/selectelcdn_smoke.robot`
2020-11-30 10:53:28 +00:00
2020-11-28 23:17:36 +00:00
2020-12-16 11:19:24 +00:00
## Generation of documentation
To generate Keywords documentation:
2020-11-28 23:17:36 +00:00
```
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
```
2020-12-16 11:19:24 +00:00
To generate testcases documentation:
2020-11-28 23:17:36 +00:00
```
python3 -m robot.testdoc robot/testsuites/integration/ docs/testcases.html
```
2020-12-16 11:19:24 +00:00
## Testcases implementation
2020-11-28 22:16:52 +00:00
### 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.
2020-12-16 11:19:24 +00:00
`robot/testsuites/` - Robot TestSuites and TestCases.
2020-11-28 22:16:52 +00:00
2020-12-16 11:19:24 +00:00
`robot/testsuites/integration/` - Integration test suites and testcases
2020-11-28 22:16:52 +00:00
2020-12-16 11:19:24 +00:00
`robot/testsuites/fi/` - Fault Injection testsuites and testcases
2020-11-28 22:16:52 +00:00
2020-11-29 00:46:53 +00:00
### Code style
2020-11-28 22:16:52 +00:00
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
2020-11-29 00:46:53 +00:00
### Robot style
2020-11-28 22:16:52 +00:00
2020-12-16 11:19:24 +00:00
You should always complete the [Tags] and [Documentation] sections for Testcases and Documentation for Test Suites.
2020-11-28 22:16:52 +00:00
2020-11-29 00:46:53 +00:00
### Robot-framework User Guide
2020-11-28 22:16:52 +00:00
2020-11-30 10:53:28 +00:00
http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html