-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #38 from open-dynaMIX/tests
chore: add backend test infrastructure
- Loading branch information
Showing
30 changed files
with
886 additions
and
199 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Screenshots/ | ||
.dockerignore | ||
.git/ | ||
.github/ | ||
.gitignore | ||
.idea/ | ||
.pytest_cache/ | ||
README.md | ||
LICENSE | ||
CHANGELOG.md | ||
CONTRIBUTING.md |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Tests | ||
|
||
on: | ||
push: | ||
pull_request: | ||
schedule: | ||
- cron: '0 0 * * 0' | ||
|
||
jobs: | ||
tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Build the webui container | ||
run: docker-compose -f docker-compose.yml build --pull | ||
working-directory: ./tests | ||
- name: Run test suite | ||
run: docker-compose -f docker-compose.yml run --rm webui pytest ./tests.py -vv | ||
working-directory: ./tests | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Setup Python | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: '3.8' | ||
- name: Install requirements | ||
run: pip install -r requirements.txt | ||
working-directory: ./tests | ||
- name: Run black and flake8 | ||
run: | | ||
black --check --diff ./ | ||
flake8 | ||
working-directory: ./tests | ||
commit-lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Setup Python | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: '3.8' | ||
- name: Install gitlint | ||
run: pip install gitlint | ||
- name: Run gitlint | ||
run: gitlint --contrib contrib-title-conventional-commits --ignore B5,B6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
.idea/ | ||
.htpasswd | ||
dummy/ | ||
__pycache__/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# Contributing | ||
|
||
Contributions are very welcome! | ||
|
||
## Tooling | ||
Docker, docker-compose and some python tooling is used in development and testing, because that's what I know best :) | ||
|
||
## The ./tests directory | ||
|
||
All commands you'll need during dev are only available from within the `./tests` directory. | ||
|
||
```shell | ||
cd ./tests | ||
``` | ||
|
||
## Building the testing container | ||
|
||
```shell | ||
make build | ||
``` | ||
|
||
## Running the tests | ||
|
||
```shell | ||
make tests | ||
``` | ||
|
||
## Formatting & Linting the python tests | ||
|
||
For formatting and linting the python tests, following tools are used: | ||
|
||
- black | ||
- isort | ||
- flake8 | ||
|
||
## conventional commits | ||
For automatically generating release notes, commit messages are parsed. This only works, if they follow the | ||
[Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/). | ||
|
||
|
||
## Setup pre commit | ||
Pre commit hooks is an additional option instead of linting and formatting checks in your editor of choice. | ||
|
||
First create a virtualenv with the tool of your choice before running below commands: | ||
|
||
pip install pre-commit | ||
pip install -r requirements.txt | ||
pre-commit install --hook=pre-commit | ||
pre-commit install --hook=commit-msg | ||
|
||
## Generating the release notes | ||
Make sure [python-semantic-release](https://github.com/relekang/python-semantic-release) is | ||
installed and then run | ||
|
||
```shell | ||
make release-notes | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
repos: | ||
- repo: local | ||
hooks: | ||
- id: black | ||
stages: [commit] | ||
name: black | ||
language: system | ||
entry: black | ||
types: [python] | ||
- id: isort | ||
stages: [commit] | ||
name: isort | ||
language: system | ||
entry: isort -y | ||
types: [python] | ||
- id: flake8 | ||
stages: [commit] | ||
name: flake8 | ||
language: system | ||
entry: flake8 | ||
types: [python] | ||
- id: gitlint | ||
stages: [commit-msg] | ||
name: gitlint | ||
description: Validate commit lint | ||
entry: gitlint --ignore B5,B6 --msg-filename | ||
language: system |
Oops, something went wrong.