summaryrefslogtreecommitdiff
path: root/ci/_test-git-branch.sh
diff options
context:
space:
mode:
Diffstat (limited to 'ci/_test-git-branch.sh')
-rw-r--r--ci/_test-git-branch.sh80
1 files changed, 39 insertions, 41 deletions
diff --git a/ci/_test-git-branch.sh b/ci/_test-git-branch.sh
index 14c609c..930a0a9 100644
--- a/ci/_test-git-branch.sh
+++ b/ci/_test-git-branch.sh
@@ -23,58 +23,56 @@ sync_git_repos()
done
}
-while true; do
- echo "Getting test job"
+echo "Getting test job"
- TEST_JOB=( $(ssh $JOBSERVER get-test-job.sh) )
+TEST_JOB=( $(ssh $JOBSERVER get-test-job.sh) )
- BRANCH=${TEST_JOB[0]}
- COMMIT=${TEST_JOB[1]}
- TEST_PATH=${TEST_JOB[2]}
- TEST_NAME=$(basename -s .ktest $TEST_PATH)
+BRANCH=${TEST_JOB[0]}
+COMMIT=${TEST_JOB[1]}
+TEST_PATH=${TEST_JOB[2]}
+TEST_NAME=$(basename -s .ktest $TEST_PATH)
- if [[ -z $BRANCH ]]; then
- echo "Error getting test job: need git branch"
- exit 1
- fi
+if [[ -z $BRANCH ]]; then
+ echo "Error getting test job: need git branch"
+ exit 1
+fi
- if [[ -z $COMMIT ]]; then
- echo "Error getting test job: need git commit"
- exit 1
- fi
+if [[ -z $COMMIT ]]; then
+ echo "Error getting test job: need git commit"
+ exit 1
+fi
- if [[ -z $TEST_PATH ]]; then
- echo "Error getting test job: need test to run"
- exit 1
- fi
+if [[ -z $TEST_PATH ]]; then
+ echo "Error getting test job: need test to run"
+ exit 1
+fi
- echo "Running test $TEST_PATH on commit $COMMIT from branch $BRANCH"
+echo "Running test $TEST_PATH on commit $COMMIT from branch $BRANCH"
- sync_git_repos
- git_fetch linux $COMMIT
- git checkout FETCH_HEAD
+sync_git_repos
+git_fetch linux $COMMIT
+git checkout FETCH_HEAD
- git_fetch linux ci-monkeypatch
- git merge --no-edit FETCH_HEAD
+git_fetch linux ci-monkeypatch
+git merge --no-edit FETCH_HEAD || git reset --hard
- mkdir -p ktest-out
- rm -rf ktest-out/out
+mkdir -p ktest-out
+rm -rf ktest-out/out
- build-test-kernel run $TEST_PATH || true
+build-test-kernel run $TEST_PATH || true
- if [[ -f ktest-out/out/$TEST_NAME ]]; then
- echo "Test $TEST_NAME completed"
- else
- echo "Test $TEST_NAME failed to start"
- echo "TEST FAILED" > "ktest-out/out/$TEST_NAME"
- fi
+if [[ -f ktest-out/out/$TEST_NAME ]]; then
+ echo "Test $TEST_NAME completed"
+else
+ echo "Test $TEST_NAME failed to start"
+ echo "TEST FAILED" > "ktest-out/out/$TEST_NAME"
+fi
- find ktest-out/out -type f -name \*.log -print0|xargs -0 brotli --rm -9
+find ktest-out/out -type f -name \*.log -print0|xargs -0 brotli --rm -9
- OUTPUT=$JOBSERVER_OUTPUT_DIR/c/$COMMIT
- ssh $JOBSERVER mkdir -p $OUTPUT
- scp -r ktest-out/out/* $JOBSERVER:$OUTPUT
+OUTPUT=$JOBSERVER_OUTPUT_DIR/c/$COMMIT
+ssh $JOBSERVER mkdir -p $OUTPUT
+scp -r ktest-out/out/* $JOBSERVER:$OUTPUT
- echo "Running test-job-done.sh"
- ssh $JOBSERVER test-job-done.sh $BRANCH $COMMIT
-done
+echo "Running test-job-done.sh"
+ssh $JOBSERVER test-job-done.sh $BRANCH $COMMIT