Skip to content
This repository has been archived by the owner on Dec 7, 2022. It is now read-only.

Commit

Permalink
chore(test): add docker testing
Browse files Browse the repository at this point in the history
  • Loading branch information
RomainLanz committed Jul 29, 2019
1 parent 5cada91 commit 6f83ecc
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 5 deletions.
5 changes: 2 additions & 3 deletions .env.testing → .env.docker
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Localstack

DOCKER=true

HOSTNAME=localstack-s3
SERVICES=s3:5000
DEFAULT_REGION=us-east-1
Expand All @@ -15,6 +17,3 @@ SPACES_SECRET=no_need
SPACES_ENDPOINT=http://localstack-s3:5000
SPACES_BUCKET=testbucket
SPACES_REGION=us-east-1

GCS_KEYFILNAME=your_own_custom_key
GCS_BUCKET=your_own_custom_bucket
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
GCS_KEYFILNAME=your_own_custom_key
GCS_BUCKET=your_own_custom_bucket
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ services:
depends_on:
- localstack-s3
env_file:
- ./.env.testing
- ./.env.docker
volumes:
- .:/app
- /app/node_modules
Expand All @@ -20,7 +20,7 @@ services:
container_name: localstack-s3
image: localstack/localstack
env_file:
- ./.env.testing
- ./.env.docker
ports:
- '5000:5000'
- '8080:8080'
Expand Down
8 changes: 8 additions & 0 deletions docker-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh

export $(egrep -v '^#' .env.docker | xargs -d '\n')

docker-compose up -d -V --build --remove-orphans --force-recreate localstack-s3;

# Run testing
docker-compose run flydrive yarn run test
7 changes: 7 additions & 0 deletions japaFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,11 @@ require('dotenv').config();
const { configure } = require('japa');
configure({
files: ['test/**/*.spec.ts'],
filter: (file) => {
if (process.env.DOCKER && file.includes('gcs')) {
return false;
}

return true;
},
});
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"clean": "rimraf build",
"prepublishOnly": "npm run build",
"test": "node japaFile",
"test:docker": "bash docker-test.sh",
"tsc": "tsc"
},
"dependencies": {
Expand Down

0 comments on commit 6f83ecc

Please sign in to comment.