3
The chairman tests are a set of tests run only in CI to ensure that a static
4
set of nodes are able to join a cluster and make progress forging new blocks.
6
These tests are paramterised over operating systems:
12
and various run-modes:
19
You must already be able to build everything in the `cardano-node` repository
20
using `cabal` (not `nix`).
22
See [Installing a node from source](install.md).
24
## Running the chairman test
25
The chairman test will run some testnets and perform some basic tests to ensure they
28
Those basic tests may differ depending on the testnet that is being tested, but may
31
Asserting that each node:
33
* Opens the correct port
34
* Creates a socket file (or OS-specific equivalent) at the expected location
36
To see what assertions are made, please see the source code of the testnet you are
37
interested in. These can be found in `cardano-node-chairman/src`.
39
To run the chairman tests, first build the necessary executables:
42
$ cabal build cardano-cli cardano-node cardano-node-chairman cardano-testnet
48
cabal test cardano-node-chairman
53
The testnet launcher and chairman test use common code under the `cardano-node-chairman/src` directory
54
to launch any one of multiple testnets.
56
This section will discuss the overall structure of this common design.
58
The testnet infrastructure will create a workspace directory with a random suffix to ensure that if multiple
59
testnets are launched, they will not interfere with each other via the filesystem. All the configuration files,
60
logging output, and socket files will be written to to files somewhere in the workspace. The
61
actual workspace location will be logged in the test output.
63
The nodes themselves (and the chairman executable in the case of the chairman tests) will be executed from
64
the parent directory of the workspace directory. This is to work around operating system limitations such
65
as filename restrictions whilst still ensuring that the names of socket files (or in the case of Windows,
66
named pipes) remain unique.
68
The infrastructure uses hedgehog to provide annotations as an alternative to logging. This allows the configuration
69
and logging to be printed close to the source code that generated it, making it easy to follow the testnet
70
set up and diagnose any potential issues.
72
A downside to doing it this way is all the output is collected whilst the testnet is being brought up, but
73
no output will be printed until the testnet is fully launched or a failure occurs.
75
For further details information see [Testing Cardano with Hedgehog](https://youtu.be/ZAN18xZGsSY), keeping in
76
mind the following correction, which is when the chairman test is run, one chairman process is created for the
77
entire testnet and connects to each and every node.