Skip to content

Commit

Permalink
Fixed CI errors
Browse files Browse the repository at this point in the history
- Fixed pandoc error
- Fixed multi-threading pytest inconsistency
  • Loading branch information
xchoo committed Dec 1, 2023
1 parent b6a7d8d commit e10fdfc
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ on:
required: false
default: false

defaults:
run:
shell: bash -el {0}

jobs:
test:
runs-on: ubuntu-latest
Expand All @@ -35,6 +39,10 @@ jobs:
- uses: nengo/nengo-bones/actions/setup@main
with:
python-version: "3.8"
- name: Install pandoc
if: ${{ matrix.script == 'docs' }}
run: |
micromamba install pandoc
- name: Install ffmpeg for docs
if: ${{ matrix.script == 'docs' }}
uses: FedericoCarboni/setup-ffmpeg@v2
Expand Down
12 changes: 12 additions & 0 deletions nengo_fpga/tests/test_networks.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
)


@pytest.mark.xdist_group(name="fpga_config")
def test_init(config_contents, gen_configs, mocker):
"""Test the FPGA network's init function."""

Expand Down Expand Up @@ -117,6 +118,7 @@ def test_func(x):
assert hasattr(dummy_net, "connection")


@pytest.mark.xdist_group(name="fpga_config")
def test_init_default(config_contents, gen_configs, mocker):
"""Test the FPGA network's init function."""

Expand Down Expand Up @@ -208,6 +210,7 @@ def test_data_filepath(dummy_net, mocker):
assert dummy_net.local_data_filepath == os.path.join(path, fname)


@pytest.mark.xdist_group(name="fpga_config")
def test_terminate_client(dummy_net, dummy_com, config_contents, mocker):
"""Test the FPGA network's terminate_client function."""

Expand All @@ -224,6 +227,7 @@ def test_terminate_client(dummy_net, dummy_com, config_contents, mocker):
assert send_mock.call_args_list[0][0][1] == address


@pytest.mark.xdist_group(name="fpga_config")
def test_close(dummy_net, dummy_com, mocker):
"""Test the FPGA network's close function."""

Expand Down Expand Up @@ -268,6 +272,7 @@ def test_close(dummy_net, dummy_com, mocker):
assert np.all(dummy_net.recv_buffer == 0)


@pytest.mark.xdist_group(name="fpga_config")
def test_cleanup(dummy_net, mocker):
"""Test the FPGA network's cleanup function."""

Expand All @@ -293,6 +298,7 @@ def test_cleanup(dummy_net, mocker):
@pytest.mark.parametrize(
"ssh_method", [None, ("ssh_pwd", "passwd"), ("ssh_key", "key-path")]
)
@pytest.mark.xdist_group(name="fpga_config")
def test_connect_ssh_client(
ssh_method, dummy_net, config_contents, gen_configs, mocker
):
Expand Down Expand Up @@ -337,6 +343,7 @@ def test_connect_ssh_client(
)


@pytest.mark.xdist_group(name="fpga_config")
def test_connect_thread_func(dummy_net, dummy_com, config_contents, mocker):
"""
Test the FPGA network's connect_thread_func.
Expand Down Expand Up @@ -412,6 +419,7 @@ def test_connect_thread_func(dummy_net, dummy_com, config_contents, mocker):
net_close_mock.assert_called_once()


@pytest.mark.xdist_group(name="fpga_config")
def test_connect(dummy_net, mocker):
"""Test the FPGA network's connect function."""

Expand Down Expand Up @@ -574,6 +582,7 @@ def test_check_ssh_str(dummy_net):
assert error_strs[-1] == s


@pytest.mark.xdist_group(name="fpga_config")
def test_reset(dummy_net, mocker):
"""Test the FPGA network's reset function."""

Expand All @@ -596,6 +605,7 @@ def test_reset(dummy_net, mocker):
connect_mock.assert_called_once()


@pytest.mark.xdist_group(name="fpga_config")
def test_ssh_string(dummy_net, config_contents):
"""
Test we have the correct arguments in the string command.
Expand Down Expand Up @@ -704,6 +714,7 @@ class DummyRule(nengo.learning_rules.LearningRuleType):
_, _ = validate_net(dummy_net)


@pytest.mark.xdist_group(name="fpga_config")
def test_save_params(config_contents, gen_configs, mocker):
"""Test saving params to file."""

Expand Down Expand Up @@ -859,6 +870,7 @@ def recv_func(data):
assert val == x


@pytest.mark.xdist_group(name="fpga_config")
def test_builder(dummy_net, mocker):
"""Build a few networks to hit all the builder code."""

Expand Down

0 comments on commit e10fdfc

Please sign in to comment.