Skip to content

Commit

Permalink
Test fix for pydsdl OpenCyphal#114
Browse files Browse the repository at this point in the history
This new test will cause a deadlock unless pydsdl#114 is fixed.
  • Loading branch information
thirtytwobits committed Jan 11, 2025
1 parent 3e12b06 commit a47f261
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/nunavut/_namespace.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def __init__(self, read_method: Callable[..., Any], args: Tuple[Any, ...]) -> No
self.read_method = read_method
self.args = args

def get(self, _: Optional[Any] = None) -> Any:
def get(self, timeout: Optional[Any] = None) -> Any: # pylint: disable=unused-argument
"""
Perform the work synchronously.
"""
Expand Down
2 changes: 1 addition & 1 deletion src/nunavut/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
__author__ = "OpenCyphal"
__copyright__ = "Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. Copyright (c) 2023 OpenCyphal."
__email__ = "[email protected]"
__pydsdl_version__ = ">= 1.22.1"
__pydsdl_version__ = ">= 1.22.2"
2 changes: 1 addition & 1 deletion submodules/pydsdl
24 changes: 23 additions & 1 deletion test/gentest_nnvg/test_nnvg.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def test_realgen_using_nnvg(gen_paths: Any, run_nnvg: Callable) -> None:
@pytest.mark.parametrize("jobs", [0, 1, 2])
def test_realgen_using_nnvg_jobs(gen_paths: Any, run_nnvg_main: Callable, jobs: int) -> None:
"""
Sanity test that nnvg can generate code from known types.
Verify stable behavior of nnvg with different job counts.
"""
public_regulated_data_types = gen_paths.root_dir / Path("submodules") / Path("public_regulated_data_types")

Expand All @@ -77,6 +77,28 @@ def test_realgen_using_nnvg_jobs(gen_paths: Any, run_nnvg_main: Callable, jobs:
assert get_info.exists()


@pytest.mark.parametrize("jobs", [0, 1, 2])
def test_realgen_using_nnvg_failure(gen_paths: Any, run_nnvg_main: Callable, jobs: int) -> None:
"""
Ensure pydsdl errors are properly propagated.
"""

nnvg_args0 = [
"--outdir",
gen_paths.out_dir.as_posix(),
"-j",
str(jobs),
"-l",
"c",
"--lookup-dir",
Path("wrong"),
(Path("uavcan", "node", "430.GetInfo.1.0.dsdl")).as_posix(),
]

with pytest.raises(pydsdl.FrontendError):
run_nnvg_main(gen_paths, nnvg_args0)


def test_DSDL_INCLUDE_PATH(gen_paths: Any, run_nnvg_main: Callable) -> None:
"""
Verify that the DSDL_INCLUDE_PATH environment variable is used by nnvg.
Expand Down

0 comments on commit a47f261

Please sign in to comment.