Skip to content

Commit

Permalink
Mark additional cmake tests as requiring C++
Browse files Browse the repository at this point in the history
Raise an expection from build drivers if the target language driver is not installed
Don't capture log messages for RMQ testing jobs
  • Loading branch information
langmm committed Jun 28, 2024
1 parent a4701c3 commit 73f3cb8
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,8 @@ jobs:
--parametrize-language=sbml\", \"long-remote-service\":\"--long-running --remote-service\",
\"examples-rpc-lesson3\":\"--suites examples top --parametrize-example-name=rpc_lesson3\",
\"tools\":\"tests/test_tools.py\", \"long-interp\":\"--long-running --languages
python R matlab\", \"services\":\"tests/test_services.py --nocapture\"}" >>
$GITHUB_OUTPUT
python R matlab --nocapture\", \"services\":\"tests/test_services.py --nocapture\"}"
>> $GITHUB_OUTPUT
schema:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
name: Update the schema used by the model submission form
Expand Down
13 changes: 12 additions & 1 deletion tests/drivers/test_CMakeModelDriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,22 @@ def test_CMakeBuilder(scripts):


@pytest.mark.absent_language('cmake')
def test_CMakeModelDriver_no_cmake(scripts): # pragma: windows
r"""Test CMakeModelDriver error when cmake not installed."""
with pytest.raises(RuntimeError):
CMakeModelDriver('test', scripts['cmake'])


@pytest.mark.language('cmake')
@pytest.mark.absent_language('c++')
def test_CMakeModelDriver_no_C_library(scripts): # pragma: windows
r"""Test CMakeModelDriver error when C library not installed."""
r"""Test CMakeModelDriver error when C++ library not installed."""
with pytest.raises(RuntimeError):
CMakeModelDriver('test', scripts['cmake'])


@pytest.mark.language('cmake')
@pytest.mark.language('c++')
def test_CMakeModelDriver_error_cmake(scripts):
r"""Test CMakeModelDriver error for invalid cmake args."""
makedir, target = os.path.split(scripts['cmake'])
Expand All @@ -54,6 +63,7 @@ def test_CMakeModelDriver_error_cmake(scripts):


@pytest.mark.language('cmake')
@pytest.mark.language('c++')
def test_CMakeModelDriver_error_notarget(scripts):
r"""Test CMakeModelDriver error for invalid target."""
makedir, target = os.path.split(scripts['cmake'])
Expand All @@ -67,6 +77,7 @@ def test_CMakeModelDriver_error_notarget(scripts):


@pytest.mark.language('cmake')
@pytest.mark.language('c++')
def test_CMakeModelDriver_error_nofile():
r"""Test CMakeModelDriver error for missing CMakeLists.txt."""
sourcedir = os.path.dirname(__file__)
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 @@ -48,7 +48,7 @@ jobs:
- id: set-os-versions
run: echo "versions={\"ubuntu\":\"latest\", \"macos\":\"latest\", \"windows\":\"latest\"}" >> $GITHUB_OUTPUT
- id: set-test-flags
run: echo "testflags={\"empty\":\"\", \"basic\":\"--long-running --suites timing demos top\", \"examples\":\"--suite=examples --extra-examples --mpi-script=run_mpi.sh --mpi-nproc=3\", \"types-no-c\":\"--suite=types --skip-languages c cpp\", \"types-c\":\"--suite=types --languages c cpp\", \"long\":\"--long-running\", \"long-mpi\":\"--long-running --mpi-script=run_mpi.sh\", \"examples-backwards\":\"--suite=examples --parametrize-example-name=backwards\", \"examples-sbml\":\"--suites examples --parametrize-language=sbml\", \"long-remote-service\":\"--long-running --remote-service\", \"examples-rpc-lesson3\":\"--suites examples top --parametrize-example-name=rpc_lesson3\", \"tools\":\"tests/test_tools.py\", \"long-interp\":\"--long-running --languages python R matlab\", \"services\":\"tests/test_services.py --nocapture\"}" >> $GITHUB_OUTPUT
run: echo "testflags={\"empty\":\"\", \"basic\":\"--long-running --suites timing demos top\", \"examples\":\"--suite=examples --extra-examples --mpi-script=run_mpi.sh --mpi-nproc=3\", \"types-no-c\":\"--suite=types --skip-languages c cpp\", \"types-c\":\"--suite=types --languages c cpp\", \"long\":\"--long-running\", \"long-mpi\":\"--long-running --mpi-script=run_mpi.sh\", \"examples-backwards\":\"--suite=examples --parametrize-example-name=backwards\", \"examples-sbml\":\"--suites examples --parametrize-language=sbml\", \"long-remote-service\":\"--long-running --remote-service\", \"examples-rpc-lesson3\":\"--suites examples top --parametrize-example-name=rpc_lesson3\", \"tools\":\"tests/test_tools.py\", \"long-interp\":\"--long-running --languages python R matlab --nocapture\", \"services\":\"tests/test_services.py --nocapture\"}" >> $GITHUB_OUTPUT
test_pip:
needs: params
name: Test (${{ matrix.python-version }}, ${{ matrix.os-base }}, ${{ matrix.install-method }}, ${{ matrix.test-flags1 }}, ${{ matrix.test-flags2 }}), Install C = ${{ matrix.install-c }}
Expand Down
3 changes: 3 additions & 0 deletions yggdrasil/drivers/BuildModelDriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,9 @@ def init_model_dep(self, **kwargs):
self.target_language_driver = (
components.import_component(
'model', self.target_language))
if not self.target_language_driver.is_installed():
raise RuntimeError(f"Target language \"{self.language}\" is "
f"not installed")
if self.target_compiler is None:
self.target_compiler = self.target_language_driver.get_tool(
'compiler', return_prop='name')
Expand Down

0 comments on commit 73f3cb8

Please sign in to comment.