chore(ci): add integration test to validate local environment (#1659)

This commit is contained in:
Mikaël Ducharme 2023-03-02 13:54:25 -05:00 коммит произвёл GitHub
Родитель ac5f33b427
Коммит 02ae68079a
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 41 добавлений и 0 удалений

Просмотреть файл

@ -29,6 +29,29 @@ jobs:
- store_test_results:
path: test-results
test-local-environment:
executor: docker/machine
steps:
- checkout
- attach_workspace:
at: artifacts
- docker/install-docker-compose
- run:
name: Load Docker image artifact from previous job
command: docker load -i artifacts/telemetry-airflow.tar
- run:
name: Override docker-compose.yaml with artifact
command: |
sed -i "s/ build: ./ image: $CIRCLE_PROJECT_REPONAME:${CIRCLE_SHA1:0:9}/g" docker-compose.yml
- run:
name: Start up local environment
command: |
echo "AIRFLOW_UID=$(id -u)" >> .env
echo "FERNET_KEY=$(python3 -c "from cryptography.fernet import Fernet; fernet_key = Fernet.generate_key(); print(fernet_key.decode())")" >> .env
docker-compose up --wait
docker-compose exec airflow-webserver airflow variables import dev_variables.json
docker-compose exec airflow-webserver airflow connections import dev_connections.json
black:
executor: *python-executor
steps:
@ -102,6 +125,7 @@ workflows:
ignore: main
tags:
ignore: /.*/
- docker/publish:
name: 🛠️ Docker build test
before_build: &version
@ -116,12 +140,29 @@ workflows:
- run:
name: Output version.json
command: cat version.json
after_build:
- run:
name: Persist image
command: |
mkdir -p artifacts
docker save -o artifacts/telemetry-airflow.tar $CIRCLE_PROJECT_REPONAME:${CIRCLE_SHA1:0:9}
- persist_to_workspace:
root: artifacts
paths:
- telemetry-airflow.tar
deploy: false
image: $CIRCLE_PROJECT_REPONAME
tag: ${CIRCLE_SHA1:0:9}
filters: *ci-filter
requires:
- 🧪 Validate requirements
- test-local-environment:
name: 🧪 Validate local environment
filters: *ci-filter
requires:
- 🛠️ Docker build test
- black:
name: ⚫ black
filters: *ci-filter