-
Notifications
You must be signed in to change notification settings - Fork 9.1k
HDDS-2030. Generate simplifed reports by the dev-support/checks/*.sh scripts #1348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
73e95c2
HDDS-2030. Generate simplifed reports by the dev-support/checks/*.sh …
elek e1fbcdd
restore unit test execution
elek b9acba6
fix acceptance return code
elek db7bf97
fix shell check hints
elek b0185b0
add title to the summary only if there are failures
elek e985e4b
Update hadoop-ozone/dev-support/checks/_mvn_unit_report.sh
elek 35c9fa6
Update hadoop-ozone/dev-support/checks/acceptance.sh
elek 0f31808
Update hadoop-ozone/dev-support/checks/README.md
elek 55f677f
fix exit code
elek faf9511
Handle OOM problems
elek 9aa72a0
copy dump and hprof files
elek cad6c17
remove debug output of unit
elek f1e5ffa
make _mvn_unit_report executable
elek dc7f8c6
run unit test in bach mode
elek 506699d
Update hadoop-ozone/dev-support/checks/_mvn_unit_report.sh
elek 28627c3
fix shellcheck issues
elek 04d6847
Update hadoop-ozone/dev-support/checks/_mvn_unit_report.sh
elek 9f48ea1
improve the calculation of crashed tests
elek 0be4d5f
improve failing test header printing
elek 11ea649
fix header generation
elek 1c45443
shellcheck fix
elek File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<!--- | ||
Licensed 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. See accompanying LICENSE file. | ||
--> | ||
|
||
# Ozone checks | ||
|
||
This directory contains a collection of easy-to-use helper scripts to execute various type of tests on the ozone/hdds codebase. | ||
|
||
The contract of the scripts are very simple: | ||
|
||
1. Executing the scripts without any parameter will check the hdds/ozone project | ||
2. Shell exit code represents the result of the check (if failed, exits with non-zero code) | ||
3. Detailed information may be saved to the $OUTPUT_DIR (if it's not set, root level ./target will be used). | ||
4. The standard output should contain all the log about the build AND the results. | ||
5. The content of the $OUTPUT_DIR can be: | ||
* `summary.html`/`summary.md`/`summary.txt`: contains a human readable overview about the failed tests (used by reporting) | ||
* `failures`: contains a simple number (used by reporting) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,66 @@ | ||||||
#!/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. | ||||||
|
||||||
REPORT_DIR=${REPORT_DIR:-$PWD} | ||||||
|
||||||
## generate summary txt file | ||||||
find "." -name 'TEST*.xml' -print0 \ | ||||||
| xargs -n1 -0 "grep" -l -E "<failure|<error" \ | ||||||
| awk -F/ '{sub("'"TEST-"'",""); 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/" \; | ||||||
|
||||||
## Add the tests where the JVM is crashed | ||||||
grep -A1 'Crashed tests' "${REPORT_DIR}/output.log" \ | ||||||
| grep -v -e 'Crashed tests' -e '--' \ | ||||||
| cut -f2- -d' ' \ | ||||||
| sort -u >> "${REPORT_DIR}/summary.txt" | ||||||
|
||||||
#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/}" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
printf " * [%s](%s) ([output](%s))\n" "$FAILURE" "$TEST_RESULT_LOCATION" "$TEST_OUTPUT_LOCATION" >> "$SUMMARY_FILE" | ||||||
done | ||||||
done | ||||||
|
||||||
if [ -s "$SUMMARY_FILE" ]; then | ||||||
printf "# Failing tests: \n\n" | cat - "$SUMMARY_FILE" > temp && mv temp "$SUMMARY_FILE" | ||||||
fi | ||||||
|
||||||
## generate counter | ||||||
wc -l "$REPORT_DIR/summary.txt" | awk '{print $1}'> "$REPORT_DIR/failures" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also copy
*.dumpstream
, which may help finding out the cause ofCorrupted STDOUT
warning of forked JVM.http://maven.apache.org/surefire/maven-surefire-plugin/faq.html#dumpfiles