Skip to content

Commit

Permalink
feat(tests): test coverage (#2482)
Browse files Browse the repository at this point in the history
  • Loading branch information
khvn26 committed Jul 20, 2023
1 parent db48455 commit 1389c6e
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 3 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/api-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ on:
- api/**
- .github/**
types: [opened, synchronize, reopened, ready_for_review]
push:
paths:
- api/**
- .github/**
branches:
- main

defaults:
run:
Expand Down Expand Up @@ -64,3 +70,11 @@ jobs:
env:
DOTENV_OVERRIDE_FILE: .env-ci
run: make test

- name: Upload Coverage
uses: codecov/codecov-action@v3
env:
PYTHON: ${{ matrix.python-version }}
with:
token: ${{ secrets.CODECOV_TOKEN }}
env_vars: PYTHON
1 change: 1 addition & 0 deletions api/.env-ci
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
DATABASE_URL=postgresql://postgres:postgres@localhost:5432/postgres
ANALYTICS_DATABASE_URL=postgres://postgres:postgres@localhost:5432/analytics
PYTEST_ADDOPTS=--cov-report xml -n auto
1 change: 1 addition & 0 deletions api/.env-local
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
DATABASE_URL=postgresql://postgres:password@localhost:5432/flagsmith
DJANGO_SETTINGS_MODULE=app.settings.local
PYTEST_ADDOPTS=--cov-report html -n auto
5 changes: 4 additions & 1 deletion api/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@ static/

# SaaS only modules
saml/
features/workflows/logic/
features/workflows/logic/

# Unit test coverage
.coverage
2 changes: 1 addition & 1 deletion api/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ docker-build:
test:
pytest $(opts)

.PHONY: django-migrations
.PHONY: django-make-migrations
django-make-migrations:
python manage.py waitfordb
python manage.py makemigrations $(opts)
Expand Down
2 changes: 1 addition & 1 deletion api/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ known_third_party=['_pytest','apiclient','app_analytics','axes','chargebee','cor
skip = ['migrations','.venv','.direnv']

[tool.pytest.ini_options]
addopts = ['--ds=app.settings.test', '-vvvv', '-p', 'no:warnings', '-n', 'auto']
addopts = ['--ds=app.settings.test', '-vvvv', '-p', 'no:warnings', '--cov', '.']
1 change: 1 addition & 0 deletions api/requirements-dev.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ flake8
pytest-mock
pytest-lazy-fixture
moto
pytest-cov
pytest-freezegun
pytest-xdist
5 changes: 5 additions & 0 deletions api/requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ click==8.1.3
# via
# black
# pip-tools
coverage[toml]==7.2.7
# via pytest-cov
cryptography==41.0.2
# via moto
dill==0.3.6
Expand Down Expand Up @@ -114,11 +116,14 @@ pyproject-hooks==1.0.0
pytest==7.2.1
# via
# -r requirements-dev.in
# pytest-cov
# pytest-django
# pytest-freezegun
# pytest-lazy-fixture
# pytest-mock
# pytest-xdist
pytest-cov==4.1.0
# via -r requirements-dev.in
pytest-django==4.5.2
# via -r requirements-dev.in
pytest-freezegun==0.4.2
Expand Down
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
[![Docker Pulls](https://img.shields.io/docker/pulls/flagsmith/flagsmith)](https://hub.docker.com/u/flagsmith)
[![Docker Image Size](https://img.shields.io/docker/image-size/flagsmith/flagsmith)](https://hub.docker.com/r/flagsmith/flagsmith)
[![Join the Discord chat](https://img.shields.io/discord/517647859495993347)](https://discord.gg/hFhxNtXzgm)
[![Coverage](https://codecov.io/gh/Flagsmith/flagsmith/branch/master/graph/badge.svg?token=IyGii7VSdc)](https://codecov.io/gh/Flagsmith/flagsmith)

[Flagsmith](https://flagsmith.com/) is an open source, fully featured, Feature Flag and Remote Config service. Use our
hosted API, deploy to your own private cloud, or run on-premise.
Expand Down

3 comments on commit 1389c6e

@vercel
Copy link

@vercel vercel bot commented on 1389c6e Jul 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

docs – ./docs

docs-flagsmith.vercel.app
docs-git-main-flagsmith.vercel.app
docs.flagsmith.com
docs.bullet-train.io

@vercel
Copy link

@vercel vercel bot commented on 1389c6e Jul 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 1389c6e Jul 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.