From 5a0fedd57675699618127df5a012edcd21fb4717 Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Mon, 27 Sep 2021 15:45:59 +0200 Subject: [PATCH] try to fix tests question is why GALAXY_CONFIG_OVERRIDE_FILE_PATH is not set in the tests --- planemo/galaxy/test/actions.py | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/planemo/galaxy/test/actions.py b/planemo/galaxy/test/actions.py index 856f3d29f..f26cc81ac 100644 --- a/planemo/galaxy/test/actions.py +++ b/planemo/galaxy/test/actions.py @@ -128,17 +128,18 @@ def run_in_config(ctx, config, run=run_galaxy_command, test_data_target_dir=None # check if tools created extra files in the file_path all files in the files path # - end with '.dat' or # - are contained in a directory `dataset_.*_files` - for (path, dirs, files) in os.walk(config.env["GALAXY_CONFIG_OVERRIDE_FILE_PATH"]): - for name in files: - if not (name.endswith(".dat") or re.match('.*/dataset_.*_files$', path)): - extra_files.append(os.path.join(path, name)) - if len(extra_files) > 0: - msg = f"One of the tested tools wrote to Galaxy's files dir: {extra_files}" - for i in range(len(structured_data["tests"])): - structured_data["tests"][i]["data"]["status"] = "failure" - structured_data["tests"][i]["data"]["job"]["stderr"] += msg - error(msg) - ec = 1 + if config.env.get("GALAXY_CONFIG_OVERRIDE_FILE_PATH"): + for (path, dirs, files) in os.walk(config.env.get("GALAXY_CONFIG_OVERRIDE_FILE_PATH")): + for name in files: + if not (name.endswith(".dat") or re.match('.*/dataset_.*_files$', path)): + extra_files.append(os.path.join(path, name)) + if len(extra_files) > 0: + msg = f"One of the tested tools wrote to Galaxy's files dir: {extra_files}" + for i in range(len(structured_data["tests"])): + structured_data["tests"][i]["data"]["status"] = "failure" + structured_data["tests"][i]["data"]["job"]["stderr"] += msg + error(msg) + ec = 1 return handle_reports_and_summary( ctx, structured_data,