pulquero / RotorHazard

Multi-node video transmitter race timer for drone racing
Other
6 stars 0 forks source link

Testing the Tests #40

Closed martinglass closed 3 years ago

martinglass commented 3 years ago

Testing the tests:

In this instance, test_sensors. Here's what happened....

~/RotorHazard/src $ python -m tests.test_sensors

Traceback (most recent call last): File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "/usr/lib/python3.7/runpy.py", line 85, in _run_code exec(code, run_globals) File "/home/pi/RotorHazard/src/tests/test_sensors.py", line 5, in import fake_rpi ModuleNotFoundError: No module named 'fake_rpi'

pulquero commented 3 years ago

Non-pi requirements are needed for tests: python3 -m pip install -r reqsNonPi.txt

martinglass commented 3 years ago

I've installed fake_rpi and the sensor test works ok now. Thanks (I should have done that in the first place)

martinglass commented 3 years ago

Test_Interface:

Plugin interface.i2c_node not loaded (not supported - required arguments are not available) discover() missing 1 required positional argument: 'i2c_helper'

Don't know whether this error report significant. The tests ended with "OK"

martinglass commented 3 years ago

In this instance, test_server. Here's what I found ~/RotorHazard/src $ python -m tests.test_sensors

The test created a number of things in the database, such as new (test) pilots, new race formats and more. It would be best not to alter the original database (if one exists), eg rename the existing one before running the test code, then deleting the database created by the test code and restoring the original database back into place.

This is especially problematic, because all but one of the newly-created Test Pilots were locked (there was no "x" icon by their Team to delete them, in the Pilots section).

Also, the phonetic for the Test Pilot is typed Teeest for some reason

pulquero commented 3 years ago

Plugin interface.i2c_node not loaded (not supported - required arguments are not available) discover() missing 1 required positional argument: 'i2c_helper'

Don't know whether this error report significant. The tests ended with "OK"

The error here explains why I2C is not available (which is expected for the test).

Also, the phonetic for the Test Pilot is typed Teeest for some reason

Delibrate spelling to emphasize phonetics.