-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Icetea support #7745
Icetea support #7745
Conversation
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.
My 4 comments are just because the location of entire patch here is wrong. Shouldn't this in frameworks where other test tools are?
Makefile
Outdated
@@ -0,0 +1,5 @@ | |||
SRCS := $(wildcard source/*.c) |
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.
I dont think we want to have this in the root. makefile that is just for cmdline tool
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 yotta_ignore file
.mbedignore
Outdated
@@ -0,0 +1,2 @@ | |||
test/* | |||
source/ns_list_internal/* |
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.
source path does not look correct, there's o source/ in the root here as .mbedignore is
.mbedignore
Outdated
@@ -0,0 +1,2 @@ | |||
test/* |
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.
where this comes from tests/
?
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.
All these comments are from one git subtree try.. I will fix these
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.
Great job :)
I only reviewed the python scripts. From what I understood they look good to me.
I have some concerns regarding tools/test_api.py
that contains a lot of changes related to white spaces and empty lines that should probably not be part of this PR and few other little things.
tools/test.py
Outdated
""" | ||
from __future__ import print_function, division, absolute_import | ||
import sys | ||
import os | ||
import json | ||
import subprocess |
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.
subprocess
is not used.
tools/toolchains/__init__.py
Outdated
@@ -1117,4 +1117,4 @@ def report(self): | |||
u'IAR': IAR | |||
} | |||
|
|||
TOOLCHAINS = set(TOOLCHAIN_CLASSES.keys()) | |||
TOOLCHAINS = set(TOOLCHAIN_CLASSES.keys()) |
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.
this is only removing a linefeed.
tools/test_api.py
Outdated
@@ -28,14 +28,17 @@ | |||
import random | |||
import argparse | |||
import datetime | |||
import errno |
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.
errno
is not used in this file.
tools/test_api.py
Outdated
import threading | ||
import ctypes | ||
import functools | ||
import subprocess |
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.
subprocess
is not used in this file.
|
||
class Testcase(Bench): | ||
def __init__(self): | ||
Bench.__init__(self, |
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.
Same as previous comment in tools/test/run_icetea/TEST_DIR/test_pass.py
.
|
||
class Testcase(Bench): | ||
def __init__(self): | ||
Bench.__init__(self, |
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.
Same as previous comment in tools/test/run_icetea/TEST_DIR/test_pass.py
.
|
||
class Testcase(Bench): | ||
def __init__(self): | ||
Bench.__init__(self, |
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.
Same as previous comment in tools/test/run_icetea/TEST_DIR/test_pass.py
.
|
||
class Testcase(Bench): | ||
def __init__(self): | ||
Bench.__init__(self, |
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.
I'm not 100% sure about this, but I usually see super() used in this case instead of invoking explicitly the Base class.
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.
I tried super but did not work for some reason
requirements.txt
Outdated
@@ -6,7 +6,7 @@ IntelHex>=1.3 | |||
junit-xml | |||
pyYAML | |||
requests | |||
mbed-ls>=0.2.13 | |||
mbed-ls>=0.2.13,<2.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.
Why do we add a high limit to mbed-ls 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.
This is syncronized with icetea. If not then there is risk that icetea and this support different version and cause problems
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.
Is this because of https://github.com/ARMmbed/icetea/blob/929dc1da4c2529fff633545c00b677d0970ee0a5/setup.py#L32
It seems we actually also need a version >=1.4.2
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.
mbed-ls v0.2.13 is very old - maybe it's better to update this anyway..
1d2ea0a
to
a3567f2
Compare
TEST_APPS/device/exampleapp/main.cpp
Outdated
} | ||
|
||
FileHandle* mbed::mbed_override_console(int) { | ||
static UARTSerial console(STDIO_UART_TX, STDIO_UART_RX, 115200); |
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.
baudrate could be defined beginning of file
TEST_APPS/device/exampleapp/main.cpp
Outdated
int c; | ||
while((c = getchar()) != EOF) { | ||
cmd_char_input(c); | ||
} |
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.
nitpick: wrong indent - check whole file
const char* MAN_IFCONFIG = " ifup interface up\r\n"\ | ||
" ifdown interface down\r\n"; | ||
|
||
static bool is_ipv4(const char *str) |
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.
isn’t there any better/more robust way to detect whether str is ipv4 or 6?
static void ifconfig_print() | ||
{ | ||
if(!net) | ||
return; |
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 here should be print that no interface configured etc
|
||
|
||
|
||
const char* networkstack_error_to_str(int errorcode) |
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.
this looks something (also) that could be shared/needed between (cli)apps, could we have shared library which contains commons stuff for testapps?
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.
Can be done in the future when there are multiple apps. Basically the whole command could be common stuff, but where do we draw the line that what is common between apps and what is not.
if options.verbose: | ||
cmd(['icetea', '--tcdir', options.tcdir, '--list'] + (['-v'] if options.verbose else [])) | ||
|
||
cmd(['icetea', '--tcdir', options.tcdir, '--suite', options.test_suite, '--clean', '--plugin_path', |
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 that we doesn't have any way to pypass other optional icetea arguments here, any plan/chance to make it possible ?
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.
Current idea is that advanced usage will happen without these scripts
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.
How we bring remote resource support in future then? Do we bring parameters one by one when needed? Doesn’t sound good approach either 🙄
tools/test/run_icetea/.gitignore
Outdated
@@ -0,0 +1 @@ | |||
test_suite.json |
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.
nitpick: missing empty line (same issue seems to be in multiple files)
@@ -0,0 +1,37 @@ | |||
""" |
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.
do we need this file at all? what about previous one (test_pass.py) ?
def __init__(self): | ||
Bench.__init__(self, | ||
name="test_K64F_only", | ||
title="Test a test case which have onely K64F support", |
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.
nitpick: typo
@@ -0,0 +1,104 @@ | |||
""" | |||
mbed SDK | |||
Copyright (c) 2016 ARM Limited |
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.
2016?
@@ -299,9 +314,6 @@ static void sigio_handler(SInfo *info) { | |||
void cmd_socket_init(void) | |||
{ | |||
cmd_add("socket", cmd_socket, "socket", MAN_SOCKET); | |||
cmd_alias_add("socket help", "socket -h"); | |||
cmd_alias_add("socket --help", "socket -h"); |
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 last one would be still usefull - does test uses it?
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.
That one seems to be an artifact from porting. It isn't used nor implemented.
TEST_APPS/device/exampleapp/main.cpp
Outdated
cmd_next(retcode); | ||
} | ||
|
||
void wrap_printf(const char *f, va_list a) { |
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.
Align the code (run astyle on these example apps)
|
||
Now that the interface has been selected you can run the icetea tests from the mbed-os root on your command line by | ||
|
||
`>mbed test -m <target> -t <toolchain> --icetea` |
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.
I asked in the unittest PR, just to be sure this is fine also here (commands/arguments alignment for cli) - how we can test (unit/icetea/app tests) - using one command mbed test
and --argument
.
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.
This is handled in unit testing.. it add new command "mbed unittest" because it is so different than icetea or greentea
@ARMmbed/mbed-os-tools Please review tools changes Documentation addition ARMmbed/mbed-os-5-docs#659 |
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.
Mostly looks good! Some doc issues and a few implementation questions but overall seems to be in good shape.
TEST_APPS/readme.md
Outdated
|
||
### Structure | ||
|
||
mbed-os has a folder called TEST_APPS that contains everything related to IceTea -testing. |
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.
nit: you can drop the -
in -testing
.
TEST_APPS/readme.md
Outdated
- icetea-plugins - contains plugins that are being used by some of the testcases, needed for the test execution | ||
- testcases - contains IceTea testcases written in Python | ||
|
||
The testcases and test applications have a dependency |
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.
Should there be something more in this sentence? What is the dependency?
TEST_APPS/readme.md
Outdated
### Structure | ||
|
||
mbed-os has a folder called TEST_APPS that contains everything related to IceTea -testing. | ||
There are currently 3 folders |
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.
Typically a :
should go after folders
I think. Like:
There are currently 3 folders:
TEST_APPS/readme.md
Outdated
|
||
#### Prerequisities | ||
|
||
You should have IceTea and forked mbed-cli that supports IceTea, installed. |
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.
I think we want to remove forked
from this sentence, considering that we'll be merging this into a released version of Mbed CLI.
TEST_APPS/readme.md
Outdated
``` | ||
|
||
The results from the tests can also be found from mbed-os/log -folder. | ||
You probably want to add the log -folder to your .mbedignore -file to prevent issues with build commands becoming too long over the time. |
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.
There's a few stray -
characters in these sentences, I'd remove them for clarity.
requirements.txt
Outdated
@@ -15,3 +15,4 @@ pyelftools>=0.24 | |||
jsonschema>=2.6 | |||
future>=0.16.0 | |||
six>=1.11.0 | |||
icetea==1.0.0rc3 |
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 like this is using an rc
release, is there a non-rc release we should be using?
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.
I don’t want to tag release before everything is ready, including OOB’s.. There is at least one doc PR landing to icetea before release.. But yes, eventually we have 1.0.0 release :)
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.
This will be change when release of icetea is published
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.
Ok, will icetea be released to 1.0.0 before this PR is merged? Is there an order to PRs that the maintainers need to be aware of?
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.
build[0]['elf'] = relpath(build[0]['elf'], path_to_file) | ||
build[0]['bin'] = relpath(build[0]['bin'], path_to_file) | ||
except KeyError: | ||
pass | ||
if 'type' not in build[0]: | ||
build[0]['type'] = app_type | ||
build_data['builds'].append(build[0]) | ||
dump(build_data, open(filename, "w"), indent=4, separators=(',', ': ')) | ||
build_data['builds'].insert(0, build[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.
Any particular reason for this change?
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.
The build_data.json is not cleared and it will contain also failed builds. Previously the latest build was on the bottom of the build_data.json. This appends the build_data from the start so the latest build is in the top of the build_data.json. The run_icetea.py is looking this file to get all the test application binary paths and apparently read only the first build result. Other option to get the latest build is to start looking for the build date and which one is the latest, not sure if its reliable in every case. The date seems to be coming from python datetime method. (datetime.utcnow().isoformat())
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.
Sorry for being slow, can you explain this sentence a bit more?
The run_icetea.py is looking this file to get all the test application binary paths and apparently read only the first build result.
Just curious why the order is important in this particular case, this isn't a blocker issue though.
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.
Previously if your first build failed, the failed build data was in the top of build_data.json, if the run_icetea.py only read this failed one and tried to get the test application binary paths from this, all the tests would fail because there was no binary path found. This would also happen in the future test runs if you don't use -c or delete the build_data.json separately.
Now the script also checks that was the build successful or not.
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.
Ok I see, sounds like a workaround then. Glad to hear the updated version checks the result! Thanks for the explanation
for test in icetea_json_output: | ||
skip = False | ||
|
||
for dut in test['requirements']['duts'].values(): |
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.
I think it'd be helpful to have some warnings displayed if possible in this case.
requirements.txt
Outdated
@@ -15,3 +15,4 @@ pyelftools>=0.24 | |||
jsonschema>=2.6 | |||
future>=0.16.0 | |||
six>=1.11.0 | |||
icetea==1.0.0rc4 |
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.
Seems very restrictive
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.
I would not rely only on rc4 version.
Looking at other requirements >=1.0.0 would be fine?
Can you rebase? Once done, let us know |
Rebased and works in my tests now.. @jarlamsa can you check that works in windows and your setup too |
@OPpuolitaival seems to be working now |
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.
A dependency of Icetea, psutil, requires a native C/C++ compiler to install through pip. Please remove this dependency.
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.
Icetea 1.0.1 does not have native-compiler dependencies. CI should work now.
@cmonr I restarted travis. Let's get this tested. |
/morph build |
Build : FAILUREBuild number : 2978 |
I think this is still dependent on #7814 |
@SeppoTakalo any idea why emac test build fails? Should not be related to this PR: |
Where do they come from? No supported is fine (should not cause CI to report failure, neither a user) , just a test that requires some additional info (no default provided ) the failures in the build examples come from connectivity PR (will be fixed asap) |
#7814 is now in! Let's see if this improves things. |
Build : SUCCESSBuild number : 2983 Triggering tests/morph test |
Test : SUCCESSBuild number : 2740 |
Exporter Build : SUCCESSBuild number : 2591 |
Description
Add icetea support including tools code and couple of example tests
Pull request type