Skip to content

Commit b3161ea

Browse files
committed
refactor: use TestContainers
1 parent de98fe0 commit b3161ea

10 files changed

Lines changed: 1912 additions & 393 deletions

File tree

CONTRIBUTING.md

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,11 @@ instructions. This handles formatting of all the files in the repository.
4646
### Tests that use database, cache, or other external resources
4747

4848
Some tests use a database, cache, or other external resources. All these tests
49-
are marked with `#[ignore]`, so they are not run by default.
49+
are marked with `#[ignore]`, but they will automatically start the necessary
50+
containers using [Testcontainers](https://testcontainers.org/) if you have
51+
Docker or a similar container runtime installed.
5052

51-
If you want to run the full test suite, it's necessary to run these external
52-
dependencies. For convenience, Cot provides a
53-
[Docker compose file](./compose.yml) in the root of the repository that
54-
contains all the dependencies needed to run the tests. You can run it with:
55-
56-
```sh
57-
docker compose up -d
58-
```
59-
60-
Then, the tests can be run with:
53+
If you want to run the full test suite, you can run:
6154

6255
```sh
6356
cargo test --all-features --include-ignored
@@ -66,17 +59,11 @@ cargo test --all-features --include-ignored
6659
#### End-to-end tests
6760

6861
End-to-end tests require a running webdriver server. By default, a Selenium
69-
Grid server is used (included in the `compose.yml` file). You can access the
70-
UI to see the tests running (for example, to debug them) at
71-
`http://localhost:7900/?autoconnect=1&resize=scale&password=secret`.
72-
73-
Alternatively, instead of using Selenium Grid, you can run the tests with
74-
a local webdriver server. To do this, you need to install and run the
75-
Webdriver implementation of your choice, such as
76-
[geckodriver](https://github.com/mozilla/geckodriver/releases) or
77-
[chromedriver](https://developer.chrome.com/docs/chromedriver/downloads).
78-
After running the webdriver server, you will see the tests running in a
79-
local browser window.
62+
container is automatically started using Testcontainers.
63+
64+
Alternatively, you can run the tests with a local webdriver server. To do this,
65+
you need to set the `WEBDRIVER_URL` environment variable to the URL of your
66+
local webdriver server (e.g., `http://localhost:4444`).
8067

8168
### Snapshot tests
8269

0 commit comments

Comments
 (0)