Merge pull request #151 from Salamandar/fix_parse_tests

Fix parse_tests_toml, oopsie on pathlib, and in the calling bash script
This commit is contained in:
Alexandre Aubin 2024-01-28 23:27:14 +01:00 committed by GitHub
commit 12412eb5a5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View file

@ -99,7 +99,7 @@ def filter_test_list(test_manifest, base_test_list):
yield test_suite_id, tests_for_this_suite yield test_suite_id, tests_for_this_suite
def dump_for_package_check(test_list, package_check_tests_dir): def dump_for_package_check(test_list: dict[str, dict[str, Any]], package_check_tests_dir: Path) -> None:
test_suite_i = 0 test_suite_i = 0
@ -133,7 +133,7 @@ def dump_for_package_check(test_list, package_check_tests_dir):
test_file_id = test_suite_i * 100 + subtest_i test_file_id = test_suite_i * 100 + subtest_i
json.dump(J, open(package_check_tests_dir + f"/{test_file_id}.json", "w")) json.dump(J, (package_check_tests_dir / f"{test_file_id}.json").open("w"))
def build_test_list(basedir: Path) -> dict[str, dict[str, Any]]: def build_test_list(basedir: Path) -> dict[str, dict[str, Any]]:
@ -143,7 +143,7 @@ def build_test_list(basedir: Path) -> dict[str, dict[str, Any]]:
manifest = json.load((basedir / "manifest.json").open("r")) manifest = json.load((basedir / "manifest.json").open("r"))
is_multi_instance = manifest.get("multi_instance") is True is_multi_instance = manifest.get("multi_instance") is True
else: else:
manifest = json.load((basedir / "manifest.toml").open("r")) manifest = toml.load((basedir / "manifest.toml").open("r"))
is_multi_instance = manifest.get("integration").get("multi_instance") is True is_multi_instance = manifest.get("integration").get("multi_instance") is True
is_webapp = os.system(f"grep -q '^ynh_add_nginx_config' '{str(basedir)}/scripts/install'") == 0 is_webapp = os.system(f"grep -q '^ynh_add_nginx_config' '{str(basedir)}/scripts/install'") == 0

View file

@ -37,7 +37,7 @@ run_all_tests() {
tests_toml="$package_path/tests.toml" tests_toml="$package_path/tests.toml"
if [ -e "$tests_toml" ] if [ -e "$tests_toml" ]
then then
DIST=$DIST python3 "./lib/parse_tests_toml.py" "$package_path" "$TEST_CONTEXT/tests" DIST=$DIST "./lib/parse_tests_toml.py" "$package_path" --dump-to "$TEST_CONTEXT/tests"
else else
# Parse the check_process only if it's exist # Parse the check_process only if it's exist
check_process="$package_path/check_process" check_process="$package_path/check_process"