[ https://issues.apache.org/jira/browse/HDDS-2030?focusedWorklogId=303487&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-303487 ]
ASF GitHub Bot logged work on HDDS-2030: ---------------------------------------- Author: ASF GitHub Bot Created on: 29/Aug/19 09:31 Start Date: 29/Aug/19 09:31 Worklog Time Spent: 10m Work Description: hadoop-yetus commented on pull request #1348: HDDS-2030. Generate simplifed reports by the dev-support/checks/*.sh scripts URL: https://github.com/apache/hadoop/pull/1348#discussion_r318974214 ########## File path: hadoop-ozone/dev-support/checks/_mvn_unit_report.sh ########## @@ -0,0 +1,61 @@ +#!/usr/bin/env bash +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +## generate summary txt file +find "." -name 'TEST*.xml' -print0 \ + | xargs -n1 -0 "grep" -l -E "<failure|<error" \ + | awk -F/ '{sub("'"TEST-JUNIT_TEST_OUTPUT_DIR"'",""); sub(".xml",""); print $NF}' \ + | tee "$REPORT_DIR/summary.txt" + +#Copy heap dump and dump leftovers +find "." -name "*.hprof" -exec cp {} "$REPORT_DIR/" \; +find "." -name "*.dump" -exec cp {} "$REPORT_DIR/" \; + +#Collect of all of the report failes of FAILED tests +while IFS= read -r -d '' dir; do + while IFS=$'\n' read -r file; do + DIR_OF_TESTFILE=$(dirname "$file") + NAME_OF_TESTFILE=$(basename "$file") + NAME_OF_TEST="${NAME_OF_TESTFILE%.*}" + DESTDIRNAME=$(realpath --relative-to="$PWD" "$DIR_OF_TESTFILE/../..") + mkdir -p "$REPORT_DIR/$DESTDIRNAME" + #shellcheck disable=SC2086 + cp -r "$DIR_OF_TESTFILE"/*$NAME_OF_TEST* "$REPORT_DIR/$DESTDIRNAME/" + done < <(grep -l -r FAILURE --include="*.txt" "$dir" | grep -v output.txt) +done < <(find "." -name surefire-reports -print0) + +## generate summary markdown file +export SUMMARY_FILE="$REPORT_DIR/summary.md" +for TEST_RESULT_FILE in $(find "$REPORT_DIR" -name "*.txt" | grep -v output); do + + FAILURES=$(grep FAILURE "$TEST_RESULT_FILE" | grep "Tests run" | awk '{print $18}' | sort | uniq) + + for FAILURE in $FAILURES; do + TEST_RESULT_LOCATION="$(realpath --relative-to="$REPORT_DIR" "$TEST_RESULT_FILE")" + TEST_OUTPUT_LOCATION="${TEST_RESULT_LOCATION//.txt/-output.txt/}" + printf " * [%s](%s) ([output](%s))\n" "$FAILURE" "$TEST_RESULT_LOCATION" "$TEST_OUTPUT_LOCATION" >> "$SUMMARY_FILE" + done +done +printf "\n\n" >> "$SUMMARY_FILE" +printf "# Failing tests: \n\n" | cat $SUMMARY_FILE > temp && mv temp "$SUMMARY_FILE" + +## generate counter +wc -l "$REPORT_DIR/summary.txt" | awk '{print $1}'> "$REPORT_DIR/failures" + +#We may have oom errors in the log which are not included as we run with mvn -fn +if [ ! -s "$REPORT_DIR/summary.txt" ] && [ "$(grep "There are test failures." "$REPORT_DIR/output.log")" ]; then Review comment: shellcheck:44: note: Use grep -q instead of comparing output with [ -n .. ]. [SC2143] ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 303487) Time Spent: 8h 20m (was: 8h 10m) > Generate simplifed reports by the dev-support/checks/*.sh scripts > ----------------------------------------------------------------- > > Key: HDDS-2030 > URL: https://issues.apache.org/jira/browse/HDDS-2030 > Project: Hadoop Distributed Data Store > Issue Type: Improvement > Components: build > Reporter: Elek, Marton > Assignee: Elek, Marton > Priority: Major > Labels: pull-request-available > Time Spent: 8h 20m > Remaining Estimate: 0h > > hadoop-ozone/dev-support/checks directory contains shell scripts to execute > different type of code checks (findbugs, checkstyle, etc.) > Currently the contract is very simple. Every shell script executes one (and > only one) check and the shell response code is set according to the result > (non-zero code if failed). > To have better reporting in the github pr build, it would be great to improve > the scripts to generate simple summary files and save the relevant files for > archiving. -- This message was sent by Atlassian Jira (v8.3.2#803003) --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org