-
Notifications
You must be signed in to change notification settings - Fork 36
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
Added cli validators test in pytest and CI for localnet dependent tests. #454
base: main
Are you sure you want to change the base?
Changes from 73 commits
c32d328
84efeb2
1685f02
f4e9c73
315e3b0
39be1b4
18d6c71
3f825a2
99a198d
3d2be36
beef139
95f1a15
23b9961
ef9cdb2
5043947
4953eaa
a5ccb03
7e889f1
0af4d95
05a7e57
ec17dda
1a4fe12
900530f
17a08cf
8359cbb
b43c31a
bbe93e7
ad7e421
bfe909f
83b76aa
8804754
d3d0d5c
9f9b8c0
79392ad
d3f707d
adaf45a
28fa958
0e46464
7045c32
5f0f807
7a1c8cb
6d2888e
685ca9e
7bdab1a
343ba6b
bf164f6
e8137fa
3fb2a0e
af2c955
c7d799f
5a274c4
42c1260
1ba5d85
25760e9
fe180f0
61bf291
4ce863e
380c08b
58e29a0
31b6563
92e6386
e8c89e1
0080690
69404f0
c2adbf2
1b1a414
4067411
572725d
eb42289
10ffa3c
d382db0
7ab16ba
ca1d4fd
8d2ee9a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: Test localnet-dependent tests | ||
|
||
on: | ||
pull_request: | ||
branches: [main, feat/*] | ||
workflow_dispatch: | ||
|
||
env: | ||
BRANCH_NAME: ${{ github.head_ref || github.ref_name }} | ||
|
||
jobs: | ||
localnet: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest] | ||
python-version: [3.11] | ||
|
||
steps: | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install dependencies | ||
run: | | ||
python3 -m pip install --upgrade pip | ||
pip3 install -r requirements.txt | ||
pip3 install -r ./requirements-dev.txt --upgrade | ||
|
||
- name: Set up MultiversX localnet | ||
run: | | ||
mkdir -p ~/multiversx-sdk | ||
export PYTHONPATH=. | ||
python3 -m multiversx_sdk_cli.cli localnet prerequisites --configfile=./multiversx_sdk_cli/tests/testdata/localnet_with_resolution_remote.toml | ||
python3 -m multiversx_sdk_cli.cli localnet build --configfile=./multiversx_sdk_cli/tests/testdata/localnet_with_resolution_remote.toml | ||
|
||
# "Go" and artifacts from "GOPATH/pkg/mod" are not needed anymore. | ||
sudo rm -rf ~/multiversx-sdk/golang | ||
|
||
python3 -m multiversx_sdk_cli.cli localnet clean --configfile=./multiversx_sdk_cli/tests/testdata/localnet_with_resolution_remote.toml | ||
python3 -m multiversx_sdk_cli.cli localnet config --configfile=./multiversx_sdk_cli/tests/testdata/localnet_with_resolution_remote.toml | ||
nohup python3 -m multiversx_sdk_cli.cli localnet start --configfile=./multiversx_sdk_cli/tests/testdata/localnet_with_resolution_remote.toml > localnet.log 2>&1 & echo $! > localnet.pid | ||
sleep 120 | ||
|
||
- name: Test localnet dependent tests | ||
run: | | ||
pytest -m require_localnet . | ||
python3 -m multiversx_sdk_cli.cli localnet clean --configfile=./multiversx_sdk_cli/tests/testdata/localnet_with_resolution_remote.toml |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import pytest | ||
Check failure on line 1 in multiversx_sdk_cli/tests/conftest.py GitHub Actions / runner / mypy
|
||
|
||
|
||
# function executed right after test items collected but before test run | ||
def pytest_collection_modifyitems(config, items): | ||
if not config.getoption('-m'): | ||
skip_me = pytest.mark.skip(reason="require_localnet will only run if explicitly set to with -m") | ||
for item in items: | ||
if "require_localnet" in item.keywords: | ||
item.add_marker(skip_me) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,15 +3,14 @@ | |
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" | ||
USE_PROXY=$1 | ||
|
||
source ./shared.sh | ||
source ./test_cli_validators.sh && testAll | ||
|
||
testAll() { | ||
pushd $SCRIPT_DIR | ||
source ./shared.sh | ||
source ./test_cli_contracts.sh && testAll | ||
source ./test_cli_dns.sh && testAll | ||
|
||
if [ -n "$USE_PROXY" ]; then | ||
source ./test_cli_validators.sh && testAll | ||
source ./test_cli_tx.sh && testAll | ||
source ./test_cli_config.sh && testAll | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this can be removed together with the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. removed. |
||
fi | ||
popd | ||
|
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure why this is here and not in the
testAll
functionThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed.