diff --git a/Jenkinsfile b/Jenkinsfile index 778d8f3e54..90c336b6d2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -180,21 +180,29 @@ pipeline { } */ - stage('Tici Build') { + stage('tici Build') { environment { R3_PUSH = "${env.BRANCH_NAME == 'master' ? '1' : ' '}" } steps { phone_steps("tici", [ ["build", "cd selfdrive/manager && ./build.py"], - ["test loggerd", "python selfdrive/loggerd/tests/test_loggerd.py"], - ["test encoder", "LD_LIBRARY_PATH=/usr/local/lib python selfdrive/loggerd/tests/test_encoder.py"], ["onroad tests", "cd selfdrive/test/ && ./test_onroad.py"], //["build release3-staging", "cd release && PUSH=${env.R3_PUSH} ./build_release3.sh"], ]) } } + stage('Unit Tests (tici)') { + steps { + phone_steps("tici2", [ + ["build", "cd selfdrive/manager && ./build.py"], + ["test loggerd", "python selfdrive/loggerd/tests/test_loggerd.py"], + ["test encoder", "LD_LIBRARY_PATH=/usr/local/lib python selfdrive/loggerd/tests/test_encoder.py"], + ]) + } + } + stage('camerad') { steps { phone_steps("eon-party", [ diff --git a/selfdrive/loggerd/tests/test_loggerd.py b/selfdrive/loggerd/tests/test_loggerd.py index f982362941..f537e2569b 100755 --- a/selfdrive/loggerd/tests/test_loggerd.py +++ b/selfdrive/loggerd/tests/test_loggerd.py @@ -39,17 +39,19 @@ class TestLoggerd(unittest.TestCase): return log_dirs[-1] def _get_log_dir(self, x): - for p in x.split(' '): - path = Path(p.strip()) - if path.is_dir(): - return path + for l in x.splitlines(): + for p in l.split(' '): + path = Path(p.strip()) + if path.is_dir(): + return path return None def _get_log_fn(self, x): - for p in x.split(' '): - path = Path(p.strip()) - if path.is_file(): - return path + for l in x.splitlines(): + for p in l.split(' '): + path = Path(p.strip()) + if path.is_file(): + return path return None def _gen_bootlog(self): diff --git a/selfdrive/manager/test/test_manager.py b/selfdrive/manager/test/test_manager.py index fd8934850f..588d72aa28 100644 --- a/selfdrive/manager/test/test_manager.py +++ b/selfdrive/manager/test/test_manager.py @@ -42,7 +42,7 @@ class TestManager(unittest.TestCase): for p in ALL_PROCESSES: managed_processes[p].start() - time.sleep(30) + time.sleep(10) for p in reversed(ALL_PROCESSES): state = managed_processes[p].get_process_state_msg() diff --git a/selfdrive/test/setup_device_ci.sh b/selfdrive/test/setup_device_ci.sh index d186f8c05f..b244698c22 100755 --- a/selfdrive/test/setup_device_ci.sh +++ b/selfdrive/test/setup_device_ci.sh @@ -12,20 +12,6 @@ if [ -z "$TEST_DIR" ]; then exit 1 fi -# setup jenkins device -if [ ! -d "$SOURCE_DIR" ]; then - # write continue.sh - CONTINUE_FILE="/data/data/com.termux/files/continue.sh" - echo "#!/usr/bin/bash" > $CONTINUE_FILE - echo "wpa_cli IFNAME=wlan0 SCAN" >> $CONTINUE_FILE - echo "sleep infinity" >> $CONTINUE_FILE - - # write SSH keys - curl "https://github.com/commaci2.keys" > /data/params/d/GithubSshKeys - - git clone --depth 1 https://github.com/commaai/openpilot.git "$SOURCE_DIR" -fi - if [ -f "/EON" ]; then rm -rf /data/core rm -rf /data/neoupdate @@ -34,17 +20,15 @@ fi # set up environment cd $SOURCE_DIR -git reset --hard -git fetch -find . -maxdepth 1 -not -path './.git' -not -name '.' -not -name '..' -exec rm -rf '{}' \; +git fetch origin $GIT_COMMIT git reset --hard $GIT_COMMIT git checkout $GIT_COMMIT git clean -xdf git submodule update --init --recursive -git submodule foreach --recursive git reset --hard -git submodule foreach --recursive git clean -xdf -echo "git checkout took $SECONDS seconds" +git submodule foreach --recursive "git reset --hard && git clean -xdf" + +echo "git checkout done, t=$SECONDS" rsync -a --delete $SOURCE_DIR $TEST_DIR -echo "$TEST_DIR synced with $GIT_COMMIT, took $SECONDS seconds" +echo "$TEST_DIR synced with $GIT_COMMIT, t=$SECONDS"