forked from cosmos/cosmos-sdk
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(systemtests): Extract system test framework (cosmos#22578)
Co-authored-by: marbar3778 <marbar3778@yahoo.com>
- Loading branch information
1 parent
f153426
commit 14d98d2
Showing
38 changed files
with
2,266 additions
and
676 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<!-- | ||
Guiding Principles: | ||
Changelogs are for humans, not machines. | ||
There should be an entry for every single version. | ||
The same types of changes should be grouped. | ||
Versions and sections should be linkable. | ||
The latest version comes first. | ||
The release date of each version is displayed. | ||
Mention whether you follow Semantic Versioning. | ||
Usage: | ||
Changelog entries are generated by git cliff ref: https://github.com/orhun/git-cliff | ||
Each commit should be conventional, the following message groups are supported. | ||
* feat: A new feature | ||
* fix: A bug fix | ||
* docs: Documentation only changes | ||
* style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc) | ||
* refactor: A code change that neither fixes a bug nor adds a feature | ||
* perf: A code change that improves performance | ||
* test: Adding missing tests or correcting existing tests | ||
* build: Changes that affect the build system or external dependencies (example scopes: go, npm) | ||
* ci: Changes to our CI configuration files and scripts (example scopes: GH Actions) | ||
* chore: Other changes that don't modify src or test files | ||
* revert: Reverts a previous commit | ||
When a change is made that affects the API or state machine, the commit message prefix should be suffixed with `!`. | ||
Ref: https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json | ||
--> | ||
|
||
# Changelog | ||
|
||
## [Unreleased] | ||
|
||
### Features | ||
|
||
* [#22578](https://github.com/cosmos/cosmos-sdk/pull/22578) Extract system test framework |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# System Tests | ||
|
||
This package contains the testing framework for black-box system tests. It includes a test runner that sets up a | ||
multi-node blockchain locally for use in tests. The framework provides utilities and helpers for easy access and | ||
setup in tests. | ||
|
||
## Components | ||
|
||
- **CLI**: Command-line interface wrapper for interacting with the chain or keyring | ||
- **Servers**: Server instances to run the blockchain environment. | ||
- **Events**: Event listeners | ||
- **RPC**: Remote Procedure Call setup for communication. | ||
|
||
## Dependencies | ||
|
||
- **testify**: Testing toolkit. | ||
- **gjson**: JSON parser. | ||
- **sjson**: JSON modifier. | ||
|
||
Server and client-side operations are executed on the host machine. | ||
|
||
## Developer | ||
|
||
### Test strategy | ||
|
||
System tests cover the full stack via cli and a running (multi node) network. They are more expensive (in terms of time/ cpu) | ||
to run compared to unit or integration tests. | ||
Therefore, we focus on the **critical path** and do not cover every condition. | ||
|
||
## How to use | ||
|
||
Read the [getting_started.md](../tests/systemtests/getting_started.md) guide to get started. | ||
|
||
### Execute a single test | ||
|
||
```sh | ||
go test -tags system_test -count=1 -v . --run TestStakeUnstake -verbose | ||
``` | ||
|
||
Test cli parameters | ||
|
||
* `-verbose` verbose output | ||
* `-wait-time` duration - time to wait for chain events (default 30s) | ||
* `-nodes-count` int - number of nodes in the cluster (default 4) | ||
|
||
# Port ranges | ||
|
||
With *n* nodes: | ||
|
||
* `26657` - `26657+n` - RPC | ||
* `1317` - `1317+n` - API | ||
* `9090` - `9090+n` - GRPC | ||
* `16656` - `16656+n` - P2P | ||
|
||
For example Node *3* listens on `26660` for RPC calls | ||
|
||
## Resources | ||
|
||
* [gjson query syntax](https://github.com/tidwall/gjson#path-syntax) | ||
|
||
## Disclaimer | ||
|
||
This is based on the system test framework in [wasmd](https://github.com/CosmWasm/wasmd) built by Confio. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.