Skip to content

Commit

Permalink
Remove debug messages and restore pytest call
Browse files Browse the repository at this point in the history
Don't escape spaces when passing paths on the command line to cmake
  • Loading branch information
langmm committed Jul 15, 2024
1 parent 591677d commit 1a5118f
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 26 deletions.
20 changes: 5 additions & 15 deletions .github/workflows/test-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -546,9 +546,7 @@ jobs:
- if: runner.os == 'Windows' && matrix.install-method != 'conda' && matrix.install-method
!= 'mamba'
name: Run cmake test in command prompt (PIP)
run: pytest --import-mode=importlib --config-file=pyproject.toml --cov-config=.coveragerc
--cov-append --capture=no --log-level=INFO --verbose --ygg-debug --ignore=yggdrasil/rapidjson/
tests/drivers/test_CMakeModelDriver.py
run: pytest --ci --cov-append --nocapture --ygg-debug tests/drivers/test_CMakeModelDriver.py
shell: cmd /C CALL {0}
timeout-minutes: 180
- continue-on-error: true
Expand Down Expand Up @@ -965,9 +963,7 @@ jobs:
- if: runner.os == 'Windows' && matrix.install-method != 'conda' && matrix.install-method
!= 'mamba'
name: Run cmake test in command prompt (PIP)
run: pytest --import-mode=importlib --config-file=pyproject.toml --cov-config=.coveragerc
--cov-append --capture=no --log-level=INFO --verbose --ygg-debug --ignore=yggdrasil/rapidjson/
tests/drivers/test_CMakeModelDriver.py
run: pytest --ci --cov-append --nocapture --ygg-debug tests/drivers/test_CMakeModelDriver.py
shell: cmd /C CALL {0}
timeout-minutes: 180
- continue-on-error: true
Expand Down Expand Up @@ -1360,9 +1356,7 @@ jobs:
- if: runner.os == 'Windows' && matrix.install-method != 'conda' && matrix.install-method
!= 'mamba'
name: Run cmake test in command prompt (PIP)
run: pytest --import-mode=importlib --config-file=pyproject.toml --cov-config=.coveragerc
--cov-append --capture=no --log-level=INFO --verbose --ygg-debug --ignore=yggdrasil/rapidjson/
tests/drivers/test_CMakeModelDriver.py
run: pytest --ci --cov-append --nocapture --ygg-debug tests/drivers/test_CMakeModelDriver.py
shell: cmd /C CALL {0}
timeout-minutes: 180
- continue-on-error: true
Expand Down Expand Up @@ -1736,9 +1730,7 @@ jobs:
- if: runner.os == 'Windows' && matrix.install-method != 'conda' && matrix.install-method
!= 'mamba'
name: Run cmake test in command prompt (PIP)
run: pytest --import-mode=importlib --config-file=pyproject.toml --cov-config=.coveragerc
--cov-append --capture=no --log-level=INFO --verbose --ygg-debug --ignore=yggdrasil/rapidjson/
tests/drivers/test_CMakeModelDriver.py
run: pytest --ci --cov-append --nocapture --ygg-debug tests/drivers/test_CMakeModelDriver.py
shell: cmd /C CALL {0}
timeout-minutes: 180
- continue-on-error: true
Expand Down Expand Up @@ -2111,9 +2103,7 @@ jobs:
- if: runner.os == 'Windows' && matrix.install-method != 'conda' && matrix.install-method
!= 'mamba'
name: Run cmake test in command prompt (PIP)
run: pytest --import-mode=importlib --config-file=pyproject.toml --cov-config=.coveragerc
--cov-append --capture=no --log-level=INFO --verbose --ygg-debug --ignore=yggdrasil/rapidjson/
tests/drivers/test_CMakeModelDriver.py
run: pytest --ci --cov-append --nocapture --ygg-debug tests/drivers/test_CMakeModelDriver.py
shell: cmd /C CALL {0}
timeout-minutes: 180
- continue-on-error: true
Expand Down
2 changes: 1 addition & 1 deletion utils/test-install-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ jobs:
if: runner.os == 'Windows' && matrix.install-method != 'conda' && matrix.install-method != 'mamba'
shell: cmd /C CALL {0}
run: >-
pytest --import-mode=importlib --config-file=pyproject.toml --cov-config=.coveragerc --cov-append --capture=no --log-level=INFO --verbose --ygg-debug --ignore=yggdrasil/rapidjson/ tests/drivers/test_CMakeModelDriver.py
pytest --ci --cov-append --nocapture --ygg-debug tests/drivers/test_CMakeModelDriver.py
- name: Run tests (1st)
timeout-minutes: 180
id: test1
Expand Down
3 changes: 3 additions & 0 deletions yggdrasil/drivers/CMakeModelDriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,9 @@ def fix_path(cls, path, **kwargs):
# Force lists to be quoted
kwargs.setdefault(
'actions', ['doublequote', 'forwardslash', 'escapespace'])
elif kwargs.get('context', None) == 'flag':
kwargs.setdefault(
'actions', ['doublequote', 'forwardslash'])
return super(CMakeConfigure, cls).fix_path(path, **kwargs)


Expand Down
9 changes: 0 additions & 9 deletions yggdrasil/drivers/ModelDriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -883,17 +883,14 @@ def __init__(self, name, args, model_index=0, copy_index=-1, clients=[],
# Parse arguments
self.debug(str(args))
self.parse_arguments(args)
self.debug("Finished self.parse_arguments")
assert self.model_file is not None
# Add wrappers
self.write_wrappers()
# Initialize the model, creating files with inter-process locks
# if necessary
self.locked_file = None
self.debug("Before mpi_init")
with self.mpi_init():
self.init_model()
self.debug("Finished init")

def init_model(self):
r"""Initialize the model executable."""
Expand Down Expand Up @@ -1068,22 +1065,16 @@ def mpi_partner_process_requests(cls, self, expected):
def mpi_init(self):
r"""Context that initializes the MPI state of the model and locks
files for the 'init' condition."""
self.debug(f"Begin mpi_init: {self.locked_file}")
if self.locked_file is None:
self.locked_file = self.products.root
self.debug(f"Before create_file_lock: {self.locked_file}")
if self.locked_file:
self.create_file_lock(self.locked_file,
conditions=('init', 'cleanup'))
self.debug(f"Before send_mpi filelocks ({self._mpi_rank})")
if self._mpi_rank > 0:
self.send_mpi(self.file_locks.message,
tag=self._mpi_tags['FILELOCKS'])
self.debug("Before init lock")
with self.file_locks.locked_condition('init', self):
self.debug("Acquired init lock")
yield
self.debug("Releasing init lock")

@contextlib.contextmanager
def mpi_cleanup(self):
Expand Down
1 change: 0 additions & 1 deletion yggdrasil/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -2381,7 +2381,6 @@ def products(self):
def root(self):
r"""str: Root directory containing all products in the set."""
out = None
logger.info(f"Looking for root:\n{pprint.pformat(self.products)}")
for k in self.products:
if platform._is_win and '/' in k:
k = k.replace('/', os.path.sep)
Expand Down

0 comments on commit 1a5118f

Please sign in to comment.