diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 112fea72e..dbb0a88fb 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -45,7 +45,7 @@ jobs: ./qa/bin/functional run ./sbin/exabgp decode FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF:003C:02:0000001C4001010040020040030465016501800404000000C840050400000064000000002001010101 ./sbin/exabgp decode --configuration etc/exabgp/conf-bgpls.conf --nlri "00 02 FF FF 03 00 00 00 00 00 00 00 00 01 00 00 20 02 00 00 04 00 00 00 01 02 01 00 04 c0 a8 7a 7e 02 02 00 04 00 00 00 00 02 03 00 04 0a 0a 0a 0a 01 01 00 20 02 00 00 04 00 00 00 01 02 01 00 04 c0 a8 7a 7e 02 02 00 04 00 00 00 00 02 03 00 04 0a 02 02 02" - env exabgp_log_enable=false nosetests --with-coverage ./tests/*_test.py + env exabgp_log_enable=false pytest --cov --cov-reset ./tests/*_test.py # - name: Coveralls # run: | diff --git a/.gitignore b/.gitignore index 553cc186b..d4321fcab 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ __pycache__/ /dist/ /sdist/ /cover/ +/htmlcov/ *.sln diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b399411bc..24ae449a9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -62,7 +62,7 @@ People *love* thorough and clear bug reports. It make a big difference. ``` ./qa/bin/functional run ./qa/bin/parsing -env exabgp_log_enable=false nosetests --with-coverage ./tests/*_test.py +env exabgp_log_enable=false pytest --with-coverage ./tests/*_test.py env exabgp_tcp_bind='' ./sbin/exabgp ./etc/exabgp/api-open.conf --decode FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF:003C:02:0000001C4001010040020040030465016501800404000000C840050400000064000000002001010101 ``` diff --git a/Makefile b/Makefile index 436ded26d..b62530bee 100644 --- a/Makefile +++ b/Makefile @@ -37,7 +37,7 @@ test: poetry.lock ./qa/bin/parsing ./qa/bin/functional run ./sbin/exabgp decode -c ./etc/exabgp/api-open.conf FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF:003C:02:0000001C4001010040020040030465016501800404000000C840050400000064000000002001010101 - env exabgp_log_enable=false nosetests --with-coverage ./tests/*_test.py + env exabgp_log_enable=false pytest --cov --cov-reset ./tests/*_test.py syntax: poetry.lock @echo "Target syntax" diff --git a/README.md b/README.md index 2f4e59c25..8da52d635 100644 --- a/README.md +++ b/README.md @@ -265,17 +265,17 @@ shell2# ./qa/bin/functional client 03 ``` A test suite is also present to complement the functional testing. +(`pip3 install pytest pytest-cov`) ```sh -# env exabgp_log_enable=false nosetests --with-coverage ./tests/*_test.py +# env exabgp_log_enable=false pytest --cov --cov-reset ./tests/*_test.py ``` -(nosetest requires nose `pip install nose` or `pip3 install nose`) -You can decode UPDATE messages using ExaBGP `--decode` argument. +You can decode UPDATE messages using ExaBGP `decode` option. ```sh -# env exabgp_tcp_bind='' ./sbin/exabgp ./etc/exabgp/api-open.conf --decode FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF:003C:02:0000001C4001010040020040030465016501800404000000C840050400000064000000002001010101 +# env exabgp_tcp_bind='' ./sbin/exabgp decode -c ./etc/exabgp/api-open.conf FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF:003C:02:0000001C4001010040020040030465016501800404000000C840050400000064000000002001010101 ``` ```json 21:24:59 | 37750 | parser | update json { "exabgp": "4.0.1", "time": 1560371099.404008, "host" : "ptr-41.212.219.82.rev.exa.net.uk", "pid" : 37750, "ppid" : 10834, "counter": 1, "type": "update", "neighbor": { "address": { "local": "127.0.0.1", "peer": "127.0.0.1" }, "asn": { "local": 1, "peer": 1 } , "direction": "in", "message": { "update": { "attribute": { "origin": "igp", "med": 200, "local-preference": 100 }, "announce": { "ipv4 unicast": { "101.1.101.1": [ { "nlri": "1.1.1.1/32", "path-information": "0.0.0.0" } ] } } } } } } diff --git a/pyproject.toml b/pyproject.toml index 8e76f85c6..df31c4685 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -57,17 +57,17 @@ flake8 = "^3.8.3" flake8-bugbear = "^20.11.1" flakehell = "^0.9.0" isort = "^5.7.0" -nose = "^1.3.7" pex = { version="^2.1.28", python = ">=3.7,<3.10" } psutil = "^5.7.2" pudb = "^2019.2" pytest = "^7.0.0" +pytest-cov = "^3.0.0" wheel = "^0.35.1" mistune = { version="<2.0.0" } [tool.poetry.extras] debug = ["pudb"] -developer = ["pudb", "flake8", "coveralls", "nose", "psutil", "pytest"] +developer = ["pudb", "flake8", "coveralls", "pytest", "pytest-cov", "psutil"] [tool.poetry.scripts] exabgp = 'exabgp.application.main:main' diff --git a/qa/bin/cover b/qa/bin/cover index 4608acbf0..c9831a20b 100755 --- a/qa/bin/cover +++ b/qa/bin/cover @@ -1,2 +1,2 @@ #/bin/sh -nosetests --cover-erase --with-coverage --cover-html --pdb +env exabgp_log_enable=false pytest --cov --cov-reset --cov-report=html ./tests/*_test.py