Skip to content

Commit

Permalink
waiting CI.
Browse files Browse the repository at this point in the history
  • Loading branch information
janiversen committed Jun 11, 2023
1 parent 7e577a8 commit ca91412
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 21 deletions.
21 changes: 17 additions & 4 deletions test/sub_examples/test_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
import pytest

from examples.build_bcd_payload import BcdPayloadBuilder, BcdPayloadDecoder
from examples.client_async import run_async_client, setup_async_client
from examples.client_async import run_a_few_calls, run_async_client, setup_async_client
from examples.client_calls import run_async_calls
from examples.client_custom_msg import run_custom_client
from examples.client_payload import run_payload_calls
from examples.datastore_simulator import run_server_simulator, setup_simulator
from examples.message_generator import generate_messages
from examples.message_parser import parse_messages
from examples.server_async import run_async_server
Expand Down Expand Up @@ -99,12 +100,24 @@ async def test_payload(self, mock_cmdline):
task.cancel()
await task

# client_payload.py
@pytest.mark.xdist_group(name="server_serialize")
async def test_datastore_simulator(self, use_port):
"""Test server simulator."""
cmdargs = ["--log", "debug", "--port", str(use_port)]
run_args = setup_simulator(cmdline=cmdargs)
task = asyncio.create_task(run_server_simulator(run_args))
await asyncio.sleep(0.1)
cmdargs.extend(["--host", "localhost"])
testclient = setup_async_client(cmdline=cmdargs)
await run_async_client(testclient, modbus_calls=run_a_few_calls)
await asyncio.sleep(0.1)
await ServerAsyncStop()
await asyncio.sleep(0.1)
task.cancel()
await task

# datastore_simulator.py
# modbus_forwarder.py
# server_callback.py
# server_payload.py
# server_updating.py

# simple_async_client.py
Expand Down
17 changes: 0 additions & 17 deletions test/sub_examples/test_old_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import pytest_asyncio

from examples.client_async import run_a_few_calls, run_async_client, setup_async_client
from examples.datastore_simulator import run_server_simulator, setup_simulator
from examples.server_async import run_async_server, setup_server
from examples.server_callback import run_callback_server
from examples.server_updating import run_updating_server, setup_updating_server
Expand Down Expand Up @@ -50,22 +49,6 @@ async def _helper_server():
await asyncio.sleep(0.1)


@pytest.mark.xdist_group(name="server_serialize")
async def xtest_exp_server_simulator():
"""Test server simulator."""
cmdargs = ["--log", "debug", "--port", "5020"]
run_args = setup_simulator(cmdline=cmdargs)
task = asyncio.create_task(run_server_simulator(run_args))
await asyncio.sleep(0.1)
testclient = setup_async_client(cmdline=CMDARGS)
await run_async_client(testclient, modbus_calls=run_a_few_calls)
await asyncio.sleep(0.1)
await ServerAsyncStop()
await asyncio.sleep(0.1)
task.cancel()
await task


@pytest.mark.xdist_group(name="server_serialize")
async def xtest_exp_updating_server():
"""Test server simulator."""
Expand Down

0 comments on commit ca91412

Please sign in to comment.