Skip to content

Commit

Permalink
Merge pull request #73 from OpenDataServices/rhiaro/8-test
Browse files Browse the repository at this point in the history
ci: run tests, fixes #8
  • Loading branch information
rhiaro committed Mar 10, 2021
2 parents 3912b97 + ab3ced4 commit 3d60adc
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 1 deletion.
23 changes: 23 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Test

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup python
uses: actions/setup-python@v2
with:
python-version: 3.9.1
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements_dev.txt
- name: Run tests
run: coverage run --source='./standards_lab' ./standards_lab/manage.py test ./standards_lab

- env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: coveralls --service=github
23 changes: 22 additions & 1 deletion docs/developer/tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,25 @@ In the top level directory run:

```bash
$ ln -s ./pre-commit.sh ./.git/hooks/pre-commit
```
```

## Running tests locally

Tests for the API, UI and processor are in their respective directories.

### With docker

To run the tests with a docker development setup:

```bash
$ docker-compose run standards-lab-worker standards_lab/manage.py test standards_lab
```

### Locally

To run the tests in your local virtual environment:

```bash
$ cd standards_lab
$ python manage.py test
```
1 change: 1 addition & 0 deletions requirements_dev.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
black
flake8
selenium
coveralls
7 changes: 7 additions & 0 deletions requirements_dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ contextlib2==0.6.0.post1
# via schema
dealer==2.1.0
# via libcoveweb
coverage==5.5
# via coveralls
coveralls==3.0.1
# via -r requirements_dev.in
defusedxml==0.6.0
# via odfpy
django-bootstrap3==14.2.0
Expand All @@ -55,6 +59,8 @@ django==2.2.19
# django-redis
# django-rq
# libcoveweb
docopt==0.6.2
# via coveralls
et-xmlfile==1.0.1
# via openpyxl
flake8==3.8.4
Expand Down Expand Up @@ -126,6 +132,7 @@ regex==2020.11.13
# via black
requests==2.25.1
# via
# coveralls
# libcove
# libcoveweb
rfc3987==1.3.8
Expand Down

0 comments on commit 3d60adc

Please sign in to comment.