Skip to content

Commit

Permalink
fix(test): docker compose configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
BrunnerLivio committed Nov 2, 2018
1 parent 32f53fd commit a069b19
Show file tree
Hide file tree
Showing 6 changed files with 166 additions and 377 deletions.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,7 @@ COPY package*.json ./
RUN npm install

COPY . .
ADD https://github.com/ufoscout/docker-compose-wait/releases/download/2.2.1/wait /wait
RUN chmod +x /wait

CMD ["npm", "test"]
CMD /wait && npm test
12 changes: 12 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
version: "3"

services:
mysql:
image: mysql:5.7.22
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: test
ports:
- "3306:3306"
networks:
- overlay

lib:
build:
context: .
depends_on:
- mysql
networks:
- overlay

networks:
overlay:
driver: bridge
8 changes: 7 additions & 1 deletion e2e/health-checks/database.health.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,15 @@ describe('Database Health', () => {
module: ApplicationModule,
imports: [
TypeOrmModule.forRoot({
type: 'sqlite',
type: 'mysql',
host: '0.0.0.0',
port: 3306,
username: 'root',
password: 'root',
database: 'test',
keepConnectionAlive: true,
retryAttempts: 2,
retryDelay: 1000,
}),
TerminusModule.forRootAsync(options),
],
Expand Down
1 change: 1 addition & 0 deletions e2e/terminus.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ describe('Terminus', () => {
healthChecks: {
'/health': expect.any(Function),
},
logger: expect.any(Function),
};

let terminusModuleOptions: TerminusModuleOptions = {
Expand Down
Loading

0 comments on commit a069b19

Please sign in to comment.