-
Notifications
You must be signed in to change notification settings - Fork 121
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
Use Travis CI for automated testing #42
Conversation
arduino-ci-script.sh contains functions called by .travis.yml which are used for Travis CI builds of MegaCore. per1234/arduino-ci-script@e6c1b9b
- Test every board configuration that could affect compilation with every example sketch for every bundled library with every supported version of the Arduino IDE. - Test every board configuration that shouldn't affect compilation with the BareMinimum sketch.
Awesome! |
I just spotted a drawback to the subtree. If someone does a manual installation of MegaCore the
This doesn't actually break anything and it won't occur with Boards Manager installations but I've seen this cause concern for users of a different hardware package that generates this warning. |
You're right. I believe the warning goes away if we move it into the avr folder. This is how it was solved over at the ATTinyCore repo Travis is working on the build right now. Will there be a problem if I move the |
That's correct. Sorry about that. I should have caught it. It only happens when you open and close Boards Manager. I actually just noticed it in the Travis CI log. I'm going to add a check for that warning to my script. I have a function in my script |
No worries, I should have caught it too. I'm quoting myself:
|
It won't affect the current build because that's working with MegaCore at 039be8e. When you move the travis-ci folder you also need to change this line of .travis.yml: - source "${TRAVIS_BUILD_DIR}/travis-ci/arduino-ci-script/arduino-ci-script.sh" to: - source "${TRAVIS_BUILD_DIR}/avr/travis-ci/arduino-ci-script/arduino-ci-script.sh" after you commit that it will start another Travis CI build but the current one will continue. It doesn't like to do a lot of builds at once so it may wait until the current build is finished before starting the next one. You can cancel a build if you don't want to wait. |
I moved the folder and edited .travis.yml. Just noticed that build 3.1 and 3.2 failed. Any idea what happened here? https://travis-ci.org/MCUdude/MegaCore/jobs/231929339 |
They were canceled. Do you have the "Auto Cancellation" feature turned on in your Travis CI settings for MegaCore? |
Wait, I might have canceled them by a mistake when trying to cancel the build job from this PR. seems likely.. |
Yes, it's quite a hassle. That was my motivation for all the work I did on the report system, but they still can't tell you exactly what the error was, only to give some helpful information. I open the raw log and then do a search for "error". I need to do some work to reduce some of the unnecessary verbosity of the logs. Some of the processes are printing a lot more output than is necessary for normal usage. I have a function in the script
Ok, hopefully that's it. You can always restart a build if you want. |
Some information regarding build duration: So this explains why, even though I managed to reduce the number of compilations from 23000 to 18000, the build time stayed about the same. This is because I had to add more jobs and every job incurs the overhead of the installation processes. This is why a job that only requires the compilation of 10 small sketches like: With the current Travis CI system I don't see any way to solve this issue. However, they announced yesterday that they released a new "Build Stages" feature to beta testing: |
It seems like there's an issue when building for the ATmega640/1280/2560. Seems to be related to the |
My build did catch it. I mentioned it a few days ago: |
It's been running all night. Turned out that the PCINT related macros where missing for the ATmega1281/2561. I'm going to push theses soon as the error below is resolved. I also got this strange error a few times. What's causing this? |
When Travis CI calls the What's really strange is that that seems to have hung the job. I would expect that after the push failed it should go on to print the report to the log. If it hung then Travis CI should terminate the job after 10 minutes of no activity. I can't explain why neither of those things happened. I'll do some research and run some tests to improve the script so this doesn't happen. It's a difficult one to work on because it's very hard to reproduce. |
If multiple jobs complete around the same time publish_report_to_repository can fail because of history conflict. This is caused by one job pushing to the repository after the other job has cloned the repository but before it has pushed, causing a history conflict. To avoid this I have added a ;pull before the commit (because this is the last chance to do a pull without the chance of a conflict) and just in case, another pull before the push. It should be extremely rare that a push from one job happens between the pull and push of another job. Issue reported at MCUdude/MegaCore#42 (comment)
Job log: https://travis-ci.org/per1234/arduino-ci-script/jobs/232313264 Commit: per1234/arduino-ci-script@72c8fb2 Pull from remote report repository before pushing If multiple jobs complete around the same time publish_report_to_repository can fail because of history conflict. This is caused by one job pushing to the repository after the other job has cloned the repository but before it has pushed, causing a history conflict. To avoid this I have added a ;pull before the commit (because this is the last chance to do a pull without the chance of a conflict) and just in case, another pull before the push. It should be extremely rare that a push from one job happens between the pull and push of another job. Issue reported at MCUdude/MegaCore#42 (comment) [skip ci]
Job log: https://travis-ci.org/per1234/arduino-ci-script/jobs/232313265 Commit: per1234/arduino-ci-script@72c8fb2 Pull from remote report repository before pushing If multiple jobs complete around the same time publish_report_to_repository can fail because of history conflict. This is caused by one job pushing to the repository after the other job has cloned the repository but before it has pushed, causing a history conflict. To avoid this I have added a ;pull before the commit (because this is the last chance to do a pull without the chance of a conflict) and just in case, another pull before the push. It should be extremely rare that a push from one job happens between the pull and push of another job. Issue reported at MCUdude/MegaCore#42 (comment) [skip ci]
Job log: https://travis-ci.org/per1234/arduino-ci-script/jobs/232313263 Commit: per1234/arduino-ci-script@72c8fb2 Pull from remote report repository before pushing If multiple jobs complete around the same time publish_report_to_repository can fail because of history conflict. This is caused by one job pushing to the repository after the other job has cloned the repository but before it has pushed, causing a history conflict. To avoid this I have added a ;pull before the commit (because this is the last chance to do a pull without the chance of a conflict) and just in case, another pull before the push. It should be extremely rare that a push from one job happens between the pull and push of another job. Issue reported at MCUdude/MegaCore#42 (comment) [skip ci]
Job log: https://travis-ci.org/per1234/arduino-ci-script/jobs/232324094 Commit: per1234/arduino-ci-script@72c8fb2 Pull from remote report repository before pushing If multiple jobs complete around the same time publish_report_to_repository can fail because of history conflict. This is caused by one job pushing to the repository after the other job has cloned the repository but before it has pushed, causing a history conflict. To avoid this I have added a ;pull before the commit (because this is the last chance to do a pull without the chance of a conflict) and just in case, another pull before the push. It should be extremely rare that a push from one job happens between the pull and push of another job. Issue reported at MCUdude/MegaCore#42 (comment) [skip ci]
Job log: https://travis-ci.org/per1234/arduino-ci-script/jobs/232324095 Commit: per1234/arduino-ci-script@72c8fb2 Pull from remote report repository before pushing If multiple jobs complete around the same time publish_report_to_repository can fail because of history conflict. This is caused by one job pushing to the repository after the other job has cloned the repository but before it has pushed, causing a history conflict. To avoid this I have added a ;pull before the commit (because this is the last chance to do a pull without the chance of a conflict) and just in case, another pull before the push. It should be extremely rare that a push from one job happens between the pull and push of another job. Issue reported at MCUdude/MegaCore#42 (comment) [skip ci]
Job log: https://travis-ci.org/per1234/arduino-ci-script/jobs/232324093 Commit: per1234/arduino-ci-script@72c8fb2 Pull from remote report repository before pushing If multiple jobs complete around the same time publish_report_to_repository can fail because of history conflict. This is caused by one job pushing to the repository after the other job has cloned the repository but before it has pushed, causing a history conflict. To avoid this I have added a ;pull before the commit (because this is the last chance to do a pull without the chance of a conflict) and just in case, another pull before the push. It should be extremely rare that a push from one job happens between the pull and push of another job. Issue reported at MCUdude/MegaCore#42 (comment) [skip ci]
I have updated the script to pull from the remote repository just before pushing. This should solve the issue other than the rare case when the other job happens to push in that very small time frame between the pull and the push going through. I also added code to pull and then retry the push multiple times if it fails. However, the log you linked above indicates that a failed push will cause the build to immediately fail so that won't do any good yet. I am planning to make some changes to the script to ensure the correct failure behavior of all functions:
This is the intended behavior stated in the Travis CI documentation but it seems that it is necessary to configure external scripts correctly to achieve this. I know I have the first two working correctly already. |
Great! Would be great if you'd add it as a PR |
OK, test build in progress: |
Looks very promising! Let's say everything is all right, and I merge the change into the avr-100-pin branch. Is it then possible to merge the avr-100-pin branch into the master, while changing the branch path to |
Sure is nice to see all those green check marks in a row! I don't think the branch path is coded into the script anywhere. Where did you see that? |
I was sure you wrote somewhere that the branch name needed to be changed. Maybe you where referring to the badge in the readme? |
Yes, that was the only place that avr-100-pin was hardcoded, and I see you already changed that. So it should automatically handle merging to any branch. Travis CI will build commits for any branch in the repository that has a .travis.yml file in the root. I have been doing all my builds of MegaCore on different branch names so I would notice if I had anything branch specific in the script or .travis.yml. |
Purpose:
avr-100-pin
branch of the MCUdude/MegaCore branch. When that branch is merged with themaster
branch you will need to update the URL.Files: