Merge pull request #1 from fanatixan/bael-17468

JAVA-73
This commit is contained in:
kwoyke
2020-04-23 22:02:28 +02:00
committed by GitHub
7 changed files with 63 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
=========
## Spring Data MongoDB Live Testing
There are 3 scripts to simplify running live tests:
1. `live-test-setup.sh` builds a docker image with the necessary setup and runs it. The environment is ready, when the log stops - it takes approximately 30 seconds.
2. `live-test.sh` runs the live tests (but no other tests).
3. `live-test-setup.sh` stops and removes the docker image.

View File

@@ -0,0 +1,5 @@
#!/bin/bash
docker image build -t spring-data-mongodb:live-test src/live-test/resources/
docker run -p 27017:27017 --name spring-data-mongodb-live-test spring-data-mongodb:live-test

View File

@@ -0,0 +1,4 @@
#!/bin/bash
docker stop spring-data-mongodb-live-test
docker rm spring-data-mongodb-live-test

View File

@@ -0,0 +1,3 @@
#!/bin/bash
mvn clean compile test -P live-all

View File

@@ -0,0 +1,8 @@
FROM mongo:4.2.1
COPY init-session.js /docker-entrypoint-initdb.d/
EXPOSE 27017
HEALTHCHECK --interval=5s --timeout=3s --start-period=10s CMD mongo db.stats()
CMD ["mongod", "--replSet", "rs0"]

View File

@@ -0,0 +1 @@
rs.initiate();