diff --git a/.github/workflows/testing.yaml b/.github/workflows/testing.yaml index 7eab4793..fc9975b0 100644 --- a/.github/workflows/testing.yaml +++ b/.github/workflows/testing.yaml @@ -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" diff --git a/.github/workflows/testing_external_plugins.yaml b/.github/workflows/testing_external_plugins.yaml new file mode 100644 index 00000000..7bcce735 --- /dev/null +++ b/.github/workflows/testing_external_plugins.yaml @@ -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" diff --git a/features/core.feature b/features/core.feature index fea05fc5..26640c00 100644 --- a/features/core.feature +++ b/features/core.feature @@ -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 " : from jrnl.plugins.exporter._exporter" - Examples: - | plugin_name | plugin_source | version | - | md | markdown | v2.7.2-beta | - | testing | testing | v0.0.1 | - @todo Scenario: Listing available journals diff --git a/features/plugins.feature b/features/plugins.feature new file mode 100644 index 00000000..8e7e08f2 --- /dev/null +++ b/features/plugins.feature @@ -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 " : from jrnl..." + 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 " : from jrnl..." + 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 " : from jrnl..." + + Examples: + | plugin_name | version | source | type | filename | + | json | v2.7.2-beta | plugins | exporter | json | + | txt | v2.7.2-beta | plugins | exporter | text |