Skip to content

Commit f11fbf3

Browse files
committed
Lower case new variables.
1 parent 9f6d310 commit f11fbf3

File tree

2 files changed

+13
-5069
lines changed

2 files changed

+13
-5069
lines changed

.circleci/collect_results.sh

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,22 @@ if [[ ${#TEST_RESULT_DIRS[@]} -eq 0 ]]; then
2020
fi
2121

2222
function get_source_file () {
23-
FILE_PATH="${RESULT_XML_FILE%%"/build"*}"
24-
FILE_PATH="${FILE_PATH/#"$WORKSPACE_DIR"\//}/src"
23+
file_path="${RESULT_XML_FILE%%"/build"*}"
24+
file_path="${file_path/#"$WORKSPACE_DIR"\//}/src"
2525
if ! [[ $RESULT_XML_FILE == *"#"* ]]; then
26-
CLASS="${RESULT_XML_FILE%.xml}"
27-
CLASS="${CLASS##*"TEST-"}"
28-
CLASS="${CLASS##*"."}"
29-
COMMON_ROOT=$(grep -rl "class $CLASS" "$FILE_PATH" | head -n 1)
30-
while IFS= read -r LINE; do
31-
while [[ $LINE != "$COMMON_ROOT"* ]]; do
32-
COMMON_ROOT=$(dirname "$COMMON_ROOT")
33-
if [[ "$COMMON_ROOT" == "$COMMON_ROOT/.." ]]; then
26+
class="${RESULT_XML_FILE%.xml}"
27+
class="${class##*"TEST-"}"
28+
class="${class##*"."}"
29+
common_root=$(grep -rl "class $class" "$file_path" | head -n 1)
30+
while IFS= read -r line; do
31+
while [[ $line != "$common_root"* ]]; do
32+
common_root=$(dirname "$common_root")
33+
if [[ "$common_root" == "$common_root/.." ]]; then
3434
break
3535
fi
3636
done
37-
done < <(grep -rl "class $CLASS" "$FILE_PATH")
38-
FILE_PATH="$COMMON_ROOT"
37+
done < <(grep -rl "class $class" "$file_path")
38+
file_path="$common_root"
3939
fi
4040
}
4141

@@ -48,7 +48,7 @@ do
4848
cp "$RESULT_XML_FILE" "$TEST_RESULTS_DIR/$AGGREGATED_FILE_NAME"
4949
# Insert file attribute to testcase XML nodes
5050
get_source_file
51-
sed -i "/<testcase/ s|\(time=\"[^\"]*\"\)|\1 file=\"$FILE_PATH\"|g" "$TEST_RESULTS_DIR/$AGGREGATED_FILE_NAME"
51+
sed -i "/<testcase/ s|\(time=\"[^\"]*\"\)|\1 file=\"$file_path\"|g" "$TEST_RESULTS_DIR/$AGGREGATED_FILE_NAME"
5252
# Replace Java Object hashCode by marker in testcase XML nodes to get stable test names
5353
sed -i '/<testcase/ s/@[0-9a-f]\{5,\}/@HASHCODE/g' "$TEST_RESULTS_DIR/$AGGREGATED_FILE_NAME"
5454
# Replace random port numbers by marker in testcase XML nodes to get stable test names

0 commit comments

Comments
 (0)