From 7a48ef4543d9ac05858ebf5a8e8ee00b0c2129fe Mon Sep 17 00:00:00 2001 From: Evgeni Pandurski Date: Sun, 4 Sep 2022 16:00:31 +0300 Subject: [PATCH] Improve readme, add run_tests.yml --- .github/workflows/run_tests.yml | 19 +++++++++++++++++++ README.md | 28 ++++++++++++++-------------- 2 files changed, 33 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/run_tests.yml diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml new file mode 100644 index 0000000..0360d18 --- /dev/null +++ b/.github/workflows/run_tests.yml @@ -0,0 +1,19 @@ +name: Run tests +on: + pull_request: + branches: [ master ] +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Create .env file + run: cp development.env .env + + - name: Build docker image + run: docker-compose build + + - name: Run tests in docker container + run: docker-compose run tests-config test diff --git a/README.md b/README.md index e71ea2b..9e49a42 100644 --- a/README.md +++ b/README.md @@ -207,6 +207,19 @@ How to run the tests $ docker-compose build $ docker-compose run tests-config test + +How to setup a development environment +-------------------------------------- + +1. Install [Poetry](https://poetry.eustace.io/docs/). + +2. Create a new [Python](https://docs.python.org/) virtual + environment and activate it. + +3. To install dependencies, run this command: + + $ poetry install + 4. To run the minimal set of services needed for development, use this command: @@ -224,20 +237,7 @@ How to run the tests the RabbitMQ connection URLs accordingly (`PROTOCOL_BROKER_URL` in the *.env* file). - -How to setup a development environment --------------------------------------- - -1. Install [Poetry](https://poetry.eustace.io/docs/). - -2. Create a new [Python](https://docs.python.org/) virtual - environment and activate it. - -3. To install dependencies, run this command: - - $ poetry install - -4. You can use `flask run -p 5000` to run a local web server, and +5. You can use `flask run -p 5000` to run a local web server, and `pytest --cov=swpt_creditors --cov-report=html` to run the tests and generate a test coverage report.