OpenTabletDriver / OpenTabletDriver/Plugin-Repository

Feature Request: Tests filters in pipeline

Open
#138 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Shell
Stars
8
Forks
37
Avg merge
1d 5h
Merged PRs (30d)
3

Description

The OpenTabletDriver 0.6.x plugin pipeline has edge cases that can cause filter plugins to incorrectly drop reports.

For plugins with filters targeting the 0.6.x plugin API the following tests should be done.

Plugins targeting earlier API's like 0.5.x should preferably not be covered if it significantly increases the amount of code to maintain.

It is unclear how to implement these tests properly. I currently have 2 ideas:

  • Have a separate repository that can be targeted as a GitHub action, that tests the filter in a virtual pipeline, which could be used to test pull requests on this repository in some way.
  • Driver gets a "Plugin Developer" mode that would actively check active filters for these issues - this would help plugin developers from making these mistakes unintentionally.

While outside of the scope of this issue, future driver plugin API's should preferably be designed in a way that removes these necessary tests.

Minimum Test Coverage

At the very minimum, the tests should check for the following

Properly passes through IDeviceReports

Some filters incorrectly only pass through ITabletReports. Normal filters should ensure Consume(IDeviceReport) runs Emit?.Invoke(). Async filters should ensure ConsumeState() runs OnEmit() (or Emit?.Invoke()) on unconsumed reports.

Sets a PipelinePosition that isn't PreTransform or PostTransform (or an alias)

Currently, the driver only links filters that have a PipelinePosition with one of the above values as seen here:
https://github.com/OpenTabletDriver/OpenTabletDriver/blob/aa345e5b7365647f25c8651f3e35fb7dd4c13676/OpenTabletDriver.Plugin/Output/OutputMode.cs#L62-L90

This means that a PipelinePosition of e.g. 0 would result in the filter never being inserted into the pipeline.


If you think of anything else that would be worth testing for, please let us know here.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading OpenTabletDriver.Plugin/Output/OutputMode.cs around lines 62-90 to understand how PipelinePosition controls filter insertion. Define the 0.6.x test approach, then cover unconsumed IDeviceReports and invalid PipelinePosition values without significantly expanding coverage for 0.5.x APIs.

Written by the indexing model from the issue text.

Assessment

Domain
testing
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.