From ddc6b2361887e48acd65bc549dff42393df95c01 Mon Sep 17 00:00:00 2001 From: sbriat Date: Tue, 23 May 2023 16:40:56 +0200 Subject: [PATCH 1/6] test ci --- .gitlab-ci.yml | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index dfca5ef..15b60fc 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -19,7 +19,7 @@ test: - docker-compose -f docker-compose.ci.tools.yml -p matcher-tools --env-file ci/.env.ci up -d - sh ci/wait-up.sh - 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\.]+)/ rules: - if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH || $CI_COMMIT_MESSAGE =~ /--check/ || $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH' diff --git a/package.json b/package.json index 35861ee..9380c4c 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "test:unit": "jest --testPathPattern 'tests/unit/' --verbose", "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: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:watch": "jest --testPathPattern 'tests/unit/' --coverage --watch", "test:e2e": "jest --config ./test/jest-e2e.json", From fa0e51b3845d0c26063b2ab2a6de25ddb169ad4a Mon Sep 17 00:00:00 2001 From: sbriat Date: Tue, 23 May 2023 16:47:25 +0200 Subject: [PATCH 2/6] test ci --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 15b60fc..37cbd01 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -19,6 +19,7 @@ test: - docker-compose -f docker-compose.ci.tools.yml -p matcher-tools --env-file ci/.env.ci up -d - 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 logs -f - docker exec -t v3-matcher-api sh -c "npm run test:integration:ci" coverage: /All files[^|]*\|[^|]*\s+([\d\.]+)/ rules: From 733e4e3d7499b878567f6cdf037a7604ed01de58 Mon Sep 17 00:00:00 2001 From: sbriat Date: Tue, 23 May 2023 16:56:01 +0200 Subject: [PATCH 3/6] test ci --- .env.dist | 6 +++++- ci/.env.ci | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 1 deletion(-) diff --git a/.env.dist b/.env.dist index dc8af99..b0a4889 100644 --- a/.env.dist +++ b/.env.dist @@ -7,7 +7,7 @@ HEALTH_SERVICE_PORT=6005 # DEFAULT CONFIGURATION # default identifier used for match requests -DEFAULT_IDENTIFIER=0 +DEFAULT_UUID=00000000-0000-0000-0000-000000000000 # default timezone DEFAULT_TIMEZONE=Europe/Paris # default number of seats proposed as driver @@ -37,6 +37,10 @@ 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 DATABASE_URL="postgresql://mobicoop:mobicoop@v3-db:5432/mobicoop?schema=matcher" diff --git a/ci/.env.ci b/ci/.env.ci index ad12515..31fb4a2 100644 --- a/ci/.env.ci +++ b/ci/.env.ci @@ -2,6 +2,45 @@ SERVICE_URL=0.0.0.0 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 DATABASE_URL="postgresql://mobicoop:mobicoop@v3-db:5432/mobicoop?schema=public" From b7200023601eacadd3d28c2cd141a5d479f875f7 Mon Sep 17 00:00:00 2001 From: sbriat Date: Tue, 23 May 2023 17:05:19 +0200 Subject: [PATCH 4/6] test ci --- ci/.env.ci | 5 +++++ docker-compose.ci.tools.yml | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/ci/.env.ci b/ci/.env.ci index 31fb4a2..334e653 100644 --- a/ci/.env.ci +++ b/ci/.env.ci @@ -47,6 +47,11 @@ DATABASE_URL="postgresql://mobicoop:mobicoop@v3-db:5432/mobicoop?schema=public" # RABBIT MQ RMQ_URI=amqp://v3-broker:5672 +# REDIS +REDIS_IMAGE=redis:7.0-alpine +REDIS_HOST=v3-redis +REDIS_PASSWORD=redis + # MESSAGE BROKER BROKER_IMAGE=rabbitmq:3-alpine diff --git a/docker-compose.ci.tools.yml b/docker-compose.ci.tools.yml index a72f134..138e47e 100644 --- a/docker-compose.ci.tools.yml +++ b/docker-compose.ci.tools.yml @@ -21,6 +21,15 @@ services: networks: - v3-network + redis: + container_name: v3-redis + image: ${REDIS_IMAGE} + command: redis-server --requirepass ${REDIS_PASSWORD} + ports: + - 6379:6379 + networks: + - v3-network + networks: v3-network: name: v3-network From 1d8b46326c12ff54393254a56d5d1178748c9413 Mon Sep 17 00:00:00 2001 From: sbriat Date: Tue, 23 May 2023 17:14:54 +0200 Subject: [PATCH 5/6] test ci --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 37cbd01..edefa26 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -19,7 +19,7 @@ test: - docker-compose -f docker-compose.ci.tools.yml -p matcher-tools --env-file ci/.env.ci up -d - 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 logs -f + # - docker-compose -f docker-compose.ci.service.yml -p matcher-service --env-file ci/.env.ci logs -f - docker exec -t v3-matcher-api sh -c "npm run test:integration:ci" coverage: /All files[^|]*\|[^|]*\s+([\d\.]+)/ rules: From 82da578a78cf79be5b764c37d9384071eb684578 Mon Sep 17 00:00:00 2001 From: sbriat Date: Tue, 23 May 2023 17:20:16 +0200 Subject: [PATCH 6/6] fix integration tests --- .gitlab-ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index edefa26..15b60fc 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -19,7 +19,6 @@ test: - docker-compose -f docker-compose.ci.tools.yml -p matcher-tools --env-file ci/.env.ci up -d - 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 logs -f - docker exec -t v3-matcher-api sh -c "npm run test:integration:ci" coverage: /All files[^|]*\|[^|]*\s+([\d\.]+)/ rules: