Merge branch 'testCI' into 'main'

test ci

See merge request v3/service/matcher!5
This commit is contained in:
Sylvain Briat 2023-05-23 15:23:38 +00:00
commit 0dfad732c9
5 changed files with 60 additions and 3 deletions

View File

@ -7,7 +7,7 @@ HEALTH_SERVICE_PORT=6005
# DEFAULT CONFIGURATION # DEFAULT CONFIGURATION
# default identifier used for match requests # default identifier used for match requests
DEFAULT_IDENTIFIER=0 DEFAULT_UUID=00000000-0000-0000-0000-000000000000
# default timezone # default timezone
DEFAULT_TIMEZONE=Europe/Paris DEFAULT_TIMEZONE=Europe/Paris
# default number of seats proposed as driver # default number of seats proposed as driver
@ -37,6 +37,10 @@ VALIDITY_DURATION=365
# max detour ratio # max detour ratio
MAX_DETOUR_DISTANCE_RATIO=0.3 MAX_DETOUR_DISTANCE_RATIO=0.3
MAX_DETOUR_DURATION_RATIO=0.3 MAX_DETOUR_DURATION_RATIO=0.3
# gerouter type
GEOROUTER_TYPE=graphhopper
# georouter url
GEOROUTER_URL=http://localhost:8989
# PRISMA # PRISMA
DATABASE_URL="postgresql://mobicoop:mobicoop@v3-db:5432/mobicoop?schema=matcher" DATABASE_URL="postgresql://mobicoop:mobicoop@v3-db:5432/mobicoop?schema=matcher"

View File

@ -19,7 +19,7 @@ test:
- docker-compose -f docker-compose.ci.tools.yml -p matcher-tools --env-file ci/.env.ci up -d - docker-compose -f docker-compose.ci.tools.yml -p matcher-tools --env-file ci/.env.ci up -d
- sh ci/wait-up.sh - sh ci/wait-up.sh
- docker-compose -f docker-compose.ci.service.yml -p matcher-service --env-file ci/.env.ci up -d - docker-compose -f docker-compose.ci.service.yml -p matcher-service --env-file ci/.env.ci up -d
# - docker exec -t v3-matcher-api sh -c "npm run test:integration:ci" - docker exec -t v3-matcher-api sh -c "npm run test:integration:ci"
coverage: /All files[^|]*\|[^|]*\s+([\d\.]+)/ coverage: /All files[^|]*\|[^|]*\s+([\d\.]+)/
rules: rules:
- if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH || $CI_COMMIT_MESSAGE =~ /--check/ || $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH' - if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH || $CI_COMMIT_MESSAGE =~ /--check/ || $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'

View File

@ -2,12 +2,56 @@
SERVICE_URL=0.0.0.0 SERVICE_URL=0.0.0.0
SERVICE_PORT=5005 SERVICE_PORT=5005
# DEFAULT CONFIGURATION
# default identifier used for match requests
DEFAULT_UUID=00000000-0000-0000-0000-000000000000
# default timezone
DEFAULT_TIMEZONE=Europe/Paris
# default number of seats proposed as driver
DEFAULT_SEATS=3
# algorithm type
ALGORITHM=CLASSIC
# strict algorithm (if relevant with the algorithm type)
# if set to true, matches are made so that
# punctual ads match only with punctual ads and
# recurrent ads match only with recurrent ads
STRICT_ALGORITHM=0
# max distance in metres between driver
# route and passenger pick-up / drop-off
REMOTENESS=15000
# use passenger proportion
USE_PROPORTION=1
# minimal driver proportion
PROPORTION=0.3
# use azimuth calculation
USE_AZIMUTH=1
# azimuth margin
AZIMUTH_MARGIN=10
# margin duration in seconds
MARGIN_DURATION=900
# default validity duration (in days) for recurrent proposals
VALIDITY_DURATION=365
# max detour ratio
MAX_DETOUR_DISTANCE_RATIO=0.3
MAX_DETOUR_DURATION_RATIO=0.3
# gerouter type
GEOROUTER_TYPE=graphhopper
# georouter url
GEOROUTER_URL=http://localhost:8989
# PRISMA # PRISMA
DATABASE_URL="postgresql://mobicoop:mobicoop@v3-db:5432/mobicoop?schema=public" DATABASE_URL="postgresql://mobicoop:mobicoop@v3-db:5432/mobicoop?schema=public"
# RABBIT MQ # RABBIT MQ
RMQ_URI=amqp://v3-broker:5672 RMQ_URI=amqp://v3-broker:5672
# REDIS
REDIS_IMAGE=redis:7.0-alpine
REDIS_HOST=v3-redis
REDIS_PASSWORD=redis
# MESSAGE BROKER # MESSAGE BROKER
BROKER_IMAGE=rabbitmq:3-alpine BROKER_IMAGE=rabbitmq:3-alpine

View File

@ -21,6 +21,15 @@ services:
networks: networks:
- v3-network - v3-network
redis:
container_name: v3-redis
image: ${REDIS_IMAGE}
command: redis-server --requirepass ${REDIS_PASSWORD}
ports:
- 6379:6379
networks:
- v3-network
networks: networks:
v3-network: v3-network:
name: v3-network name: v3-network

View File

@ -21,7 +21,7 @@
"test:unit": "jest --testPathPattern 'tests/unit/' --verbose", "test:unit": "jest --testPathPattern 'tests/unit/' --verbose",
"test:unit:ci": "jest --testPathPattern 'tests/unit/' --coverage", "test:unit:ci": "jest --testPathPattern 'tests/unit/' --coverage",
"test:integration": "npm run migrate:test && dotenv -e .env.test -- jest --testPathPattern 'tests/integration/' --verbose", "test:integration": "npm run migrate:test && dotenv -e .env.test -- jest --testPathPattern 'tests/integration/' --verbose",
"test:integration:ci": "npm run migrate:test:ci && dotenv -e ci/.env.ci -- jest --testPathPattern 'tests/integration/'", "test:integration:ci": "npm run migrate:test:ci && dotenv -e ci/.env.ci -- jest --testPathPattern 'tests/integration/' --verbose",
"test:cov": "jest --testPathPattern 'tests/unit/' --coverage", "test:cov": "jest --testPathPattern 'tests/unit/' --coverage",
"test:cov:watch": "jest --testPathPattern 'tests/unit/' --coverage --watch", "test:cov:watch": "jest --testPathPattern 'tests/unit/' --coverage --watch",
"test:e2e": "jest --config ./test/jest-e2e.json", "test:e2e": "jest --config ./test/jest-e2e.json",