diff --git a/.gitlab/ci/test.gitlab-ci.yml b/.gitlab/ci/test.gitlab-ci.yml index e98927f38..1165e4826 100644 --- a/.gitlab/ci/test.gitlab-ci.yml +++ b/.gitlab/ci/test.gitlab-ci.yml @@ -37,7 +37,7 @@ full-tests: - *install_debs - yunohost tools postinstall -d domain.tld -p the_password --ignore-dyndns --force-diskspace script: - - python3 -m pytest --cov=yunohost tests/ src/tests/ src/diagnosis/ --junitxml=report.xml + - python3 -m pytest --cov=yunohost tests/ src/tests/ src/diagnosers/ --junitxml=report.xml - cd tests - bash test_helpers.sh needs: @@ -59,7 +59,7 @@ test-i18n-keys: changes: - locales/en.json - src/*.py - - src/diagnosis/*.py + - src/diagnosers/*.py test-translation-format-consistency: extends: .test-stage diff --git a/src/diagnosis/00-basesystem.py b/src/diagnosers/00-basesystem.py similarity index 100% rename from src/diagnosis/00-basesystem.py rename to src/diagnosers/00-basesystem.py diff --git a/src/diagnosis/10-ip.py b/src/diagnosers/10-ip.py similarity index 100% rename from src/diagnosis/10-ip.py rename to src/diagnosers/10-ip.py diff --git a/src/diagnosis/12-dnsrecords.py b/src/diagnosers/12-dnsrecords.py similarity index 100% rename from src/diagnosis/12-dnsrecords.py rename to src/diagnosers/12-dnsrecords.py diff --git a/src/diagnosis/14-ports.py b/src/diagnosers/14-ports.py similarity index 100% rename from src/diagnosis/14-ports.py rename to src/diagnosers/14-ports.py diff --git a/src/diagnosis/21-web.py b/src/diagnosers/21-web.py similarity index 100% rename from src/diagnosis/21-web.py rename to src/diagnosers/21-web.py diff --git a/src/diagnosis/24-mail.py b/src/diagnosers/24-mail.py similarity index 100% rename from src/diagnosis/24-mail.py rename to src/diagnosers/24-mail.py diff --git a/src/diagnosis/30-services.py b/src/diagnosers/30-services.py similarity index 100% rename from src/diagnosis/30-services.py rename to src/diagnosers/30-services.py diff --git a/src/diagnosis/50-systemresources.py b/src/diagnosers/50-systemresources.py similarity index 100% rename from src/diagnosis/50-systemresources.py rename to src/diagnosers/50-systemresources.py diff --git a/src/diagnosis/70-regenconf.py b/src/diagnosers/70-regenconf.py similarity index 100% rename from src/diagnosis/70-regenconf.py rename to src/diagnosers/70-regenconf.py diff --git a/src/diagnosis/80-apps.py b/src/diagnosers/80-apps.py similarity index 100% rename from src/diagnosis/80-apps.py rename to src/diagnosers/80-apps.py diff --git a/src/diagnosis/__init__.py b/src/diagnosers/__init__.py similarity index 100% rename from src/diagnosis/__init__.py rename to src/diagnosers/__init__.py diff --git a/src/diagnosis.py b/src/diagnosis.py index a7b6c725c..67128217c 100644 --- a/src/diagnosis.py +++ b/src/diagnosis.py @@ -660,7 +660,7 @@ class Diagnoser: def _list_diagnosis_categories(): - paths = glob.glob(os.path.dirname(__file__) + "/diagnosis/??-*.py") + paths = glob.glob(os.path.dirname(__file__) + "/diagnosers/??-*.py") names = sorted([os.path.basename(path)[: -len(".py")] for path in paths]) return names @@ -670,7 +670,7 @@ def _load_diagnoser(diagnoser_name): logger.debug(f"Loading diagnoser {diagnoser_name}") - paths = glob.glob(os.path.dirname(__file__) + f"/diagnosis/??-{diagnoser_name}.py") + paths = glob.glob(os.path.dirname(__file__) + f"/diagnosers/??-{diagnoser_name}.py") if len(paths) != 1: raise YunohostError(f"Uhoh, found several matches (or none?) for diagnoser {diagnoser_name} : {paths}", raw_msg=True) @@ -681,7 +681,7 @@ def _load_diagnoser(diagnoser_name): # this is python builtin method to import a module using a name, we # use that to import the migration as a python object so we'll be # able to run it in the next loop - module = import_module("yunohost.diagnosis.{}".format(module_id)) + module = import_module("yunohost.diagnosers.{}".format(module_id)) return module.MyDiagnoser() except Exception as e: import traceback diff --git a/tests/add_missing_keys.py b/tests/add_missing_keys.py index e1ecbf56e..ebee80a1b 100644 --- a/tests/add_missing_keys.py +++ b/tests/add_missing_keys.py @@ -28,7 +28,7 @@ def find_expected_string_keys(): python_files.extend(glob.glob("src/utils/*.py")) python_files.extend(glob.glob("src/migrations/*.py")) python_files.extend(glob.glob("src/authenticators/*.py")) - python_files.extend(glob.glob("src/diagnosis/*.py")) + python_files.extend(glob.glob("src/diagnosers/*.py")) python_files.append("bin/yunohost") for python_file in python_files: @@ -51,7 +51,7 @@ def find_expected_string_keys(): # For each diagnosis, try to find strings like "diagnosis_stuff_foo" (c.f. diagnosis summaries) # Also we expect to have "diagnosis_description_" for each diagnosis p3 = re.compile(r"[\"\'](diagnosis_[a-z]+_\w+)[\"\']") - for python_file in glob.glob("src/diagnosis/*.py"): + for python_file in glob.glob("src/diagnosers/*.py"): content = open(python_file).read() for m in p3.findall(content): if m.endswith("_"): diff --git a/tests/test_i18n_keys.py b/tests/test_i18n_keys.py index b25d35923..62cad7cbb 100644 --- a/tests/test_i18n_keys.py +++ b/tests/test_i18n_keys.py @@ -29,7 +29,7 @@ def find_expected_string_keys(): python_files.extend(glob.glob("src/utils/*.py")) python_files.extend(glob.glob("src/migrations/*.py")) python_files.extend(glob.glob("src/authenticators/*.py")) - python_files.extend(glob.glob("src/diagnosis/*.py")) + python_files.extend(glob.glob("src/diagnosers/*.py")) python_files.append("bin/yunohost") for python_file in python_files: @@ -52,7 +52,7 @@ def find_expected_string_keys(): # For each diagnosis, try to find strings like "diagnosis_stuff_foo" (c.f. diagnosis summaries) # Also we expect to have "diagnosis_description_" for each diagnosis p3 = re.compile(r"[\"\'](diagnosis_[a-z]+_\w+)[\"\']") - for python_file in glob.glob("src/diagnosis/*.py"): + for python_file in glob.glob("src/diagnosers/*.py"): content = open(python_file).read() for m in p3.findall(content): if m.endswith("_"):