-
Notifications
You must be signed in to change notification settings - Fork 38
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
Jenkins Integration #186
Jenkins Integration #186
Conversation
Jenkins firmware test failed. |
… utilities/jenkins dir to match schema PR #180.
Jenkins firmware test failed. |
There will be a bunch of comments and updates on this PR as I mess with Jenkins stuff today, just giving a heads up. |
rerun test |
run tests |
rerun tests |
run 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.
I have suggestion in addition to the lint we can do more ,
The current code base has a certain amount of warnings in linux build and CCS build . Can we use jenkins to ensure that the code which is getting added as part of PR doesn't add more warnings .
firmware/ec/src/main.c
Outdated
@@ -9,6 +9,7 @@ | |||
//***************************************************************************** | |||
// HEADER FILES | |||
//***************************************************************************** | |||
|
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 suppose that this extra line is to validate the script , please remove it before merging to master .
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, that was just done because linter only runs on changed files in Jenkins, so I needed a .c file to be be detected as changed so that the linter would be run. I will change it back with next commit.
@@ -0,0 +1,37 @@ | |||
node { |
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.
Could we add some headers for all the new files
Can we do some more testing for valid/invalid entries? |
I'm not sure what you mean by this, do you want the Jenkins tests to be added to or the Jenkinsfile to be tested more? Or more commits with errors to be made to verify the errors are caught?
Jenkins is rerun every commit, and can be forced to re-run by commenting on the PR (Note my comments above.) Right now I have it set to only run my commits automatically so that all other PR's don't get reported as failing, but once this is merged I will add all of us to the list for automatic running.
Yes, right now in addition to lint it builds the firmware (currently only with GCC, looking to add a Windows node and CCS build in the future) and runs the unit tests. For the build, it collects and reports all the warnings (330 right now...), but as far as I can tell there is no way to automate that it fails if new warnings appear, we would have to manually check status ourselves...will look into that some more, but that would be changes on Jenkins server side I think, not in the Jenkinsfile itself. |
more commits with errors to be made to verify the errors are caught assuming it is not yet done .
Great !!
Can we count the number of warning from the build logs , if it goes above 330 we can treat it as new warnings in the PR ? |
rerun tests |
Rerun tests |
Tests OK |
I'll add a few failed commits today that should show the red x next to them indicating Jenkins test failures.
I suppose could hardcode the jenkinsfile to compare number of warnings to 330, but I don't really like that solution. Let's get the repo running CI first and I'll create an issue to make Jenkins fail on new build warnings for a future PR. |
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.
Some of the discussion/comments here talk about upcoming work. Just want to make sure that its tracked somewhere so we don't forget about it.
Yup, added issue #210 last week to keep track of all the enhancements mentioned and other ones planned for future work. |
Description
Adding a Jenkinsfile and clang_patch script to support continuous integration testing on pull requests.
This Jenkinsfile will execute the following as a basic first step towards CI:
make ci
for firmware/ec. This will build the firmware image with GCC and create an initial coverage report that shows 0 coverage for all source files. The unit tests are then run and coverage gathered for each one. The results are output as junit xml file that Jenkins can interpret, and .ci/coverage.py is run to convert lcov output to Cobertura format that Jenkins can interpret. After all these runs, the warnings output by the build are gathered by the console so that this can also be tracked by Jenkins, but will not cause a test failure.Test Plan
Verify that the tests pass on this branch. Linter is not currently run unless PR #157 is closed and merged, then it should run and pass.
Unit tests should be reported as failed until #185 is closed and merged.
Verified clang patch by running it in top directory of the repo. Modified src/main.c by adding an extra empty line, just to verify that a modified file would be detected and patch file would be created.
Issues
#170