From e51b43af98888c1ae38c6a05793746430aa3af0a Mon Sep 17 00:00:00 2001 From: GTO90 Date: Tue, 17 Dec 2024 09:35:26 -0600 Subject: [PATCH] ci: Update CI workflow to include python3-zmq dependency and improve README formatting --- .../ci-coverage-ubuntu-full-qt-tests.yml | 4 +- ci/README.md | 28 ++++---- qa/README.md | 72 +++++++++++-------- 3 files changed, 57 insertions(+), 47 deletions(-) diff --git a/.github/workflows/ci-coverage-ubuntu-full-qt-tests.yml b/.github/workflows/ci-coverage-ubuntu-full-qt-tests.yml index 3862948dc8..eee92451f8 100644 --- a/.github/workflows/ci-coverage-ubuntu-full-qt-tests.yml +++ b/.github/workflows/ci-coverage-ubuntu-full-qt-tests.yml @@ -52,12 +52,12 @@ jobs: libboost-dev libboost-system-dev libboost-filesystem-dev libboost-test-dev \ libsqlite3-dev \ libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools \ - libqrencode-dev + libqrencode-dev python3-zmq - name: Install Python Packages if: steps.cache-pip.outputs.cache-hit != 'true' run: | - pip3 install pypandoc digibyte_scrypt + pip3 install pypandoc digibyte_scrypt pyzmq - name: Install BerkeleyDB if: steps.cache-db4.outputs.cache-hit != 'true' diff --git a/ci/README.md b/ci/README.md index 3c5f04c39e..afea0d9285 100644 --- a/ci/README.md +++ b/ci/README.md @@ -1,8 +1,8 @@ -## CI Scripts +# CI Scripts This directory contains scripts for each build step in each build stage. -### Running a Stage Locally +## Running a Stage Locally Be aware that the tests will be built and run in-place, so please run at your own risk. If the repository is not a fresh git clone, you might have to clean files from previous builds or test runs first. @@ -17,21 +17,21 @@ system in a virtual machine with a Linux operating system of your choice. To allow for a wide range of tested environments, but also ensure reproducibility to some extent, the test stage requires `docker` to be installed. To install all requirements on Ubuntu, run -``` -sudo apt install docker.io bash -``` + ```bash + sudo apt install docker.io bash + ``` To run the default test stage, -``` -./ci/test_run_all.sh -``` + ```bash + ./ci/test_run_all.sh + ``` To run the test stage with a specific configuration, -``` -FILE_ENV="./ci/test/00_setup_env_arm.sh" ./ci/test_run_all.sh -``` + ```bash + FILE_ENV="./ci/test/00_setup_env_arm.sh" ./ci/test_run_all.sh + ``` ### Configurations @@ -51,9 +51,9 @@ is used as the default configuration with fallback values. It is also possible to force a specific configuration without modifying the file. For example, -``` -MAKEJOBS="-j1" FILE_ENV="./ci/test/00_setup_env_arm.sh" ./ci/test_run_all.sh -``` + ```bash + MAKEJOBS="-j1" FILE_ENV="./ci/test/00_setup_env_arm.sh" ./ci/test_run_all.sh + ``` The files starting with `0n` (`n` greater than 0) are the scripts that are run in order. diff --git a/qa/README.md b/qa/README.md index 6ff4e85d6e..73b3c6f285 100644 --- a/qa/README.md +++ b/qa/README.md @@ -1,3 +1,5 @@ +# Testing + The [pull-tester](/qa/pull-tester/) folder contains a script to call multiple tests from the [rpc-tests](/qa/rpc-tests/) folder. @@ -5,41 +7,49 @@ Every pull request to the digibyte repository is built and run through the regression test suite. You can also run all or only individual tests locally. -Test dependencies -================= +## Test dependencies + Before running the tests, the following must be installed. -Unix ----- +## Unix + The python3-zmq library is required. On Ubuntu or Debian it can be installed via: -``` -sudo apt-get install python3-zmq -``` -OS X ------- -``` -pip3 install pyzmq -``` + ```bash + sudo apt-get install python3-zmq + ``` -Running tests -============= +## OS X + + ```bash + pip3 install pyzmq + ``` + +## Running tests You can run any single test by calling + ```bash qa/pull-tester/rpc-tests.py + ``` Or you can run any combination of tests by calling + ```bash qa/pull-tester/rpc-tests.py ... + ``` Run the regression test suite with + ```bash qa/pull-tester/rpc-tests.py + ``` Run all possible tests with + ```bash qa/pull-tester/rpc-tests.py -extended + ``` By default, tests will be run in parallel. To specify how many jobs to run, append `-parallel=n` (default n=4). @@ -48,17 +58,17 @@ If you want to create a basic coverage report for the rpc test suite, append `-- Possible options, which apply to each individual test run: -``` - -h, --help show this help message and exit - --nocleanup Leave digibyteds and test.* datadir on exit or error - --noshutdown Don't stop digibyteds after the test execution - --srcdir=SRCDIR Source directory containing digibyted/digibyte-cli - (default: ../../src) - --tmpdir=TMPDIR Root directory for datadirs - --tracerpc Print out all RPC calls as they are made - --coveragedir=COVERAGEDIR - Write tested RPC commands into this directory -``` + ```bash + -h, --help show this help message and exit + --nocleanup Leave digibyteds and test.* datadir on exit or error + --noshutdown Don't stop digibyteds after the test execution + --srcdir=SRCDIR Source directory containing digibyted/digibyte-cli + (default: ../../src) + --tmpdir=TMPDIR Root directory for datadirs + --tracerpc Print out all RPC calls as they are made + --coveragedir=COVERAGEDIR + Write tested RPC commands into this directory + ``` If you set the environment variable `PYTHON_DEBUG=1` you will get some debug output (example: `PYTHON_DEBUG=1 qa/pull-tester/rpc-tests.py wallet`). @@ -75,13 +85,13 @@ test state. If you get into a bad state, you should be able to recover with: -```bash -rm -rf cache -killall digibyted -``` + ```bash + rm -rf cache + killall digibyted + ``` + +## Writing tests -Writing tests -============= You are encouraged to write tests for new or existing features. Further information about the test framework and individual rpc tests is found in [qa/rpc-tests](/qa/rpc-tests).