mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-18 20:18:32 +02:00
[Test] run different tests with or without the external plugins installed
This commit is contained in:
parent
aa6e0a7c84
commit
6c98c7cdfc
4 changed files with 123 additions and 53 deletions
44
.github/workflows/testing.yaml
vendored
44
.github/workflows/testing.yaml
vendored
|
@ -69,46 +69,4 @@ jobs:
|
|||
|
||||
- name: Test with behave
|
||||
if: success() || failure()
|
||||
run: poetry run behave --no-skipped --format progress2 --junit --junit-directory reports/behave
|
||||
|
||||
test-namespace-plugins:
|
||||
if: >
|
||||
! contains(github.event.head_commit.message, '[ci skip]')
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: [ 3.7, 3.8, 3.9 ]
|
||||
os: [ ubuntu-latest, macos-latest, windows-latest ]
|
||||
exclude: # Added for GitHub Actions PR problem 2020-12-19 -- remove later!
|
||||
- os: windows-latest
|
||||
python-version: 3.9
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: poetry cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: .venv
|
||||
key: ${{ runner.os }}-${{ hashFiles('poetry.lock') }}-${{ matrix.python-version }}-v2-namespace-plugins
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
pip install poetry
|
||||
poetry config --local virtualenvs.in-project true
|
||||
poetry add git+https://github.com/MinchinWeb/jrnl-rot13-exporter.git
|
||||
poetry install --remove-untracked
|
||||
poetry install
|
||||
|
||||
- name: Test with pytest
|
||||
if: success() || failure()
|
||||
run: poetry run pytest --junitxml=reports/pytest/results.xml
|
||||
|
||||
- name: Test with behave
|
||||
if: success() || failure()
|
||||
run: poetry run behave --no-skipped --format progress2 --junit --junit-directory reports/behave
|
||||
run: poetry run behave --no-skipped --format progress2 --junit --junit-directory reports/behave --tags "~external_plugins"
|
||||
|
|
62
.github/workflows/testing_external_plugins.yaml
vendored
Normal file
62
.github/workflows/testing_external_plugins.yaml
vendored
Normal file
|
@ -0,0 +1,62 @@
|
|||
name: Testing
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ develop, release ]
|
||||
paths:
|
||||
- 'jrnl/**'
|
||||
- 'features/**'
|
||||
- 'tests/**'
|
||||
- 'poetry.lock'
|
||||
- 'pyproject.toml'
|
||||
pull_request:
|
||||
branches: [ develop ]
|
||||
paths:
|
||||
- 'jrnl/**'
|
||||
- 'features/**'
|
||||
- 'tests/**'
|
||||
- 'poetry.lock'
|
||||
- 'pyproject.toml'
|
||||
|
||||
jobs:
|
||||
test-namespace-plugins:
|
||||
if: >
|
||||
! contains(github.event.head_commit.message, '[ci skip]')
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: [ 3.7, 3.8, 3.9 ]
|
||||
os: [ ubuntu-latest, macos-latest, windows-latest ]
|
||||
exclude: # Added for GitHub Actions PR problem 2020-12-19 -- remove later!
|
||||
- os: windows-latest
|
||||
python-version: 3.9
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: poetry cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: .venv
|
||||
key: ${{ runner.os }}-${{ hashFiles('poetry.lock') }}-${{ matrix.python-version }}-v2-namespace-plugins
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
pip install poetry
|
||||
poetry config --local virtualenvs.in-project true
|
||||
poetry add git+https://github.com/MinchinWeb/jrnl-rot13-exporter.git
|
||||
poetry install --remove-untracked
|
||||
poetry install
|
||||
|
||||
- name: Test with pytest
|
||||
if: success() || failure()
|
||||
run: poetry run pytest --junitxml=reports/pytest/results.xml
|
||||
|
||||
- name: Test with behave
|
||||
if: success() || failure()
|
||||
run: poetry run behave --no-skipped --format progress2 --junit --junit-directory reports/behave --tags "external_plugins"
|
|
@ -17,15 +17,5 @@ Feature: Functionality of jrnl outside of actually handling journals
|
|||
Then the output should contain "jrnl"
|
||||
And the output should contain "Python"
|
||||
|
||||
Scenario Outline: List plugin names in --version
|
||||
Given We use the config "basic_onefile.yaml"
|
||||
When We run "jrnl --version"
|
||||
Then the output should contain pyproject.toml version
|
||||
And The output should contain "<plugin_name> : <version> from jrnl.plugins.exporter.<plugin_source>_exporter"
|
||||
Examples:
|
||||
| plugin_name | plugin_source | version |
|
||||
| md | markdown | v2.7.2-beta |
|
||||
| testing | testing | v0.0.1 |
|
||||
|
||||
@todo
|
||||
Scenario: Listing available journals
|
||||
|
|
60
features/plugins.feature
Normal file
60
features/plugins.feature
Normal file
|
@ -0,0 +1,60 @@
|
|||
Feature: Functionality of Importer and Exporter Plugins
|
||||
|
||||
not @external_plugins
|
||||
Scenario Outline: List buildin plugin names in --version
|
||||
Given We use the config "basic_onefile.yaml"
|
||||
When We run "jrnl --version"
|
||||
Then the output should contain pyproject.toml version
|
||||
And The output should contain "<plugin_name> : <version> from jrnl.<source>.<type>.<filename>"
|
||||
And the output should not contain "contrib"
|
||||
|
||||
Examples:
|
||||
| plugin_name | version | source | type | filename |
|
||||
| jrnl | v2.7.2-beta | plugins | importer | jrnl |
|
||||
| boxed | v2.7.2-beta | plugins | exporter | fancy |
|
||||
| dates | v2.7.2-beta | plugins | exporter | dates |
|
||||
| fancy | v2.7.2-beta | plugins | exporter | fancy |
|
||||
| json | v2.7.2-beta | plugins | exporter | json |
|
||||
| markdown | v2.7.2-beta | plugins | exporter | markdown |
|
||||
| md | v2.7.2-beta | plugins | exporter | markdown |
|
||||
| tags | v2.7.2-beta | plugins | exporter | tag |
|
||||
| text | v2.7.2-beta | plugins | exporter | text |
|
||||
| txt | v2.7.2-beta | plugins | exporter | text |
|
||||
| xml | v2.7.2-beta | plugins | exporter | xml |
|
||||
| yaml | v2.7.2-beta | plugins | exporter | yaml |
|
||||
|
||||
@external_plugins
|
||||
Scenario Outline: List external plugin names in --version
|
||||
Given We use the config "basic_onefile.yaml"
|
||||
When We run "jrnl --version"
|
||||
Then the output should contain pyproject.toml version
|
||||
And The output should contain "<plugin_name> : <version> from jrnl.<source>.<type>.<filename>"
|
||||
Examples:
|
||||
| plugin_name | version | source | type | filename |
|
||||
| jrnl | v2.7.2-beta | plugins | importer | jrnl |
|
||||
| json | v1.0.0 | contrib | importer | json |
|
||||
| boxed | v2.7.2-beta | plugins | exporter | fancy |
|
||||
| dates | v2.7.2-beta | plugins | exporter | dates |
|
||||
| fancy | v2.7.2-beta | plugins | exporter | fancy |
|
||||
| json | v1.0.0 | contrib | exporter | json |
|
||||
| markdown | v2.7.2-beta | plugins | exporter | markdown |
|
||||
| md | v2.7.2-beta | plugins | exporter | markdown |
|
||||
| tags | v2.7.2-beta | plugins | exporter | tag |
|
||||
| text | v2.7.2-beta | plugins | exporter | text |
|
||||
| txt | v1.0.0 | contrib | exporter | rot13 |
|
||||
| xml | v2.7.2-beta | plugins | exporter | xml |
|
||||
| yaml | v2.7.2-beta | plugins | exporter | yaml |
|
||||
| rot13 | v1.0.0 | contrib | exporter | rot13 |
|
||||
| testing | v0.0.1 | contrib | exporter | testing |
|
||||
|
||||
@external_plugins
|
||||
Scenario Outline: Do not list overridden plugin names in --version
|
||||
Given We use the config "basic_onefile.yaml"
|
||||
When We run "jrnl --version"
|
||||
Then the output should contain pyproject.toml version
|
||||
And the output should not contain "<plugin_name> : <version> from jrnl.<source>.<type>.<filename>"
|
||||
|
||||
Examples:
|
||||
| plugin_name | version | source | type | filename |
|
||||
| json | v2.7.2-beta | plugins | exporter | json |
|
||||
| txt | v2.7.2-beta | plugins | exporter | text |
|
Loading…
Add table
Reference in a new issue