-
Notifications
You must be signed in to change notification settings - Fork 2k
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
tests: init RobotFramework and add basic xtimer test #10843
Conversation
Provides common files, directory structure and make targets to enable (HIL) tests based on the RobotFramework.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Only some non-blocking comments below.
edit: I also did a quick test on esp8266 and got the beautiful robot framework output
## Requirements | ||
|
||
The automated tests are based on RobotFramework and thus depend on additional | ||
Python packages, namely `robotframework` and `riot_pal`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe add a reference to dist/robotframework/README.md for installing the requirements here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep makes sense
tests/xtimer_cli/main.c
Outdated
@@ -0,0 +1,62 @@ | |||
/* | |||
* Copyright (C) 2018 HAW Hamburg |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2018? ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's an old one
|
||
return 0; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't look it up, but is the echo
cmd described in #10624 already used by riot_pal? If yes, maybe add it here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nope, no echo there, and I would rather make (as discussed offline) a PR introducing both (metadata and echo) as a shell module, and not start adding stuff here that is not needed. I need the metadata but I don't need or use echo
right now, so why bother.
Suite Setup Run Keywords Reset Application | ||
... DUT Must Have API Firmware | ||
Test Setup Run Keywords Reset Application | ||
... DUT Must Have API Firmware |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As this is somehow a POC/showcase for using robot framework a little more comments here would be nice to make clear what Suite Setup
, Test Setup
and so on actually does.
Also IIRC the second DUT Must Have API Firmware
is a little hack to ensure the communication channel is working correctly. -> this should be noted explicitly to make it clear to others that this is required.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
first: why should I repeat the RF documentation? There is plenty documentation on Suite/Test Setup at the original sources, I can add some links in the dist/robotframework/README.md but copy-pasting docu doesn't make sense (to me).
second: no that's no hack in that sense, it's just there to ensure that before each test the devices are reset and responding correctly before running the tests. The Suite Setup could be avoided but on the other it helps to skip all tests if there is a problem with the board.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Blocking to avoid unexpected merge.
What is it you want to question or change? |
Since I'm not aware of any conclusion with #10241 (where the discussion is not going toward the direction of using the Robot Framework IMHO), I don't want to have this merged by mistake before the next release. |
The conclusion from #10241 to me seems that there is rough consensus on going ahead with Robot at least for the HIL testing - along with some experienced guidance by @pekkanikander. In case there are further arguments or comments regarding the framework itself, they should be added to #10241. |
addressed comments by @MichelRottleuthner |
This fails for me:
|
Hmm, my |
yup, not supporting python2 😞 I think it specifies it in the pip package. |
As our target is ubuntu stable,
So it does not work with
Please do no re-invent the wheel and use |
It's feature-freeze now, so no danger to sneak into the release: You may want to remove the operational block then @aabadie ? |
Sorry, but no. My main blocker point is still not full-filled: there's no consensus whether we add and maintain RF files (and all the custom keywords that will come with) in the RIOT repository or not. |
There is no open issue nor argument, if I'm not mistaken. IMO this is considered rough consensus, even if some people like the solution more and some less. Rough consensus does not require everybody to be enthusiastic, otherwise it would be called euphoria. Regarding the repository: Are you suggesting that RF testing should be a separate Repo within the RIOT organization? Currently, we are following the common RIOT logic (as done with Murdoc etc.): Framework specific scripts and frontend stuff like stylesheets are separate repos, the actual tests are located in the RIOT repo. |
My main remarks from #10241 (comment) where not addressed. It is going in a direction to put the abstraction code as a RobotFramework specific class https://github.com/RIOT-OS/RIOT/pull/10843/files#diff-2756e48a9944cf93cbea221c7c933574 And it also does not reuse the normal RIOT way to access the serial port which is Until both are addressed, I still consider it as harmful to have as it will push toward a split in the tests implementation where any improvement one one side do not benefit the other. |
That small python wrapper for Xtimer is RF related indeed, at least the following lines are required to handle the imports correctly and auto-generate keywords in RF:
However, this does not mean this class/lib cannot be used by another framework. Is there a (simple) way to make the imports and those two variables conditional, i.e. only have them when this file is used with RF?
I agree, and I'm working on changing this to work with |
See related PR: RIOT-OS/riot_pal#24 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To keep it simple see the following comments
@@ -0,0 +1,63 @@ | |||
# Copyright (C) 2018 Kevin Weiss <[email protected]> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh this is what thomas was talking about, please change to Copyright (C) 2018 Kevin Weiss, for HAW [email protected] (or remove completely).
import logging | ||
|
||
from riot_pal import DutShell | ||
from robot.version import get_version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also this should be separated out into a robot independent interface then a simple wrapper for robot.
from robot.version import get_version | ||
from time import sleep | ||
|
||
class PhilipAPI(LLMemMapIf): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we start without philip at all and just do non-philip tests to show as an example.
@@ -0,0 +1,11 @@ | |||
*** Settings *** | |||
Library PhilipAPI port=%{PHILIP_PORT} baudrate=${115200} WITH NAME PHILIP |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe remove for now...
closing as this moved to separate repo for faster integration and progression, see https://github.com/RIOT-OS/RobotFW-tests |
Contribution description
This introduces common files to enable RobotFramework based (HIL) tests in RIOT.
It also ships a very basic xtimer test application utilising the RobotFramework.
The latter will be extended later on, but should give others a starting point to see how to
use RF with RIOT.
RF tests (currently) run from a distinct make target, i.e.
robot-test
; so will not interfere with existing tests. This might be changed later on, but for now it should ease introduction of RF tests w/o breaking existing stuff.Testing procedure
Currently this only works for real boards connected via serial, so connect you favourite board and run
Issues/PRs references