kjs1095 commented on code in PR #12090:
URL: https://github.com/apache/ozone/pull/12090#discussion_r4635756256
##########
hadoop-ozone/dev-support/checks/pyunit.sh:
##########
@@ -15,8 +14,28 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-@test "coverage_summary.py unit tests" {
- cd "${BATS_TEST_DIRNAME}"
- run python3 -m unittest test_coverage_summary
- [ "$status" -eq 0 ]
-}
+#checks:basic
+
+set -u -o pipefail
+
+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
+# from <ozone-root>/hadoop-ozone/dev-support/checks to <ozone-root>
+cd "${DIR}/../../.." || exit 1
+BASE_DIR="$(pwd -P)"
+
+CHECK=pyunit
+
+REPORT_DIR=${OUTPUT_DIR:-"${BASE_DIR}/target/${CHECK}"}
+mkdir -p "${REPORT_DIR}"
+
+REPORT_FILE="${REPORT_DIR}/summary.txt"
+
+python3 -m unittest discover -v -s dev-support/ci -p 'test_*.py' 2>&1 \
+ | tee "${REPORT_DIR}/output.log"
+rc=$?
+
+grep '^\(FAIL\|ERROR\): ' "${REPORT_DIR}/output.log" > "${REPORT_FILE}"
+grep -c '^\(FAIL\|ERROR\): ' "${REPORT_FILE}" > "${REPORT_DIR}/failures"
Review Comment:
Thanks for pointing out this!
Yeah, line 38 is equivalent to `wc -l < "${REPORT_FILE}" >
"${REPORT_DIR}/failures"` with context line 37.
I use grep again to ensure that counting FAIL/ERROR even if line 37 outputs
extra new lines.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]