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

Reduce difference between local and CI environments #1518

Merged
merged 3 commits into from
Jun 25, 2022
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions .github/actions/run_tests/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,7 @@ runs:
echo 'DEPS_INSTALLED=true' >> $GITHUB_ENV
shell: bash

- name: Linting
- name: Linting & Testing
if: ${{ env.DEPS_INSTALLED == 'true' }}
run: poetry run poe ci-lint
shell: bash

- name: Testing
if: ${{ env.DEPS_INSTALLED == 'true' }}
run: poetry run poe ci-test
run: poetry run poe test
shell: bash
83 changes: 35 additions & 48 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,40 +44,45 @@ pytz = ">=2020" # https://pythonhosted.org/pytz/#issues-limitations
tzlocal = ">2.0, <3.0" # https://github.com/regebro/tzlocal/blob/master/CHANGES.txt

[tool.poetry.dev-dependencies]
mkdocs = ">=1.0,<1.3"
black = { version = ">=21.5b2", allow-prereleases = true }
toml = ">=0.10"
pytest = ">=6.2"
pytest-bdd = ">=4.0.1"
ipdb = "*"
mkdocs = ">=1.0,<1.3"
poethepoet = "*"
pytest-clarity = "*"
pyproject-flake8 = "*"
yq = "*"
pytest = ">=6.2"
pytest-bdd = ">=4.0.1"
pytest-clarity = "*"
toml = ">=0.10"
tox = "*"

[tool.poetry.extras]
testing = [ "pytest", "pytest-bdd", "toml" ]
yq = "*"

[tool.poetry.scripts]
jrnl = 'jrnl.cli:cli'

[tool.poe.tasks]
format = "black ."
format-check = "black --check --diff ."
format-version = "black --version"

style-check = "pflake8 jrnl tests"
style-version = "pflake8 --version"

docs = "mkdocs serve"

test-unit = "tox -q -e unit --"
test-bdd = "tox -q -e bdd --"
test-all = "tox -e py --"
format-run = [
{cmd = "black ."},
]
format-check = [
{cmd = "black --version"},
{cmd = "black --check --diff ."},
]
style-check = [
{cmd = "pflake8 --version"},
{cmd = "pflake8 jrnl tests"},
]
# docs-check = ?
docs-run = [
{cmd = "mkdocs serve"},
]
test-run =[
{cmd = "tox -q -e py --"},
]

installer-check = "poetry check"
installer-version = "poetry --version"
installer-check = [
{cmd = "poetry --version"},
{cmd = "poetry check"},
]

# Groups of tasks
lint = [
Expand All @@ -88,21 +93,7 @@ lint = [

test = [
"lint",
"test-unit",
"test-bdd",
]

ci-lint = [
"installer-version",
"installer-check",
"style-version",
"style-check",
"format-version",
"format-check",
]

ci-test = [
"test-all",
"test-run",
]

[tool.isort]
Expand All @@ -125,7 +116,9 @@ markers = [
"on_posix",
]
addopts = [
"--pdbcls=IPython.terminal.debugger:Pdb"
"--pdbcls=IPython.terminal.debugger:Pdb",
"--gherkin-terminal-reporter",
"--tb=native",
]

filterwarnings = [
Expand All @@ -147,21 +140,15 @@ build-backend = "poetry.core.masonry.api"
# see: https://tox.wiki/en/latest/example/basic.html
legacy_tox_ini = """
[tox]
envlist = py-{unit,bdd}
envlist = py
isolated_build = True

[testenv]
deps =
pytest >= 6.2
pytest-bdd >=4.0.1
toml >=0.10
commands = pytest --junitxml=reports/pytest/results.xml {posargs}
passenv = HOME

[testenv:unit]
commands = pytest tests/unit {posargs}

[testenv:bdd]
commands = pytest tests/bdd --gherkin-terminal-reporter --tb=native {posargs}
commands = pytest {posargs}
passenv = HOME
"""