Skip to content

Commit

Permalink
Merge pull request #331 from Inist-CNRS/improve-local-e2e-test
Browse files Browse the repository at this point in the history
[RFR] Improve local e2e test
  • Loading branch information
parmentf authored May 9, 2017
2 parents 7494285 + 283ac3b commit 06b249d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
2 changes: 2 additions & 0 deletions docker-compose.e2e-debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,6 @@ services:
mongo:
image: mongo:3.0.14
command: "--smallfiles"
ports:
- 27017:27017

1 change: 0 additions & 1 deletion docker-compose.e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ services:
mongo:
image: mongo:3.0.14
command: "--smallfiles"

e2e:
image: node:7.8.0
volumes:
Expand Down
16 changes: 14 additions & 2 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,20 @@ test-frontend-functional-debug: ## Run the frontend application functional tests
docker-compose -f docker-compose.e2e.yml run --rm e2e

e2e: ## Run test for just one spec file eg make e2e ./src/app/e2e/admin/composedOf.spec.js
@SPEC=$(COMMAND_ARGS) docker-compose -f docker-compose.e2e-debug.yml -f docker-compose.e2e-spec.yml run --rm e2e
@echo "BE CAREFUL : In this case, frontend application will not be rebuild."
@docker-compose -f docker-compose.e2e-debug.yml up -d mongo
@echo "Temporizing..." && sleep 2
@echo "Cleaning Database..." && docker-compose exec mongo mongo lodex_test --eval " \
db.publishedDataset.remove({}); \
db.publishedCharacteristic.remove({}); \
db.field.remove({}); \
db.uriDataset.remove({}); \
db.dataset.remove({}); \
"
@echo "Temporizing..." && sleep 3
@echo "Recreating Containers..." && docker-compose -f docker-compose.e2e-debug.yml up -d --force-recreate
@echo "Temporizing..." && sleep 3
@echo "Running test..." && SPEC=$(COMMAND_ARGS) docker-compose -f docker-compose.e2e-debug.yml -f docker-compose.e2e-spec.yml run --rm e2e

cleanup-test: ## Stop and remove all container used in e2e test
docker-compose -f docker-compose.e2e.yml down
Expand All @@ -94,7 +107,6 @@ clear-database: ## Clear the whole database
db.uriDataset.remove({}); \
db.dataset.remove({}); \
"

clear-publication: ## Clear the published data, keep uploaded dataset and model
docker-compose exec mongo mongo lodex --eval " \
db.publishedDataset.remove({}); \
Expand Down

0 comments on commit 06b249d

Please sign in to comment.