Skip to content

Commit

Permalink
[REM] remove old system testing of linters
Browse files Browse the repository at this point in the history
see more details on Tecnativa#425 (comment)
  • Loading branch information
celm1990 committed Nov 14, 2023
1 parent 7298b72 commit 5d858f0
Show file tree
Hide file tree
Showing 24 changed files with 1 addition and 1,796 deletions.
50 changes: 0 additions & 50 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
projects generated with it.
"""
import re
import tempfile
from pathlib import Path
from unittest import mock

Expand Down Expand Up @@ -85,52 +84,3 @@ def test(c, verbose=False, sequential=False, docker=True):
cmd = f"poetry run pytest {flags} tests"
with c.cd(str(TEMPLATE_ROOT)):
c.run(cmd)


@task(develop)
def update_test_samples(c):
"""Update test samples renderings.
Since this project is just a template, some render results are stored as
tests to be able to check the templates produce the right results.
However, when something changes, the samples must be properly updated and
reviewed to make sure they are still OK.
This job updates all those samples.
"""
with c.cd(str(TEMPLATE_ROOT)):
# Make sure git repo is clean
try:
c.run("git diff --quiet --exit-code")
except Exception:
print("git repo is dirty; clean it and repeat")
raise
copier_conf = _load_copier_conf()
odoo_versions = copier_conf["odoo_version"]["choices"]
samples = Path("tests", "samples")
for odoo_version in odoo_versions:
with tempfile.TemporaryDirectory(
prefix="dct-samples"
) as dct_copy_path, tempfile.TemporaryDirectory(
prefix="oca-samples"
) as oca_copy_path:
c.run(
"poetry run copier copy --trust -fr HEAD -x '**' -x '!.pylintrc*' -x '!tasks.py' -x '!common.yaml' "
f"-d odoo_version={odoo_version} . {dct_copy_path}"
)
oca_template_version = odoo_version if odoo_version >= 13 else 13.0
c.run(
"poetry run copier copy --trust -fr HEAD -x '**' -x '!.pylintrc*' "
f"-d odoo_version={oca_template_version}"
" -d repo_slug=test -d repo_name=test -d repo_description=test"
f" vendor/oca-addons-repo-template {oca_copy_path}"
)
for file_name in (".pylintrc", ".pylintrc-mandatory"):
with open(
samples / "mqt-diffs" / f"v{odoo_version}-{file_name}.diff", "w"
) as fd:
copied = Path(dct_copy_path, file_name)
mqt = Path(oca_copy_path, file_name)
fd.write(c.run(f"diff {copied} {mqt}", warn=True).stdout)
c.run("poetry run pre-commit run -a", warn=True)
57 changes: 0 additions & 57 deletions tests/samples/mqt-diffs/v10.0-.pylintrc-mandatory.diff

This file was deleted.

77 changes: 0 additions & 77 deletions tests/samples/mqt-diffs/v10.0-.pylintrc.diff

This file was deleted.

57 changes: 0 additions & 57 deletions tests/samples/mqt-diffs/v11.0-.pylintrc-mandatory.diff

This file was deleted.

77 changes: 0 additions & 77 deletions tests/samples/mqt-diffs/v11.0-.pylintrc.diff

This file was deleted.

57 changes: 0 additions & 57 deletions tests/samples/mqt-diffs/v12.0-.pylintrc-mandatory.diff

This file was deleted.

Loading

0 comments on commit 5d858f0

Please sign in to comment.