tests/periph_i2c: Example i2c test using pytest#10448
tests/periph_i2c: Example i2c test using pytest#10448MrKevinWeiss wants to merge 3 commits intoRIOT-OS:masterfrom
Conversation
|
@smlng smart! |
|
@MrKevinWeiss can we move a refined version into a comment of issue #10241 and close this PR? |
1600+ lines of code don't belong in a comment. Please leave the PR open so people can actually check out the code. |
Well, as you like: The objective is to just see the examples side by side (e.g. as a linked resource) to support an easy comparison. The objective is not to contribute any code. IMO it is completely irrelevant how to repeat this test here. All is needed is an easy access to input and output so that folks can get a feeling on what to expect from Robot versus Pytest. |
As a contributor who isn't just interested in results but also how to implement stuff, I'm very much interested how the tests are implemented, how much needs to be repeated and what is possible with each framework (I'm not sure if you mean that by "input" but then again this is the code contribution here so I am a little confused about your terminology here). |
I assume the point of @tcschmidt was that is not really necessary to open a PR here but rather point to respective branch and link files for comparison in a comment at #10241. For instance, as I did for the comparison of the CoAP tests by @kb2ma in the Release-Specs, see comment. |
|
closing: no need to keep this open, it's an example only and all files are linked in the respective issue mentioned above. |
Contribution description
PLEASE DO NOT MERGE, EXAMPLE ONLY, RFC
This provides a similar i2c test and result to the Robot Framework i2c testing PR #10147. I hope it shows some of the benefits and pitfalls of using pytest compared to robot framework. I am sure it isn't fully implementing the features of pytest as it is a big library with lots to learn, however it does give a glance and what can be achieved with mostly out of the box framework/plugins.
Testing procedure
Install the dependencies
pip3 install pytest pytest-html riot-palFlash PHiLIP firmware on PHiLIP device (usually nucleo-f103rb)
Flash the DUT (device under test) with RIOT firmware
BOARD=<DUT board name> make -C tests/periph_i2c/ flashConnect sda, scl and reset pin from PHiLIP to the DUT
Run pytest
pytest tests/periph_i2c/tests/ --html=report.html --junitxml=report.xml --philip_port=/dev/ttyACM0 --dut_port=/dev/ttyACM1 --dut_baud=<DUT baudrate, usually 115200> --board=<DUT board name> --self-contained-htmlIssues/PRs references
The following PRs discussing testing frameworks:
#10241
RIOT-OS/Release-Specs#86
#10147
#10095