Fix lots of bugs and refactor
This commit is contained in:
parent
b5d0095604
commit
fd33eccc7c
|
@ -75,10 +75,10 @@ preparation:
|
||||||
dotenv: context.env
|
dotenv: context.env
|
||||||
|
|
||||||
.build-and-push-script: &build-and-push-script
|
.build-and-push-script: &build-and-push-script
|
||||||
- docker build ${FOLDER} -f ${FOLDER}/Dockerfile.prod --build-arg "${BUILD_ARG_PROD-x}" --build-arg "${BUILD_ARG_PROD_OTHER-x}" -t ${PROD_IMAGE}
|
- docker build ${FOLDER} -f ${FOLDER}/${DOCKERFILE-Dockerfile.prod} --build-arg "${BUILD_ARG_PROD-x}" --build-arg "${BUILD_ARG_PROD_OTHER-x}" -t ${PROD_IMAGE}
|
||||||
- docker build ${FOLDER} -f ${FOLDER}/Dockerfile.test -t ${TEST_IMAGE}
|
- ([ -z ${TEST_IMAGE} ]) || docker build ${FOLDER} -f ${FOLDER}/Dockerfile.test -t ${TEST_IMAGE}
|
||||||
- docker push ${PROD_IMAGE}
|
- docker push ${PROD_IMAGE}
|
||||||
- docker push ${TEST_IMAGE}
|
- ([ -z ${TEST_IMAGE} ]) || docker push ${TEST_IMAGE}
|
||||||
|
|
||||||
.build:
|
.build:
|
||||||
stage: build
|
stage: build
|
||||||
|
@ -154,27 +154,27 @@ build-browser-client-dev:
|
||||||
- .build
|
- .build
|
||||||
script:
|
script:
|
||||||
- export FOLDER=browser-domain
|
- export FOLDER=browser-domain
|
||||||
- export API_IMAGE=${BROWSER_CLIENT_DEV_IMAGE_NAME}
|
- export PROD_IMAGE=${BROWSER_CLIENT_DEV_IMAGE_NAME}
|
||||||
- docker build ${FOLDER} -f ${FOLDER}/Dockerfile.dev -t ${API_IMAGE}
|
- export DOCKERFILE=Dockerfile.dev
|
||||||
- docker push ${API_IMAGE}
|
- *build-and-push-script
|
||||||
|
|
||||||
build-tavern:
|
build-tavern:
|
||||||
extends:
|
extends:
|
||||||
- .build
|
- .build
|
||||||
script:
|
script:
|
||||||
- export FOLDER=testing/tavern
|
- export FOLDER=testing/tavern
|
||||||
- export API_IMAGE=${TAVERN_TEST_IMAGE_NAME}
|
- export PROD_IMAGE=${TAVERN_TEST_IMAGE_NAME}
|
||||||
- docker build ${FOLDER} -f ${FOLDER}/Dockerfile -t ${API_IMAGE}
|
- export DOCKERFILE=Dockerfile
|
||||||
- docker push ${API_IMAGE}
|
- *build-and-push-script
|
||||||
|
|
||||||
build-catcher:
|
build-catcher:
|
||||||
extends:
|
extends:
|
||||||
- .build
|
- .build
|
||||||
script:
|
script:
|
||||||
- export FOLDER=testing/catcher
|
- export FOLDER=testing/catcher
|
||||||
- export API_IMAGE=${CATCHER_TEST_IMAGE_NAME}
|
- export PROD_IMAGE=${CATCHER_TEST_IMAGE_NAME}
|
||||||
- docker build ${FOLDER} -f ${FOLDER}/Dockerfile -t ${API_IMAGE}
|
- export DOCKERFILE=Dockerfile
|
||||||
- docker push ${API_IMAGE}
|
- *build-and-push-script
|
||||||
|
|
||||||
.test-script: &test-script
|
.test-script: &test-script
|
||||||
- docker compose -f ${FOLDER}/docker-compose.dev.yml --env-file $ENV_DEV_FILE down
|
- docker compose -f ${FOLDER}/docker-compose.dev.yml --env-file $ENV_DEV_FILE down
|
||||||
|
@ -329,30 +329,31 @@ test-screen-client:
|
||||||
optional: true
|
optional: true
|
||||||
artifacts: true
|
artifacts: true
|
||||||
|
|
||||||
.test-integration: &test-integration
|
.test-integration-script: &test-integration-script
|
||||||
- export TEST_TARGET=INTEGRATION
|
|
||||||
- export API_IMAGE=$FLIGHTS_INFO_TEST_IMAGE_NAME
|
|
||||||
- docker compose -f flights-domain/docker-compose.dev.yml --env-file $ENV_DEV_FILE down
|
|
||||||
- docker compose -f flights-domain/docker-compose.dev.yml --env-file $ENV_DEV_FILE pull
|
|
||||||
- docker compose -f flights-domain/docker-compose.dev.yml --env-file $ENV_DEV_FILE up -d
|
|
||||||
- export API_IMAGE=$GATEWAY_TEST_IMAGE_NAME
|
|
||||||
- docker compose -f gateway/docker-compose.dev.yml --env-file $ENV_DEV_FILE down
|
|
||||||
- docker compose -f gateway/docker-compose.dev.yml --env-file $ENV_DEV_FILE pull
|
|
||||||
- docker compose -f gateway/docker-compose.dev.yml --env-file $ENV_DEV_FILE up -d
|
|
||||||
- export API_IMAGE=$USER_MANAGER_TEST_IMAGE_NAME
|
|
||||||
- docker compose -f auth-domain/docker-compose.dev.yml --env-file $ENV_DEV_FILE down
|
|
||||||
- docker compose -f auth-domain/docker-compose.dev.yml --env-file $ENV_DEV_FILE pull
|
|
||||||
- docker compose -f auth-domain/docker-compose.dev.yml --env-file $ENV_DEV_FILE up -d
|
|
||||||
- docker compose -f auth-domain/docker-compose.dev.yml --env-file $ENV_DEV_FILE exec auth-api python manage.py recreate_db
|
|
||||||
- docker compose -f auth-domain/docker-compose.dev.yml --env-file $ENV_DEV_FILE exec auth-api python manage.py seed_db
|
|
||||||
- export API_IMAGE=$SUBSCRIPTION_TEST_IMAGE_NAME
|
|
||||||
- docker compose -f subscription-domain/docker-compose.dev.yml --env-file $ENV_DEV_FILE down
|
|
||||||
- docker compose -f subscription-domain/docker-compose.dev.yml --env-file $ENV_DEV_FILE pull
|
|
||||||
- docker compose -f subscription-domain/docker-compose.dev.yml --env-file $ENV_DEV_FILE up -d
|
|
||||||
- export API_IMAGE=$CLIENT_IMAGE
|
|
||||||
- docker compose -f ${FOLDER}/docker-compose.dev.yml --env-file $ENV_DEV_FILE down
|
- docker compose -f ${FOLDER}/docker-compose.dev.yml --env-file $ENV_DEV_FILE down
|
||||||
- docker compose -f ${FOLDER}/docker-compose.dev.yml --env-file $ENV_DEV_FILE pull
|
- docker compose -f ${FOLDER}/docker-compose.dev.yml --env-file $ENV_DEV_FILE pull
|
||||||
- docker compose -f ${FOLDER}/docker-compose.dev.yml --env-file $ENV_DEV_FILE up --abort-on-container-exit
|
- docker compose -f ${FOLDER}/docker-compose.dev.yml --env-file $ENV_DEV_FILE up -d
|
||||||
|
|
||||||
|
.test-integration: &test-integration
|
||||||
|
- export TEST_TARGET=INTEGRATION
|
||||||
|
- export OLD_FOLDER=$FOLDER
|
||||||
|
- export API_IMAGE=$FLIGHTS_INFO_TEST_IMAGE_NAME
|
||||||
|
- export FOLDER=flights-domain
|
||||||
|
- *test-integration-script
|
||||||
|
- export API_IMAGE=$GATEWAY_TEST_IMAGE_NAME
|
||||||
|
- export FOLDER=gateway
|
||||||
|
- *test-integration-script
|
||||||
|
- export API_IMAGE=$USER_MANAGER_TEST_IMAGE_NAME
|
||||||
|
- export FOLDER=auth-domain
|
||||||
|
- *test-integration-script
|
||||||
|
- docker compose -f ${FOLDER}/docker-compose.dev.yml --env-file $ENV_DEV_FILE exec auth-api python manage.py recreate_db
|
||||||
|
- docker compose -f ${FOLDER}/docker-compose.dev.yml --env-file $ENV_DEV_FILE exec auth-api python manage.py seed_db
|
||||||
|
- export API_IMAGE=$SUBSCRIPTION_TEST_IMAGE_NAME
|
||||||
|
- export FOLDER=subscription-domain
|
||||||
|
- *test-integration-script
|
||||||
|
- export API_IMAGE=$CLIENT_IMAGE
|
||||||
|
- export FOLDER=$OLD_FOLDER
|
||||||
|
- *test-script
|
||||||
|
|
||||||
.test-integration-clean: &test-integration-clean
|
.test-integration-clean: &test-integration-clean
|
||||||
- export API_IMAGE=${FLIGHTS_INFO_TEST_IMAGE_NAME}
|
- export API_IMAGE=${FLIGHTS_INFO_TEST_IMAGE_NAME}
|
||||||
|
@ -459,7 +460,7 @@ test-catcher:
|
||||||
script:
|
script:
|
||||||
- export CLIENT_IMAGE=${BROWSER_CLIENT_DEV_IMAGE_NAME}
|
- export CLIENT_IMAGE=${BROWSER_CLIENT_DEV_IMAGE_NAME}
|
||||||
- export FOLDER=browser-domain
|
- export FOLDER=browser-domain
|
||||||
- *test-script
|
- *test-integration-script
|
||||||
- export CLIENT_IMAGE=${CATCHER_TEST_IMAGE_NAME}
|
- export CLIENT_IMAGE=${CATCHER_TEST_IMAGE_NAME}
|
||||||
- export FOLDER=testing/catcher
|
- export FOLDER=testing/catcher
|
||||||
- *test-integration
|
- *test-integration
|
||||||
|
|
|
@ -1,3 +1,2 @@
|
||||||
API_URL=http://localhost:5000
|
|
||||||
POSTGRES_USER=username
|
POSTGRES_USER=username
|
||||||
POSTGRES_PASS=password
|
POSTGRES_PASS=password
|
|
@ -27,7 +27,5 @@ RUN chmod +x /usr/src/app/test.sh
|
||||||
|
|
||||||
ENV PYTHONDONTWRITEBYTECODE 1
|
ENV PYTHONDONTWRITEBYTECODE 1
|
||||||
ENV PYTHONUNBUFFERED 1
|
ENV PYTHONUNBUFFERED 1
|
||||||
ARG API_URL
|
|
||||||
ENV API_URL $API_URL
|
|
||||||
|
|
||||||
ENTRYPOINT ["/usr/src/app/test.sh"]
|
ENTRYPOINT ["/usr/src/app/test.sh"]
|
|
@ -5,12 +5,8 @@ services:
|
||||||
container_name: fids-testing_catcher
|
container_name: fids-testing_catcher
|
||||||
image: ${API_IMAGE}
|
image: ${API_IMAGE}
|
||||||
environment:
|
environment:
|
||||||
- API_URL=${API_URL}
|
|
||||||
- POSTGRES_USER=${POSTGRES_USER}
|
- POSTGRES_USER=${POSTGRES_USER}
|
||||||
- POSTGRES_PASS=${POSTGRES_PASS}
|
- POSTGRES_PASS=${POSTGRES_PASS}
|
||||||
# entrypoint: ["/bin/bash","-c"]
|
|
||||||
# command:
|
|
||||||
# - "sleep 3600"
|
|
||||||
extra_hosts:
|
extra_hosts:
|
||||||
- "host.docker.internal:host-gateway"
|
- "host.docker.internal:host-gateway"
|
||||||
networks:
|
networks:
|
||||||
|
|
|
@ -4,3 +4,4 @@ catcher -i inventories/local.yaml tests/login.test.yaml
|
||||||
catcher -i inventories/local.yaml tests/create-flight.test.yaml
|
catcher -i inventories/local.yaml tests/create-flight.test.yaml
|
||||||
catcher -i inventories/local.yaml tests/signup.test.yaml
|
catcher -i inventories/local.yaml tests/signup.test.yaml
|
||||||
catcher -i inventories/local.yaml tests/auth.test.yaml
|
catcher -i inventories/local.yaml tests/auth.test.yaml
|
||||||
|
# catcher tests
|
||||||
|
|
Loading…
Reference in New Issue