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

functional tests script #1928

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

meeuw
Copy link
Contributor

@meeuw meeuw commented Oct 16, 2022

For running automated tests of the kernel module I've hacked this script together (some capabilities still need to be implemented).

Can you give me some early feedback, might also be good to reference this in #1919 as one of the checks when adding support for a new feature/device.

Copy link
Contributor

@turbos-and-tacos turbos-and-tacos left a comment

Choose a reason for hiding this comment

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

Looks pretty good! All comments but the 255 vs 256 are suggestions and me spouting info. If they are non-applicable feel free to ignore and resolve the comments. 😄

Comment on lines +48 to +49
for r1, g1, b1, r2, g2, b2 in ((256, 0, 0, 0, 0, 0), (0, 256, 0, 0, 0, 0), (0, 0, 256, 0, 0, 0),
(0, 0, 0, 256, 0, 0), (0, 0, 0, 0, 256, 0), (0, 0, 0, 0, 0, 256)):
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't the 256 values be 255?

import sys
from openrazer.client import DeviceManager
from openrazer.client import constants as razer_constants

Copy link
Contributor

Choose a reason for hiding this comment

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

A quick "about" section would be helpful. Things like use cases for this tool and expected invocation.

print()


prompt = 'noprompt' not in sys.argv
Copy link
Contributor

Choose a reason for hiding this comment

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

I like to use argparse to handle passed in parameters. It also helps users understand how to use the tool. This is no a blocker though.

Comment on lines +22 to +29
if capability == "name":
print(f"device.name: {device.name}")
elif capability == "type":
print(f"device.type: {device.type}")
elif capability == "firmware_version":
print(f"device.firmware_version: {device.firmware_version}")
elif capability == "serial":
print(f"device.serial: {device.serial}")
Copy link
Contributor

Choose a reason for hiding this comment

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

Putting all of these bit of info into a get_basic_info function could be helpful for showing information that is expected. I think if any of these are missing then that should be a red flag that something isn't working quite right. One could imaging an output like the following.

Name:  Death Adder Gen X
Device Type: Mouse
Firmware Version: MISSING!
Serial Number: MISSING!

Not sure if that sort of info is outside the scope. If so, ignore me. 😄

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

Successfully merging this pull request may close these issues.

None yet

2 participants