Skip to content

Progen build tests #2080

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

Closed
wants to merge 11 commits into from
Closed

Conversation

sarahmarshy
Copy link
Contributor

I have separated some of the exporter logic in project.py to project_api.py. I did this because I wanted to use some of that functionality in the new build_test script. build_test allows testing of ide builds (currently supports iar, uvision, and uv5) using progen.

build_test examples:

builds blinky for iar and k64f

python build_test.py -i iar -t MBED_BLINKY -m K64F

build blinky and Hello World test for all targets on all (supported) ides

python build_test.py -t MBED_BLINKY MBED_10

builds all tests (current default is just blinky but you can specify more with -t) for all progen targets on all ides

python build_test.py 

@0xc0170
Copy link
Contributor

0xc0170 commented Jun 30, 2016

To have tests it's great, shall we add it to the travis , to always run exporting at least, or what do you think?

@sg-
Copy link
Contributor

sg- commented Jun 30, 2016

@0xc0170 YES!

@sarahmarshy
Copy link
Contributor Author

@0xc0170 @sg - this test doesn't have the option for just exporting. It always tries to run progen's build. I could add a flag for just exporting?

@sg-
Copy link
Contributor

sg- commented Jun 30, 2016

This should just build using the ide builder and store the results. Its an entry point for CI only, not usability.

@bridadan
Copy link
Contributor

Awesome!!

We've started to put some tools tests inside the test directory here: https://github.com/mbedmicro/mbed/tree/master/tools/test

Currently only the config system tests lives there, could this live there too? Maybe tools/test/exporters or something?

@0xc0170
Copy link
Contributor

0xc0170 commented Jun 30, 2016

@0xc0170 @sg - this test doesn't have the option for just exporting. It always tries to run progen's build. I could add a flag for just exporting?

It's good as it is, but I would consider only exporting. Not all tools provide builders, export should be verified, that at least it does not end up in the traceback. We just need CI command to trigger python script tests that require our CI (in this case tools like IAR, uvision and others to be installed). @bridadan we need your help

Currently only the config system tests lives there, could this live there too? Maybe tools/test/exporters or something?

Makes sense to have all tests under tools/test

@@ -3,7 +3,7 @@ PySerial>=2.7
PrettyTable>=0.7.2
Jinja2>=2.7.3
IntelHex>=1.3
project-generator>=0.9.3,<0.10.0
project-generator>=0.9.6,<0.10.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would propose the latest v0.9.7 as 0.9.6 contained a bug with the iar template.

@0xc0170
Copy link
Contributor

0xc0170 commented Jul 1, 2016

I fetched this patch, working for me - tested mbed blinky for uvision. I would suggest to print a message that something is happening, for me the blinky after it copies the files, took like a minute and I was not sure what is happening. We can expect that for bigger applications this could take >2minutes. What do you think? The status message - program exported, building it . I tried to use -v verbose mode, but not recognized, might be a feature request.

I left there cosmetic changes, the general looks fine to me. Please consider tools/test location for the build_test script (probably under export folder).

@sarahmarshy
Copy link
Contributor Author

@0xc0170 I can add a status message. I think rather than being a verbose feature, it should be default? Like you said, would generally be confusing. Can add verbose mode later for other features. I was thinking verbose mode might set progen's logging level to debug.

@theotherjimmy
Copy link
Contributor

@sarahmarshy that sounds reasonable. If you would like to have 'verbose mode' as default, the common style of disabling messages via the command line is a --silent switch.

@@ -93,12 +96,13 @@ def export(project_path, project_name, ide, target, destination='/tmp/',
use_progen = True
except AttributeError:
pass

if target not in Exporter.TARGETS or ide.upper() not in TARGET_MAP[target].supported_toolchains:
supported = False
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@0xc0170
What do you think about this? Not sure why progen checks were different. Maybe we should think about getting rid of the hard coded targets in gcc, etc?

Copy link
Contributor

@0xc0170 0xc0170 Jul 4, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's useful to have those targets as a list (scripts used it to enable exporting in the online IDE) ,but not hard coded (progen provides API to check if target is supported), the way we do for uvision. Does that answer your question?

@0xc0170
Copy link
Contributor

0xc0170 commented Jul 4, 2016

LGTM (just that small cosmetic prefix progen)

@0xc0170
Copy link
Contributor

0xc0170 commented Jul 5, 2016

Ready for integration?

@sarahmarshy
Copy link
Contributor Author

@0xc0170 Going to add building from exported yaml file (creating a new Project object as opposed to using the same instantiation used for export), so I will add that. @sg- separate PR?

@sg-
Copy link
Contributor

sg- commented Jul 6, 2016

separate PR sounds good.

@sarahmarshy sarahmarshy force-pushed the progen_build_tests branch from d0be999 to 850bbb0 Compare July 6, 2016 14:36
@sarahmarshy
Copy link
Contributor Author

@0xc0170 then I think it is ready. This branch builds with the yaml: https://github.com/sarahmarshy/mbed/commits/build_with_yaml

@0xc0170
Copy link
Contributor

0xc0170 commented Jul 11, 2016

@mbed-bot: TEST

HOST_OSES=windows
BUILD_TOOLCHAINS=GCC_ARM,ARM,IAR
TARGETS=K64F,LPC1768

@0xc0170
Copy link
Contributor

0xc0170 commented Jul 11, 2016

@sarahmarshy Please rebase

@mbed-bot
Copy link

[Build 608]
FAILURE: Something went wrong when building and testing.

@sarahmarshy
Copy link
Contributor Author

@0xc0170 it also needs that PR from progen merged. The one for build logs with IAR

@0xc0170
Copy link
Contributor

0xc0170 commented Jul 11, 2016

it also needs that PR from progen merged. The one for build logs with IAR

Please specify any dependencies, if this requires another repo change, will require addition to the requirements as well

@bridadan
Copy link
Contributor

@mbed-bot: TEST

HOST_OSES=windows
BUILD_TOOLCHAINS=GCC_ARM,ARM,IAR
TARGETS=K64F,LPC1768

@mbed-bot
Copy link

[Build 627]
SUCCESS: Building succeeded and tests were run! Be sure to check the test results

@bridadan
Copy link
Contributor

The failing K64F tests are definitely not being caused by the changes here. I think the timing at which the test runner script was reading the serial output was affected by a long-running exporter test running on the same machine. I'm surprised that it was affected so much though.

Any way, test results look ok!

def progen_gen_file(self, tool_name, project_data):
""" Generate project using ProGen Project API """
def progen_gen_file(self, tool_name, project_data, progen_build=False):
"""" Generate project using ProGen Project API """
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why was " added?

@0xc0170 0xc0170 removed the needs: CI label Jul 15, 2016
@0xc0170
Copy link
Contributor

0xc0170 commented Jul 15, 2016

@screamerbg review

@sarahmarshy
Copy link
Contributor Author

@0xc0170 I am closing this. I needed to rebase on top of the changes that have occurred in projects.py since this request was created. Please move conversation to this pr.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants