[2.0.x] Debug Travis tests and scripts (#11704)

This commit is contained in:
Scott Lahteine 2018-09-02 03:27:39 -05:00 committed by GitHub
parent d0c96ee83e
commit 8c11220042
Signed by: GitHub
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 64 additions and 71 deletions

View file

@ -51,13 +51,13 @@ jobs:
export PATH=`pwd`/buildroot/bin/:${PATH}
# Generate custom version include
generate_version_header_for_marlin ./Marlin/src/inc
generate_version ./Marlin/src/inc
cat ./Marlin/src/inc/_Version.h
#
# Back up the environment
# Backup pins_RAMPS.h
#
cp Marlin/src/pins/pins_RAMPS.h Marlin/src/pins/pins_RAMPS.h.backup
#
env_backup
#################################
# Build all sample configurations
@ -279,10 +279,6 @@ jobs:
# Remove temp files from dependencies tree prior to caching
rm -rf ~/Marlin/.piolibdeps/_tmp_*
#
# Restore the environment
#
env_restore
- save_cache:

View file

@ -45,7 +45,7 @@ before_script:
- cd ${TRAVIS_BUILD_DIR}
#
# Generate custom version include
- generate_version_header_for_marlin ${TRAVIS_BUILD_DIR}/Marlin/src/inc
- generate_version ${TRAVIS_BUILD_DIR}/Marlin/src/inc
- cat ${TRAVIS_BUILD_DIR}/Marlin/src/inc/_Version.h
#
script:

View file

@ -2,13 +2,13 @@
[ -z "$1" ] || cd $1
if [ -d .test ]; then
if [ -d ".test" ]; then
printf "\033[0;31mEnvironment backup already exists!\033[0m\n"
else
mkdir .test
cp -r Marlin/src/pins .test/pins
cp Marlin/Configuration*.h .test/
[ -f Marlin/_Bootscreen.h ] && cp Marlin/_Bootscreen.h .test/
[ -f Marlin/_Statusscreen.h ] && cp Marlin/_Statusscreen.h .test/
cp -r Marlin/src/pins .test/pins
printf "\033[0;32mEnvironment Backup created\033[0m\n"
fi

View file

@ -2,10 +2,25 @@
[ -z "$1" ] || cd $1
cp Marlin/src/config/default/* Marlin/
[ -f Marlin/_Bootscreen.h ] && rm Marlin/_Bootscreen.h
[ -f Marlin/_Statusscreen.h ] && rm Marlin/_Statusscreen.h
[ -d .test/pins ] && { cp .test/pins/* Marlin/src/pins/ ; rm -rf .test/pins ; }
[ -d .test ] && rm -r .test
if [ -d ".test" ]; then
cp .test/Configuration*.h Marlin/
rm .test/Configuration*.h
printf "\033[0;32mEnvironment Restored\033[0m\n"
if [ -f .test/_Bootscreen.h ]; then
cp .test/_Bootscreen.h Marlin/
rm .test/_Bootscreen.h
fi
if [ -f .test/_Statusscreen.h ]; then
cp .test/_Statusscreen.h Marlin/
rm .test/_Statusscreen.h
fi
cp -r .test/pins Marlin/src
rm -r .test/pins
rmdir .test
printf "\033[0;32mEnvironment Restored\033[0m\n"
else
printf "\033[0;31mEnvironment Backup not available!\033[0m\n"
fi

View file

@ -1,5 +1,9 @@
#!/usr/bin/env bash
# generate_version_header_for_marlin
#
# generate_version
#
# Make a _Version.h file
#
DIR="${1}"
@ -9,13 +13,8 @@ DISTDATE=$(date '+%Y-%m-%d %H:%M')
BRANCH=$(git -C "${DIR}" symbolic-ref -q --short HEAD)
VERSION=$(git -C "${DIR}" describe --tags --first-parent 2>/dev/null)
if [ -z "${BRANCH}" ]; then
BRANCH=$(echo "${TRAVIS_BRANCH}")
fi
if [ -z "${VERSION}" ]; then
VERSION=$(git -C "${DIR}" describe --tags --first-parent --always 2>/dev/null)
fi
[ -z "${BRANCH}" ] && BRANCH=$(echo "${TRAVIS_BRANCH}")
[ -z "${VERSION}" ] && VERSION=$(git -C "${DIR}" describe --tags --first-parent --always 2>/dev/null)
SHORT_BUILD_VERSION=$(echo "${BRANCH}")
DETAILED_BUILD_VERSION=$(echo "${BRANCH}-${VERSION}")

View file

@ -1,15 +1,9 @@
#!/usr/bin/env bash
#
# restore_configs
#
# Restore default configs, delete pins backup and dogm bitmaps
#
# Restore the (possibly modified) Configurations
[ -d ".test" -a -f ".test/Configuration.h" ] && cp .test/Configuration*.h Marlin/
cp Marlin/src/config/default/Configuration*.h Marlin
# Restore the original unmodified pins
[ -d ".test/pins" ] && cp -r .test/pins Marlin/src/pins/
[ -f Marlin/src/pins/pins_RAMPS.h.backup ] && cp Marlin/src/pins/pins_RAMPS.h.backup Marlin/src/pins/pins_RAMPS.h
rm -f Marlin/src/pins/pins_RAMPS.h.backup
# Delete DOGM bitmaps
rm -f Marlin/_*screen.h
rm -f Marlin/_Bootscreen.h
rm -f Marlin/_Statusscreen.h

View file

@ -1,3 +1,3 @@
#!/usr/bin/env bash
cp Marlin/Configuration*.h .test/
cp Marlin/Configuration*.h Marlin/src/config/default

View file

@ -3,14 +3,9 @@
# exit on first failure
set -e
env_backup
restore_configs
opt_set MOTHERBOARD BOARD_RAMPS4DUE_EFB
update_defaults
opt_enable S_CURVE_ACCELERATION EEPROM_SETTINGS
opt_set E0_AUTO_FAN_PIN 8
opt_set EXTRUDER_AUTO_FAN_SPEED 100
exec_test $1 $2 "RAMPS4DUE_EFB S_CURVE_ACCELERATION EEPROM_SETTINGS"
env_restore

View file

@ -3,11 +3,8 @@
# exit on first failure
set -e
env_backup
restore_configs
opt_set MOTHERBOARD BOARD_RAMPS_14_RE_ARM_EFB
update_defaults
exec_test $1 $2 "Build Re-ARM Default Configuration"
restore_configs
@ -63,4 +60,5 @@ opt_enable FAN_SOFT_PWM SDSUPPORT
opt_enable USE_XMAX_PLUG
exec_test $1 $2 "MKS SBASE Many less common options"
env_restore
#clean up
restore_configs

View file

@ -3,12 +3,10 @@
# exit on first failure
set -e
env_backup
restore_configs
opt_set MOTHERBOARD BOARD_STM32F1R
update_defaults
opt_enable EEPROM_SETTINGS EEPROM_CHITCHAT REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT
exec_test $1 $2 "STM32F1R EEPROM_SETTINGS EEPROM_CHITCHAT REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT"
env_restore
#cleanup
restore_configs

View file

@ -3,13 +3,15 @@
# exit on first failure
set -e
env_backup
#
# Backup pins_RAMPS.h
#
cp Marlin/src/pins/pins_RAMPS.h Marlin/src/pins/pins_RAMPS.h.backup
#
# Build with the default configurations
#
restore_configs
exec_test $1 $2 "Default Configuration"
#
# Test 2 extruders (one MAX6675) and heated bed on basic RAMPS 1.4
# Test a "Fix Mounted" Probe with Safe Homing, some arc options,
@ -309,4 +311,5 @@ exec_test $1 $2 "TMC2208 Config"
#
#
env_restore
#clean up
restore_configs

View file

@ -1,17 +1,11 @@
#!/usr/bin/env bash
#
# start_tests
#
# Run one or more tests
#
export PATH="$PATH:$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )"
export PATH="$PATH:./buildroot/bin"
# exit on first failure
set -e
exec_test() {
exec_test () {
printf "\033[0;32m[Test $2] \033[0m$3... "
if build_marlin_pio $1 "-e $2"; then
printf "\033[0;32mPassed\033[0m\n"
@ -24,6 +18,9 @@ exec_test() {
}
export -f exec_test
env_backup
printf "Running \033[0;32m$2\033[0m Tests\n"
if [[ $3 = "--deep-clean" ]]; then
echo "Deleting all PlatformIO caches, downloads and installed packages..."
env_clean --deep
@ -39,9 +36,8 @@ if [[ $2 = "ALL" ]]; then
$f $1 $testenv
done
else
printf "Running \033[0;32m$2\033[0m Tests\n"
exec_test $1 "$2 --target clean" "Setup Build Environment"
$2_tests $1 $2
fi
printf "\033[0;32mAll tests completed successfully\033[0m\n"
env_restore

View file

@ -3,11 +3,9 @@
# exit on first failure
set -e
env_backup
restore_configs
opt_set MOTHERBOARD BOARD_TEENSY35_36
update_defaults
cp Marlin/src/pins/pins_RAMPS.h Marlin/src/pins/pins_RAMPS.h.backup
#
# Test Teensy3.5 with default config
#
@ -94,4 +92,5 @@ opt_add_adv Z2_MAX_PIN 2
opt_enable USE_XMAX_PLUG
exec_test $1 $2 "Z_DUAL_STEPPER_DRIVERS, Z_DUAL_ENDSTOPS"
env_restore
#cleanup
restore_configs