From 4a4efd7c7f38aa2dee37e3c1dd9c75915ca0cf38 Mon Sep 17 00:00:00 2001 From: Julien Dudek Date: Wed, 6 Jan 2021 11:20:59 +0100 Subject: [PATCH] :green_heart: refacto and other test for db --- .circleci/config.yml | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6affd93..5923dd1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -72,30 +72,28 @@ jobs: # fallback to using the latest cache if no exact match is found - run: - name: bd upgrade + name: install dockerize + command: wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz && sudo tar -C /usr/local/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz && rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz + environment: + DOCKERIZE_VERSION: v0.3.0 + - run: + name: Wait for db + command: dockerize -wait tcp://localhost:5432 -timeout 1m + - run: + name: Migrate Database command: | + export CONDUIT_SECRET='something-really-secret' + export FLASK_APP=/home/circleci/repo/autoapp.py + export FLASK_DEBUG=1 + export DATABASE_URL=postgresql://myUsr:somePwd@localhost:5432/postgres . venv/bin/activate - sleep 1 flask db upgrade - environment: - CONDUIT_SECRET: 'something-really-secret' - FLASK_APP: /home/circleci/repo/autoapp.py - DATABASE_URL: postgresql://myUsr:somePwd@localhost:5432/myUsr - FLASK_DEBUG: 1 - - - + flask db migrate - # run tests! - # this example uses Django's built-in test-runner - # other common Python testing frameworks include pytest and nose - # https://pytest.org - # https://nose.readthedocs.io - run: name: run tests command: | . venv/bin/activate - flask db migrate flask test environment: CONDUIT_SECRET: 'something-really-secret'