Skip to content

Commit

Permalink
debugging autotest call on Windows. natcap#755; natcap#74
Browse files Browse the repository at this point in the history
  • Loading branch information
davemfish committed Jan 24, 2023
1 parent a902543 commit 33b5d48
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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)

Expand Down Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions scripts/invest-autotest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 33b5d48

Please sign in to comment.