Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more steps to pytest, fully remove behave #1347

Merged
merged 7 commits into from Oct 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 3 additions & 7 deletions .github/workflows/testing.yaml
Expand Up @@ -55,7 +55,7 @@ jobs:
if: ${{ matrix.python-version != '3.10-dev' }}
run: |
echo '::group::poetry'
pip install poetry
pip --disable-pip-version-check install poetry
poetry config --local virtualenvs.in-project true
echo '::endgroup::'

Expand All @@ -70,7 +70,7 @@ jobs:
if: ${{ matrix.python-version == '3.10-dev' }}
run: |
echo '::group::poetry'
pip install poetry==1.2.0a2
pip --disable-pip-version-check install poetry==1.2.0a2
poetry config --local virtualenvs.in-project true
echo '::endgroup::'

Expand All @@ -90,12 +90,8 @@ jobs:
if: ${{ matrix.python-version != '3.10-dev' && env.DEPS_INSTALLED == 'true' }}
run: |
poetry run pflake8 --version
poetry run pflake8 jrnl features tests
poetry run pflake8 jrnl tests

- name: Test with pytest
if: ${{ env.DEPS_INSTALLED == 'true' }}
run: poetry run pytest --junitxml=reports/pytest/results.xml

- name: Test with behave
if: ${{ env.DEPS_INSTALLED == 'true' }}
run: poetry run behave --no-skipped --format progress2 --junit --junit-directory reports/behave
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Expand Up @@ -96,9 +96,9 @@ A typical development workflow includes:

When resolving bugs or adding new functionality, please add tests to prevent that functionality from breaking in the future. If you notice any functionality that isn't covered in the tests, feel free to submit a test-only pull request as well.

For integration testing, jrnl uses [behave](https://behave.readthedocs.io/) tests, which are all in the `features` folder.
For testing, jrnl uses [pytest](https://docs.pytest.org) for unit tests, and [pytest-bdd](https://pytest-bdd.readthedocs.io/) for integration testing. All tests are in the `tests` folder.

Many tests can be created by only editing `feature` files with the same format as other tests. For more complicated functionality, you may need to implement steps in `features/steps` which are then executed by your tests in the `feature` files.
Many tests can be created by only editing `*.feature` files with the same format as other tests. For more complicated functionality, you may need to implement steps in `tests/lib/` which are then executed by your tests in the `feature` files.

Starting in 2020, jrnl is also using [pytest](https://docs.pytest.org/) for unit tests. These tests are in the `tests` folder.

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -30,7 +30,7 @@ bdd: # bdd tests
bdd-debug: # bdd tests
poetry run pytest tests/bdd --gherkin-terminal-reporter --tb=native -x -vv

test: lint unit bdd ## Run unit tests and behave tests
test: lint unit bdd

build:
poetry build
Expand Down
8 changes: 0 additions & 8 deletions features/build.feature

This file was deleted.

21 changes: 0 additions & 21 deletions features/core.feature

This file was deleted.

17 changes: 0 additions & 17 deletions features/data/configs/basic_dayone.yaml

This file was deleted.

17 changes: 0 additions & 17 deletions features/data/configs/basic_encrypted.yaml

This file was deleted.

17 changes: 0 additions & 17 deletions features/data/configs/basic_folder.yaml

This file was deleted.

17 changes: 0 additions & 17 deletions features/data/configs/basic_onefile.yaml

This file was deleted.

12 changes: 0 additions & 12 deletions features/data/configs/brackets.yaml

This file was deleted.

17 changes: 0 additions & 17 deletions features/data/configs/bug153.yaml

This file was deleted.

13 changes: 0 additions & 13 deletions features/data/configs/bug343.yaml

This file was deleted.

12 changes: 0 additions & 12 deletions features/data/configs/bug780.yaml

This file was deleted.

12 changes: 0 additions & 12 deletions features/data/configs/dayone.yaml

This file was deleted.

17 changes: 0 additions & 17 deletions features/data/configs/dayone_empty.yaml

This file was deleted.

12 changes: 0 additions & 12 deletions features/data/configs/deletion.yaml

This file was deleted.

12 changes: 0 additions & 12 deletions features/data/configs/deletion_filters.yaml

This file was deleted.

12 changes: 0 additions & 12 deletions features/data/configs/editor-args.yaml

This file was deleted.

12 changes: 0 additions & 12 deletions features/data/configs/editor.yaml

This file was deleted.

12 changes: 0 additions & 12 deletions features/data/configs/editor_empty_folder.yaml

This file was deleted.

17 changes: 0 additions & 17 deletions features/data/configs/editor_encrypted.yaml

This file was deleted.

18 changes: 0 additions & 18 deletions features/data/configs/editor_markdown_extension.yaml

This file was deleted.

12 changes: 0 additions & 12 deletions features/data/configs/empty_folder.yaml

This file was deleted.

12 changes: 0 additions & 12 deletions features/data/configs/encrypted.yaml

This file was deleted.

13 changes: 0 additions & 13 deletions features/data/configs/encrypted_old.json

This file was deleted.

11 changes: 0 additions & 11 deletions features/data/configs/encrypted_old.yaml

This file was deleted.