Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce CI log with no debug. #1616

Merged
merged 3 commits into from
Jun 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 1 addition & 2 deletions examples/datastore_simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def get_commandline(cmdline=None):
def setup_simulator(setup=None, actions=None, cmdline=None):
"""Run server setup."""
args = get_commandline(cmdline=cmdline)
pymodbus_apply_logging_config(args.log)
pymodbus_apply_logging_config(args.log.upper())
_logger.setLevel(args.log.upper())
args.framer = ModbusSocketFramer
args.port = int(args.port)
Expand Down Expand Up @@ -165,7 +165,6 @@ async def run_server_simulator(args):
"""Run server."""
_logger.info("### start server simulator")

pymodbus_apply_logging_config(args.log.upper())
await StartAsyncTcpServer(
context=args.context,
address=("", args.port),
Expand Down
2 changes: 1 addition & 1 deletion examples/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def get_commandline(server=False, description=None, extras=None, cmdline=None):
"socket": ModbusSocketFramer,
"tls": ModbusTlsFramer,
}
pymodbus_apply_logging_config(args.log)
pymodbus_apply_logging_config(args.log.upper())
_logger.setLevel(args.log.upper())
args.framer = framers[args.framer or comm_defaults[args.comm][0]]
args.port = args.port or comm_defaults[args.comm][1]
Expand Down
2 changes: 0 additions & 2 deletions test/sub_examples/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ def _define_commandline(
use_comm,
"--framer",
use_framer,
"--log",
"debug",
]
if use_comm == "serial":
cmdline.extend(
Expand Down
7 changes: 0 additions & 7 deletions test/sub_examples/test_client_server_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,10 @@
These are basis for most examples and thus tested separately
"""
import asyncio
import logging

import pytest

from examples.client_async import run_a_few_calls, run_async_client, setup_async_client
from pymodbus import pymodbus_apply_logging_config


_logger = logging.getLogger()
_logger.setLevel("DEBUG")
pymodbus_apply_logging_config("DEBUG")


class TestClientServerAsyncExamples:
Expand Down
7 changes: 0 additions & 7 deletions test/sub_examples/test_client_server_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

These are basis for most examples and thus tested separately
"""
import logging
from threading import Thread
from time import sleep

Expand All @@ -16,16 +15,10 @@
from examples.client_sync import run_a_few_calls, run_sync_client, setup_sync_client
from examples.server_async import setup_server
from examples.server_sync import run_sync_server
from pymodbus import pymodbus_apply_logging_config
from pymodbus.exceptions import ConnectionException
from pymodbus.server import ServerStop


_logger = logging.getLogger()
_logger.setLevel("DEBUG")
pymodbus_apply_logging_config("DEBUG")


class TestClientServerSyncExamples:
"""Test Client server async combinations."""

Expand Down
13 changes: 3 additions & 10 deletions test/sub_examples/test_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

"""
import asyncio
import logging

import pytest

Expand All @@ -22,15 +21,9 @@
from examples.server_updating import run_updating_server, setup_updating_server
from examples.simple_async_client import run_async_client as run_simple_async_client
from examples.simple_sync_client import run_sync_client as run_simple_sync_client
from pymodbus import pymodbus_apply_logging_config
from pymodbus.server import ServerAsyncStop


_logger = logging.getLogger()
_logger.setLevel("DEBUG")
pymodbus_apply_logging_config("DEBUG")


class TestExamples:
"""Test examples."""

Expand Down Expand Up @@ -107,7 +100,7 @@ async def test_payload(self, mock_cmdline):
@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)]
cmdargs = ["--port", str(use_port)]
run_args = setup_simulator(cmdline=cmdargs)
task = asyncio.create_task(run_server_simulator(run_args))
await asyncio.sleep(0.1)
Expand All @@ -123,7 +116,7 @@ async def test_datastore_simulator(self, use_port):
@pytest.mark.xdist_group(name="server_serialize")
async def test_server_callback(self, use_port):
"""Test server/client with payload."""
cmdargs = ["--log", "debug", "--port", str(use_port)]
cmdargs = ["--port", str(use_port)]
task = asyncio.create_task(run_callback_server(cmdline=cmdargs))
await asyncio.sleep(0.1)
testclient = setup_async_client(cmdline=cmdargs)
Expand All @@ -137,7 +130,7 @@ async def test_server_callback(self, use_port):
@pytest.mark.xdist_group(name="server_serialize")
async def test_updating_server(self, use_port):
"""Test server simulator."""
cmdargs = ["--log", "debug", "--port", str(use_port)]
cmdargs = ["--port", str(use_port)]
run_args = setup_updating_server(cmdline=cmdargs)
task = asyncio.create_task(run_updating_server(run_args))
await asyncio.sleep(0.1)
Expand Down
2 changes: 1 addition & 1 deletion test/sub_examples/test_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def test_commandline_server_defaults(self):

def test_commandline_client_defaults(self):
"""Test defaults"""
args = helper.get_commandline(server=False, cmdline=["--log", "info"])
args = helper.get_commandline(server=False, cmdline=[])
assert args.comm == "tcp"
assert args.log == "info"
assert args.baudrate == 9600
Expand Down
5 changes: 0 additions & 5 deletions test/test_unix_socket.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
"""Test client async."""
import asyncio
import logging
from tempfile import gettempdir

import pytest
import pytest_asyncio

from pymodbus import pymodbus_apply_logging_config
from pymodbus.client import AsyncModbusTcpClient
from pymodbus.datastore import (
ModbusSequentialDataBlock,
Expand All @@ -17,9 +15,6 @@
from pymodbus.transaction import ModbusSocketFramer


_logger = logging.getLogger()
_logger.setLevel("DEBUG")
pymodbus_apply_logging_config(logging.DEBUG)
PATH = gettempdir() + "/unix_domain_socket"
HOST = f"unix:{PATH}"

Expand Down