Skip to content

Commit

Permalink
ci: Update CI workflow to include python3-zmq dependency and improve …
Browse files Browse the repository at this point in the history
…README formatting
  • Loading branch information
gto90 committed Dec 17, 2024
1 parent aa92cd2 commit e51b43a
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 47 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci-coverage-ubuntu-full-qt-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
28 changes: 14 additions & 14 deletions ci/README.md
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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

Expand All @@ -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.
Expand Down
72 changes: 41 additions & 31 deletions qa/README.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,55 @@
# Testing

The [pull-tester](/qa/pull-tester/) folder contains a script to call
multiple tests from the [rpc-tests](/qa/rpc-tests/) folder.

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 <testname>
```

Or you can run any combination of tests by calling

```bash
qa/pull-tester/rpc-tests.py <testname1> <testname2> <testname3> ...
```

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).
Expand All @@ -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`).
Expand All @@ -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).

0 comments on commit e51b43a

Please sign in to comment.