-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Add build_even/odd types to split Arduino tests #4737
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,12 +39,19 @@ function build_sketches() | |
local srcpath=$2 | ||
local build_arg=$3 | ||
local build_dir=build.tmp | ||
local build_mod=$4 | ||
local build_rem=$5 | ||
mkdir -p $build_dir | ||
local build_cmd="python tools/build.py -b generic -v -w all -s 4M1M -v -k -p $PWD/$build_dir $build_arg " | ||
local sketches=$(find $srcpath -name *.ino) | ||
local sketches=$(find $srcpath -name *.ino | sort) | ||
print_size_info >size.log | ||
export ARDUINO_IDE_PATH=$arduino | ||
local testcnt=0 | ||
for sketch in $sketches; do | ||
testcnt=$(( ($testcnt + 1) % $build_mod )) | ||
if [ $testcnt -ne $build_rem ]; then | ||
continue # Not ours to do | ||
fi | ||
rm -rf $build_dir/* | ||
local sketchdir=$(dirname $sketch) | ||
local sketchdirname=$(basename $sketchdir) | ||
|
@@ -202,9 +209,12 @@ function install_arduino() | |
|
||
function build_sketches_with_arduino() | ||
{ | ||
local build_mod=$1 | ||
local build_rem=$2 | ||
|
||
# Compile sketches | ||
echo -e "travis_fold:start:sketch_test" | ||
build_sketches $HOME/arduino_ide $TRAVIS_BUILD_DIR/libraries "-l $HOME/Arduino/libraries" | ||
build_sketches $HOME/arduino_ide $TRAVIS_BUILD_DIR/libraries "-l $HOME/Arduino/libraries" $1 $2 | ||
echo -e "travis_fold:end:sketch_test" | ||
|
||
# Generate size report | ||
|
@@ -239,7 +249,13 @@ fi | |
|
||
if [ "$BUILD_TYPE" = "build" ]; then | ||
install_arduino | ||
build_sketches_with_arduino | ||
build_sketches_with_arduino 1 0 | ||
elif [ "$BUILD_TYPE" = "build_even" ]; then | ||
install_arduino | ||
build_sketches_with_arduino 2 0 | ||
elif [ "$BUILD_TYPE" = "build_odd" ]; then | ||
install_arduino | ||
build_sketches_with_arduino 2 1 | ||
elif [ "$BUILD_TYPE" = "platformio" ]; then | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't a similar even/odd scheme be implemented for platformio builds? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's not needed. PlatformIO builds the examples 2x (yes, two times) as fast as Arduino. So it takes ~28mins today vs 50+mins for Ardunio. Should we go from 96 to 200 examples, I'll revisit this statement, but for now we're OK. 😄 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looking at the.times, you're right. Even with load I see the platformio runtime doesn't go above 40mins. |
||
# PlatformIO | ||
install_platformio | ||
|
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 you please rename build/build_odd/build_even to e.g. arduino/arduino_odd/arduino_even? It's not critical for the pr, but every time I read through this code it takes me a few minutes to remember that "build" really means arduino and is not common to everything.