From 33b5d484a83522030b134125ba357b0286e8663b Mon Sep 17 00:00:00 2001 From: davemfish Date: Mon, 23 Jan 2023 11:25:43 -0500 Subject: [PATCH] debugging autotest call on Windows. #755; #74 --- Makefile | 5 ++--- scripts/invest-autotest.py | 3 +++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 338813eb75..edada259f5 100644 --- a/Makefile +++ b/Makefile @@ -112,8 +112,6 @@ TESTRUNNER := pytest -vs --import-mode=importlib --durations=0 DATAVALIDATOR := $(PYTHON) scripts/invest-autovalidate.py $(GIT_SAMPLE_DATA_REPO_PATH) TEST_DATAVALIDATOR := $(PYTHON) -m pytest -vs scripts/invest-autovalidate.py -INVEST_AUTOTESTER := $(PYTHON) scripts/invest-autotest.py --cwd $(GIT_SAMPLE_DATA_REPO_PATH) - UG_FILE_VALIDATOR := $(PYTHON) scripts/userguide-filevalidator.py $(GIT_UG_REPO_PATH) # Target names. @@ -134,6 +132,7 @@ MAC_APPLICATION_BUNDLE_NAME := InVEST.app MAC_APPLICATION_BUNDLE_DIR := $(BUILD_DIR)/mac_app_$(VERSION) MAC_APPLICATION_BUNDLE := $(MAC_APPLICATION_BUNDLE_DIR)/$(MAC_APPLICATION_BUNDLE_NAME) +INVEST_AUTOTESTER := $(PYTHON) scripts/invest-autotest.py --cwd $(GIT_SAMPLE_DATA_REPO_PATH) --binary $(INVEST_BINARIES_DIR)/invest .PHONY: fetch install binaries apidocs userguide windows_installer mac_dmg sampledata sampledata_single test test_ui clean help check python_packages jenkins purge mac_zipfile deploy codesign_mac codesign_windows $(GIT_SAMPLE_DATA_REPO_PATH) $(GIT_TEST_DATA_REPO_PATH) $(GIT_UG_REPO_REV) @@ -183,7 +182,7 @@ validate_sampledata: $(GIT_SAMPLE_DATA_REPO_PATH) $(TEST_DATAVALIDATOR) $(DATAVALIDATOR) -invest_autotest: $(GIT_SAMPLE_DATA_REPO_PATH) +invest_autotest: $(GIT_SAMPLE_DATA_REPO_PATH) $(INVEST_BINARIES_DIR) $(INVEST_AUTOTESTER) validate_userguide_filenames: $(GIT_UG_REPO_PATH) diff --git a/scripts/invest-autotest.py b/scripts/invest-autotest.py index c25b5d0f2d..0305db8e87 100644 --- a/scripts/invest-autotest.py +++ b/scripts/invest-autotest.py @@ -62,6 +62,9 @@ def sh(command, capture=True): def run_model(modelname, binary, workspace, datastack): """Run an InVEST model, checking the error code of the process.""" + # Posix slashes in the exe are not acceptable on windows + if platform.system() == 'Windows': + binary = binary.replace('/', '\\') # Using a list here allows subprocess to handle escaping of paths. command = [binary, 'run', '--workspace', workspace, '--datastack', datastack, '--headless', modelname]