Skip to content

SY-3800: Automate Modbus and OPCUA QA#2010

Open
sy-nico wants to merge 8 commits intomainfrom
sy-3800-automate-driver-qa-modbus-and-opcua
Open

SY-3800: Automate Modbus and OPCUA QA#2010
sy-nico wants to merge 8 commits intomainfrom
sy-3800-automate-driver-qa-modbus-and-opcua

Conversation

@sy-nico
Copy link
Contributor

@sy-nico sy-nico commented Feb 19, 2026

Pull Request

SY-3800

Greptile Summary

Automated Modbus and OPC UA driver QA by implementing comprehensive write task tests and refactoring the test framework to separate read and write test lifecycles.

Key Changes

  • Refactored test base classes: split TaskCase into ReadTaskCase (testing sample counting, data saving, rate reconfiguration) and WriteTaskCase (testing command sending and task reconfiguration)
  • Added automated write task tests for Modbus (coils, holding registers, mixed operations) and OPC UA (float values)
  • Added OPC UA timestamp test case for server timestamp as task index (use_as_index)
  • Simplified manual QA checklist in RC template since tests are now automated
  • Fixed UI test robustness with fallback force-click for viewport-constrained menus

Benefits

  • Eliminates manual QA burden for Modbus and OPC UA write tasks
  • Ensures consistent test coverage across both protocols
  • Read and write tasks now have separate, appropriate test lifecycles
  • Framework supports easy addition of new driver test cases

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • Well-structured refactoring with clear separation of concerns between read and write task tests. New test cases follow established patterns, all changes are additive (no breaking changes), and the framework improvements enable better test coverage
  • No files require special attention

Important Files Changed

Filename Overview
integration/tests/driver/modbus_task.py Split ModbusTaskCase into ModbusReadTaskCase and new ModbusWriteTaskCase for separate test lifecycles
integration/tests/driver/modbus_write.py New file adding automated write task tests for Modbus Coils, Holding Registers, and mixed operations
integration/tests/driver/opcua_task.py Split OPCUATaskCase into OPCUAReadTaskCase and new OPCUAWriteTaskCase with proper channel attribute
integration/tests/driver/opcua_write.py New file adding automated write task test for OPC UA float values
integration/tests/driver/task.py Major refactor: split TaskCase into TaskCase (base), ReadTaskCase (sample/data saving tests), and WriteTaskCase (command tests)

Class Diagram

%%{init: {'theme': 'neutral'}}%%
classDiagram
    class TestCase {
        <<abstract>>
        +client: sy.Client
        +log()
        +fail()
    }
    
    class TaskCase {
        <<abstract>>
        +task_name: str
        +device_name: str
        +tsk: Task
        +_channel_key_attr: str
        +create()* sy.Task
        +setup()
        +cleanup()
        +_channel_keys() list
        +test_task_exists()
        +assert_task_exists()
        +assert_device_exists()
    }
    
    class ReadTaskCase {
        +run()
        +test_start_and_stop()
        +test_disable_data_saving()
        +test_enable_data_saving()
        +test_reconfigure_rate()
        +test_survives_channel_deletion()
        +assert_sample_count()
        +assert_no_samples_persisted()
    }
    
    class WriteTaskCase {
        +run()
        +test_send_commands()
        +test_reconfigure_name()
        +_assert_streamed_values()
    }
    
    class SimulatorCase {
        <<abstract>>
        +sim: Simulator
        +sim_class
    }
    
    class ModbusReadTaskCase {
        +SAMPLE_RATE
        +create() modbus.ReadTask
        +create_channels()* list
    }
    
    class ModbusWriteTaskCase {
        +create() modbus.WriteTask
        +create_channels()* list
    }
    
    class OPCUAReadTaskCase {
        +SAMPLE_RATE
        +array_mode: bool
        +array_size: int
        +create() opcua.ReadTask
        +create_channels()* list
    }
    
    class OPCUAWriteTaskCase {
        +SAMPLE_RATE
        +_channel_key_attr
        +create() opcua.WriteTask
        +create_channels()* list
    }
    
    TestCase <|-- TaskCase
    TaskCase <|-- ReadTaskCase
    TaskCase <|-- WriteTaskCase
    ReadTaskCase <|-- ModbusReadTaskCase
    WriteTaskCase <|-- ModbusWriteTaskCase
    ReadTaskCase <|-- OPCUAReadTaskCase
    WriteTaskCase <|-- OPCUAWriteTaskCase
    SimulatorCase <|-- ModbusReadTaskCase
    SimulatorCase <|-- ModbusWriteTaskCase
    SimulatorCase <|-- OPCUAReadTaskCase
    SimulatorCase <|-- OPCUAWriteTaskCase
Loading

Last reviewed commit: 0a078e2

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

11 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments