]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
ceph-pr-commits: skip "code_test" tests for commits changing "doc/"
authorKefu Chai <kchai@redhat.com>
Tue, 6 Oct 2020 15:16:03 +0000 (23:16 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 6 Oct 2020 15:54:00 +0000 (23:54 +0800)
Signed-off-by: Kefu Chai <kchai@redhat.com>
ceph-pr-commits/build/build

index a22a3c5f25101ea289ca7b161892020cef92a2d5..326791a65cfe9b76dc0f400f176e769083113d55 100644 (file)
@@ -4,22 +4,24 @@
 # Modified from ceph-docs/build/build.
 # I tried using the excluded-regions parameter for the ghprb plugin but since
 # this job/check is required, it hung with 'Expected — Waiting for status to be reported'
+pushd .
 cd "$WORKSPACE/ceph"
 if git rev-parse --verify ${GIT_COMMIT}^2; then
      files="$(git diff --name-only ${GIT_COMMIT}^1...${GIT_COMMIT}^2)"
      echo -e "changed files:\n$files"
      if [ $(echo "$files" | grep -v '^doc/' | wc -l) -gt 0 ]; then
          echo "Not a docs only change.  Will proceed with signed commit check."
-         cd -
+         pytest_mark="code_test"
      else
          echo "Only the doc/ dir changed.  No need to check for signed commits."
-         exit 0
+         pytest_mark="not code_test"
      fi
 fi
+popd
 
 # the following two methods exist in scripts/build_utils.sh
 pkgs=( "pytest" )
 install_python_packages "pkgs[@]"
 
 cd "$WORKSPACE"
-timeout 600 $VENV/py.test -vs --junitxml="$WORKSPACE/report.xml" "$WORKSPACE/ceph-build/ceph-pr-commits/build/test_commits.py"
+timeout 600 $VENV/py.test -m "${pytest_mark}" -vs --junitxml="$WORKSPACE/report.xml" "$WORKSPACE/ceph-build/ceph-pr-commits/build/test_commits.py"