Skip to content

Commit 4180c81

Browse files
committed
Removed TestContainers as a default integration test engine
For educational reasons, it's better to be able to see data in the event store. Plus TestContainers are slow...
1 parent f95550d commit 4180c81

File tree

5 files changed

+8
-20
lines changed

5 files changed

+8
-20
lines changed

workshops/introduction_to_event_sourcing/README.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,7 @@ Follow the instructions in exercises folders.
6262

6363
## Running
6464

65-
1. Tests by default are using TestContainers, but if you'd like to troubleshoot it manually, you can disable the TestContainers and use regular docker images by setting the `ES_USE_TEST_CONTAINERS` environment variable to false:
66-
67-
```bash
68-
ES_USE_TEST_CONTAINERS=false
69-
```
70-
71-
2. Then run: `docker compose up` to start EventStoreDB docker image.You should automatically get:
65+
1. Run: `docker compose up` to start EventStoreDB docker image.You should automatically get:
7266

7367
- EventStoreDB UI: http://localhost:2113/
7468
- Mongo Express UI: http://localhost:8081/

workshops/introduction_to_event_sourcing/src/core/testing/eventStoreDB/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ let esdbContainer: StartedEventStoreDBContainer | undefined;
88
let instanceCounter = 0;
99

1010
export const getEventStoreDBTestClient = async (
11-
useTestContainers = true,
11+
useTestContainers = false,
1212
): Promise<EventStoreDBClient> => {
1313
let connectionString;
1414

15-
if (process.env.ES_USE_TEST_CONTAINERS !== 'false' && useTestContainers) {
15+
if (process.env.ES_USE_TEST_CONTAINERS === 'false' && useTestContainers) {
1616
++instanceCounter;
1717
if (!esdbContainer)
1818
esdbContainer = await new EventStoreDBContainer().start();

workshops/introduction_to_event_sourcing/src/core/testing/mongoDB/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ let mongoDBContainer: StartedMongoDBContainer | undefined;
88
let instanceCounter = 0;
99

1010
export const getMongoDBTestClient = async (
11-
useTestContainers = true,
11+
useTestContainers = false,
1212
): Promise<MongoClient> => {
1313
let connectionString;
1414

15-
if (process.env.ES_USE_TEST_CONTAINERS !== 'false' && useTestContainers) {
15+
if (process.env.ES_USE_TEST_CONTAINERS === 'false' && useTestContainers) {
1616
++instanceCounter;
1717
if (!mongoDBContainer)
1818
mongoDBContainer = await new MongoDBContainer().start();

workshops/introduction_to_event_sourcing/src/core/testing/postgreSQL/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ let postgreSQLContainer: StartedPostgreSqlContainer | undefined;
77
let instanceCounter = 0;
88

99
export const getPostgreSQLConnectionString = async (
10-
useTestContainers = true,
10+
useTestContainers = false,
1111
): Promise<string> => {
1212
let connectionString;
1313

14-
if (process.env.ES_USE_TEST_CONTAINERS !== 'false' && useTestContainers) {
14+
if (process.env.ES_USE_TEST_CONTAINERS === 'false' && useTestContainers) {
1515
++instanceCounter;
1616
if (!postgreSQLContainer)
1717
postgreSQLContainer = await new PostgreSqlContainer().start();

workshops/introduction_to_event_sourcing/src/solved/04_appending_events_emmett/README.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,7 @@ Using a defined structure of events from the [first exercise](../01_events_defin
88

99
## Prerequisities
1010

11-
1. Tests by default are using TestContainers, but if you'd like to troubleshoot it manually, you can disable the TestContainers and use regular docker images by setting the `ES_USE_TEST_CONTAINERS` environment variable to false:
12-
13-
```bash
14-
ES_USE_TEST_CONTAINERS=false
15-
```
16-
17-
2. Then run: `docker compose up` (or for Mac `docker compose -f docker-compose.arm.yml up`) to start EventStoreDB docker image.You should automatically get:
11+
1. Run: `docker compose up` (or for Mac `docker compose -f docker-compose.arm.yml up`) to start EventStoreDB docker image.You should automatically get:
1812

1913
- EventStoreDB UI: http://localhost:2113/
2014
- Mongo Express UI: http://localhost:8081/

0 commit comments

Comments
 (0)