-
Notifications
You must be signed in to change notification settings - Fork 3k
Update examples testing scripts #11710
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
Conversation
- remove "mbed" and "test-repo-source" key - add "sub-repo-example" key as an indicator if an example has sub examples - add "subs" key to sotre sub examples names
- add logging function - update clone function - update deploy function - update source function - add symlink function
@jamesbeyond, thank you for your changes. |
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 great!
tools/test/examples/README.md
Outdated
* **name** - name of the example, should be the base name of the example repository address, will throw if not match | ||
* **github** - example github repository address | ||
* **sub-repo-example** specify if the example repository have sub folder for each examples | ||
* **subs** - array of sub examples names |
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.
Which expected to be as folders in root of the repository?
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.
Yes, as above TLS example, it just going to be benchmark
tls-client
hashing
and authcrypt
Edit file, mostly for formatting and grammar.
Thanks for your updates on the README @AnotherButler |
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.
"https://os.mbed.com/teams/mbed-os-examples/code/mbed-os-example-tls-tls-client", | ||
"https://os.mbed.com/teams/mbed-os-examples/code/mbed-os-example-tls-hashing", | ||
"https://os.mbed.com/teams/mbed-os-examples/code/mbed-os-example-tls-authcrypt" | ||
"sub-repo-example": true, |
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.
Nice to have finally support for these. Can this be automated? If this is true, we walk through the root and if mbed-os.json file found, it is an example for testing ? This way we do not need to define subs (this can be out of date easily as everytime someone adds a new sub example or restructure example, this breaks).
Or any other way to do this without having this "subs" in 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.
Removing these lines breaks the release script. I will need to consider the impact before the next 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.
Nice to have finally support for these. Can this be automated? If this is true, we walk through the root and if mbed-os.json file found, it is an example for testing ? This way we do not need to define subs (this can be out of date easily as everytime someone adds a new sub example or restructure example, this breaks).
Or any other way to do this without having this "subs" in here?
@0xc0170 That is how the release script currently updates the mbed-os.lib files. It works down the root.
@jamesbeyond Actually looking at the release script more carefully I think this change is ok. The script only looks at the 'name' field so as long as that doesn't change we should be ok!
What is the timeframe for this? |
Those tests should be turned back on within a week after this PR been merged |
The scripts in this folder are used for testing `mbed-os` official examples. It contains the following files: | ||
|
||
- `examples.py` - the main script that serves as the command-line interface. | ||
- `examples.json` - the default configuration file for the script, which contains the information to the examples. If required, you can pass a customized configuration file as an argument to the script. |
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.
What do you mean by a customized configuration file? Can you show an example on how to use this feature?
I think that we currently don't have a way to test different profiles (bare metal profile/minimal-printf profile) and/or library configurations, do we? Is this PR the first step towards achieving this?
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 json
template in the README
is an example of configuration. This means if other people want to use this in their own CI, they can do it like such. But regarding to mbed-OS main CI, it always uses the default configuration file.
The new scripts actually allow the minimal-printf
to be tested, you can use:
python mbed-os/tools/test/examples/examples.py compile GCC_ARM -m <target> --profile develop mbed-os/tools/profile/extensions/minimal-printf.json
Number of failures = 0 | ||
``` | ||
|
||
After the compilation stage, a `test_spec.json` file is generated. Later, Greentea tests will consume this file. They test the compiled example on hardware platform. |
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 this test_spec.json
also include some specific test configuration settings, for example if we want to test bare metal?
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 test_spec.json
is generated after the compilation is done. it contains the if where is the binary file, where is the compare_log. in terms of bare-metal profile it need to be passed in to the compilation as mbed_apps.json
. If we have the baremetal example, it can test the baremetal example without any issues
General comment. I'm not happy about turning off ci testing of the 3 sets of examples mentioned! These are not really tested anywhere else so this is a dangerous thing to do.... |
Also the changes you have made to the examples with multiple sub examples will now break the release script. Examples.json is parsed by the release script to work out which examples to update the mbed-os.lib files for.... |
"https://os.mbed.com/teams/mbed-os-examples/code/mbed-os-example-tls-tls-client", | ||
"https://os.mbed.com/teams/mbed-os-examples/code/mbed-os-example-tls-hashing", | ||
"https://os.mbed.com/teams/mbed-os-examples/code/mbed-os-example-tls-authcrypt" | ||
"sub-repo-example": true, |
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.
Removing these lines breaks the release script. I will need to consider the impact before the next release.
Maybe I didn't made myself clear enough, it just temporary turned off. very soon they will be added back to the compile test. the reason is I need to make any other change to the CI groovy script, once the CI groovy script is done I can re-enable them in mbed-os. then the CI will check those example out from Github instead of Mercurial.
I wasn't aware of the impacts to the release scripts, let have a catch-up offline regarding this issue. @adbridge |
"https://os.mbed.com/teams/mbed-os-examples/code/mbed-os-example-tls-tls-client", | ||
"https://os.mbed.com/teams/mbed-os-examples/code/mbed-os-example-tls-hashing", | ||
"https://os.mbed.com/teams/mbed-os-examples/code/mbed-os-example-tls-authcrypt" | ||
"sub-repo-example": true, |
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.
Nice to have finally support for these. Can this be automated? If this is true, we walk through the root and if mbed-os.json file found, it is an example for testing ? This way we do not need to define subs (this can be out of date easily as everytime someone adds a new sub example or restructure example, this breaks).
Or any other way to do this without having this "subs" in here?
@0xc0170 That is how the release script currently updates the mbed-os.lib files. It works down the root.
@jamesbeyond Actually looking at the release script more carefully I think this change is ok. The script only looks at the 'name' field so as long as that doesn't change we should be ok!
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.
Although less error prone would be : if subs is not empty use it as "subs repo example" otherwise a repo is just one. This would be simplified: https://github.com/ARMmbed/mbed-os/pull/11710/files#diff-e373941cca74280be2386207895bc63aR167
CI started |
Yeah, I thought about that, but I think the empty value |
Test run: FAILEDSummary: 3 of 4 test jobs failed Failed test jobs:
|
Sorry, forgot to turn-off the build test for NFC example, they are with sub-examples as well. Now updated, Could we start the CI again please? @0xc0170 |
Test run: SUCCESSSummary: 11 of 11 test jobs passed |
@jamesbeyond Integrated, lets update CI |
Update examples testing scripts
Update examples testing scripts
Update examples testing scripts (cherry picked from commit 83c4a80)
Description
This PR is update the examples testing scripts.
This script is standalone script purely used by mbed CI test, So this will not change mbed-OS behaviours.
This including following changes:
README
file to explain how this script is used in the CIHowever, because this scripts changed where to checkout examples, some of the examples will failed to build
So temporarily turn off the build tests for these examples. An update on the CI scripts will be raised soon. Once the CI update is in place will enable the build test for these examples ASAP.
Pull request type
Reviewers
@OPpuolitaival @evedon @adbridge @mark-edgeworth @AnotherButler
Release Notes