run onroad tests on release build (#22700)

* check startup aelrt

* release decorator

* run in jenkins

* run onroad tests

* no push

* fix release2 build

* fix path

* no overwrite

* single release build script

* make files_eon non empty

* files

* run in source

* add that for now

* print

* ignore initialzing

* print

* fetch

* run tests last

* check alert text

* revert some stuff

* fixup jenkinsfile

Co-authored-by: Comma Device <device@comma.ai>
This commit is contained in:
Adeeb Shihadeh
2021-10-26 23:50:05 -07:00
committed by GitHub
parent 5b331fd6f5
commit 7feae28705
7 changed files with 67 additions and 118 deletions

View File

@@ -9,7 +9,17 @@ cd $DIR
BUILD_DIR=/data/openpilot
SOURCE_DIR="$(git rev-parse --show-toplevel)"
BRANCH=release3-staging
if [ -f /TICI ]; then
FILES_SRC="release/files_tici"
RELEASE_BRANCH=release3-staging
DASHBAM_BRANCH=dashcam3-staging
elif [ -f /EON ]; then
FILES_SRC="release/files_eon"
RELEASE_BRANCH=release2-staging
DASHBAM_BRANCH=dashcam-staging
else
exit 0
fi
# set git identity
source $DIR/identity.sh
@@ -20,13 +30,14 @@ mkdir -p $BUILD_DIR
cd $BUILD_DIR
git init
git remote add origin git@github.com:commaai/openpilot.git
git checkout -f -B $BRANCH
git fetch origin $RELEASE_BRANCH
git checkout --orphan $RELEASE_BRANCH
# do the files copy
echo "[-] copying files T=$SECONDS"
cd $SOURCE_DIR
cp -pR --parents $(cat release/files_common) $BUILD_DIR/
cp -pR --parents $(cat release/files_tici) $BUILD_DIR/
cp -pR --parents $(cat $FILES_SRC) $BUILD_DIR/
# in the directory
cd $BUILD_DIR
@@ -39,6 +50,7 @@ echo "#define COMMA_VERSION \"$VERSION-release\"" > selfdrive/common/version.h
echo "[-] committing version $VERSION T=$SECONDS"
git add -f .
git commit -a -m "openpilot v$VERSION release"
git branch --set-upstream-to=origin/$RELEASE_BRANCH
# Build panda firmware
pushd panda/
@@ -50,15 +62,20 @@ popd
export PYTHONPATH="$BUILD_DIR"
scons -j$(nproc)
# Run tests
#python selfdrive/manager/test/test_manager.py
selfdrive/car/tests/test_car_interfaces.py
# Ensure no submodules in release
if test "$(git submodule--helper list | wc -l)" -gt "0"; then
echo "submodules found:"
git submodule--helper list
exit 1
fi
git submodule status
# Cleanup
find . -name '*.a' -delete
find . -name '*.o' -delete
find . -name '*.os' -delete
find . -name '*.pyc' -delete
find . -name 'moc_*' -delete
find . -name '__pycache__' -delete
rm -rf panda/board panda/certs panda/crypto
rm -rf .sconsign.dblite Jenkinsfile release/
@@ -78,15 +95,24 @@ touch prebuilt
git add -f .
git commit --amend -m "openpilot v$VERSION"
# Run tests
TEST_FILES="tools/"
cd $SOURCE_DIR
cp -pR -n --parents $TEST_FILES $BUILD_DIR/
cd $BUILD_DIR
RELEASE=1 selfdrive/test/test_onroad.py
#selfdrive/manager/test/test_manager.py
selfdrive/car/tests/test_car_interfaces.py
rm -rf $TEST_FILES
if [ ! -z "$PUSH" ]; then
echo "[-] pushing T=$SECONDS"
git remote set-url origin git@github.com:commaai/openpilot.git
git push -f origin $BRANCH
git push -f origin $RELEASE_BRANCH
# Create dashcam
git rm selfdrive/car/*/carcontroller.py
git commit -m "create dashcam release from release"
git push -f origin $BRANCH:dashcam3-staging
git push -f origin $RELEASE_BRANCH:$DASHCAM_BRANCH
fi
echo "[-] done T=$SECONDS"

View File

@@ -1,104 +0,0 @@
#!/usr/bin/env bash
set -e
export GIT_COMMITTER_NAME="Vehicle Researcher"
export GIT_COMMITTER_EMAIL="user@comma.ai"
export GIT_AUTHOR_NAME="Vehicle Researcher"
export GIT_AUTHOR_EMAIL="user@comma.ai"
export GIT_SSH_COMMAND="ssh -i /data/gitkey"
# set CLEAN to build outside of CI
if [ ! -z "$CLEAN" ]; then
# Create folders
rm -rf /data/openpilot
mkdir -p /data/openpilot
cd /data/openpilot
# Create git repo
git init
git remote add origin git@github.com:commaai/openpilot.git
git fetch origin devel-staging
else
cd /data/openpilot
git clean -xdf
git branch -D release2-staging || true
fi
git fetch origin release2-staging
git fetch origin dashcam-staging
# Create release2 with no history
if [ ! -z "$CLEAN" ]; then
git checkout --orphan release2-staging origin/devel-staging
else
git checkout --orphan release2-staging
fi
VERSION=$(cat selfdrive/common/version.h | awk -F[\"-] '{print $2}')
echo "#define COMMA_VERSION \"$VERSION-release\"" > selfdrive/common/version.h
git commit -m "openpilot v$VERSION"
# Build signed panda firmware
pushd panda/
CERT=/tmp/pandaextra/certs/release RELEASE=1 scons -u .
mv board/obj/panda.bin.signed /tmp/panda.bin.signed
popd
# Build stuff
ln -sfn /data/openpilot /data/pythonpath
export PYTHONPATH="/data/openpilot:/data/openpilot/pyextra"
scons -j3
# Run tests
python selfdrive/manager/test/test_manager.py
selfdrive/car/tests/test_car_interfaces.py
# Ensure no submodules in release
if test "$(git submodule--helper list | wc -l)" -gt "0"; then
echo "submodules found:"
git submodule--helper list
exit 1
fi
git submodule status
# Cleanup
find . -name '*.a' -delete
find . -name '*.o' -delete
find . -name '*.os' -delete
find . -name '*.pyc' -delete
find . -name '__pycache__' -delete
rm -rf panda/board panda/certs panda/crypto
rm -rf .sconsign.dblite Jenkinsfile release/
rm models/supercombo.dlc
# Move back signed panda fw
mkdir -p panda/board/obj
mv /tmp/panda.bin.signed panda/board/obj/panda.bin.signed
# Restore third_party
git checkout third_party/
# Mark as prebuilt release
touch prebuilt
# Add built files to git
git add -f .
git commit --amend -m "openpilot v$VERSION"
# Print committed files that are normally gitignored
#git status --ignored
if [ ! -z "$PUSH" ]; then
git remote set-url origin git@github.com:commaai/openpilot.git
# Push to release2-staging
git push -f origin release2-staging
# Create dashcam release
git rm selfdrive/car/*/carcontroller.py
git commit -m "create dashcam release from release2"
git push -f origin release2-staging:dashcam-staging
fi

1
release/files_eon Normal file
View File

@@ -0,0 +1 @@
README.md