diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2022-07-07 17:18:44 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2022-07-07 23:52:08 -0400 |
commit | 6ec253d2b80a123861cad166115faba4b862c35d (patch) | |
tree | 9321628607b4d05bc558ab62887633a0bd04d82c | |
parent | 3d1cd69aa8307e6bcf48b9a33abe4f1a86c901cb (diff) |
get-test-job.sh: tweak looping
We now get the latest version of the script on every loop iteration
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
-rw-r--r-- | ci/_test-git-branch.sh | 80 | ||||
-rwxr-xr-x | ci/test-git-branch.sh | 4 |
2 files changed, 42 insertions, 42 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 diff --git a/ci/test-git-branch.sh b/ci/test-git-branch.sh index 1044343..55968ef 100755 --- a/ci/test-git-branch.sh +++ b/ci/test-git-branch.sh @@ -2,4 +2,6 @@ JOBSERVER=$1 -source <(ssh $JOBSERVER cat .ktestrc bin/_test-git-branch.sh) +while true; do + source <(ssh $JOBSERVER cat .ktestrc bin/_test-git-branch.sh) +done |