Skip to content

Commit c01ac41

Browse files
committed
Update README for running tests
1 parent 998c309 commit c01ac41

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

collector/README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,3 +556,22 @@ compilation of the final/leaf crate. Cargo only passes arguments after `--` to t
556556
therefore this does not affect the compilation of dependencies.
557557
2) Profiling/benchmarking - `cargo` is invoked with `--wrap-rustc-with <TOOL>`, which executes the
558558
specified profiling tool by `rustc-fake`.
559+
560+
## How to test
561+
Run `make test`; in the root of the project there is a `Makefile` which
562+
presently exists to spin up/down a Postgres database, from a
563+
`docker-compose.yml`, then run `cargo test` with a `TEST_DB_URL` set. In
564+
concrete terms `make test` is a convenience for running;
565+
566+
```bash
567+
docker compose up -d pg_test && \
568+
TEST_DB_URL="postgres://postgres:testpass@localhost/postgres" cargo test
569+
```
570+
571+
The above becomes cumbersome to type and easy to forget both how to setup the
572+
database and set the `TEST_DB_URL` environment variable.
573+
574+
**Note: Windows**
575+
The tests for the database are disabled and will skip. This is due, at the time
576+
of writing (May 2025), to limitations with the GitHub Ci runner not supporting
577+
docker, hence unable to start the database for the tests.

0 commit comments

Comments
 (0)