We have the ability to spin up local (or deployed, for CICD) ephemeral test chains using CLSDK to run tests. We can even point the frontend to these test chains to test various scenarios.

This can be done natively (see documentation in Github repo) or, if you’re on a Mac, via Docker.

This document is less of a how-to / tutorial and more of a collection of notes for reference when running via Docker locally. As you learn more about the test suite, this may (or may not) be a helpful reference.


Running Tests

From the build folder, run:

docker run -d -it --name eden-genesis \\
  -v "$(pwd)":/app \\
  -w /app \\
  -p 8080:8080 -p 8888:8888 \\
  ghcr.io/eoscommunity/eden-builder:sub-chain \\
  bash ./eden_chain_runner.sh run-genesis.wasm 1

Building Test Runners

Replace ~/work with the directory containing the cloned repo:

docker run --rm -it -v ~/Projects/clarion/eden:/root/work \\
  -w /root/work \\
  ghcr.io/eoscommunity/eden-builder:sub-chain \\
  bash

That will get the proper bash window running.

--rm creates a transient container that will be removed when we're done.

To set this up as a container that persists:

docker run --name build-test-runners -it -v ~/Projects/clarion/eden:/root/work \\
  -w /root/work \\
  ghcr.io/eoscommunity/eden-builder:sub-chain \\
  bash

Run the build commands:

git submodule update --init --recursive
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DSKIP_TS=yes -DCMAKE_TARGET_MESSAGES=no ..
# the above commands are only necessary if I fall too far behind

make -j $(nproc) # run from /build dir
ctest -j $(nproc)

Notes for the make step: