From fea30491c3ee084c9e16b02f4832ccf2a158be92 Mon Sep 17 00:00:00 2001 From: Se7enZ Date: Tue, 1 Oct 2024 16:43:43 +0200 Subject: [PATCH] doc: Include documentation for test targeting via `PYTEST_TESTS`. Also update the table of optional environment variables to set when running the integration tests. --- doc/contribute-to-core-lightning/testing.md | 34 ++++++++++++++++----- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/doc/contribute-to-core-lightning/testing.md b/doc/contribute-to-core-lightning/testing.md index c1ca8082b..2de963756 100644 --- a/doc/contribute-to-core-lightning/testing.md +++ b/doc/contribute-to-core-lightning/testing.md @@ -43,6 +43,10 @@ There are four kinds of tests: You can also append `-k TESTNAME` to run a single test. Environment variables `DEBUG_SUBD=` and `TIMEOUT=` can be useful for debugging subdaemons on individual tests, and `DEBUG_LIGHTNINGD` for attaching a debugger to each `lightningd` instance created. + Alternatively, to run a specific test via the `Makefile`, you can specify the test by setting the environment variable `PYTEST_TESTS`: + + `PYTEST_TESTS="tests/test_askrene.py::test_layers" make pytest` + - **pylightning tests** - will check contrib pylightning for codestyle and run the tests in `contrib/pylightning/tests` afterwards: `make check-python` @@ -52,14 +56,28 @@ Our Github Actions instance (see `.github/workflows/*.yml`) runs all these for e #### Additional Environment Variables ```text -TEST_CHECK_DBSTMTS=[0|1] - When running blackbox tests, this will - load a plugin that logs all compiled - and expanded database statements. - Note: Only SQLite3. -TEST_DB_PROVIDER=[sqlite3|postgres] - Selects the database to use when running - blackbox tests. -EXPERIMENTAL_DUAL_FUND=[0|1] - Enable dual-funding tests. -EXPERIMENTAL_SPLICING=[0|1] - Enable splicing tests. +EXPERIMENTAL_DUAL_FUND=[0|1] - Enable dual-funding tests. +EXPERIMENTAL_SPLICING=[0|1] - Enable splicing tests. +TEST_CHECK_DBSTMTS=[0|1] - When running blackbox tests, this will + load a plugin that logs all compiled + and expanded database statements. + Note: Only SQLite3. +TEST_DB_PROVIDER=[sqlite3|postgres] - Selects the database to use when running + blackbox tests. +TEST_DEBUG=[0|1] - Enable additional debug logging output + during tests. +TEST_NETWORK=[regtest|liquid-regtest] - Select the test network to use. Default is + to 'regtest'. +TIMEOUT - Override the default timeout value for + API calls. +PYTEST_PAR=[1-n] - Number of processes to use when running + the blackbox the tests in parallel. +PYTEST_TESTS="tests/" - Target a specific set of blackbox tests + when running 'make pytest'. Pass a string + of Pytest test targets. +SLOW_MACHINE=[0|1] - Set sensible defaults for running tests + in resource-constrained environments. +VALGRIND=[0|1] - Run the tests with Valgrind. ``` #### Troubleshooting