Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions .gitlab/collect_results.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,7 @@ function get_source_file () {
class="${RESULT_XML_FILE%.xml}"
class="${class##*"TEST-"}"
class="${class##*"."}"
# Extract the inner class name if there's a "$"
if [[ "$class" == *"$"* ]]; then
class="${class##*"$"}"
fi
class="${class##*"$"}" # remove inner class name if it exists
set +e # allow grep to fail
common_root=$(grep -rl "class $class\|static class $class" "$file_path" 2>/dev/null | head -n 1)
set -e
Expand All @@ -39,14 +36,19 @@ function get_source_file () {
while [[ $line != "$common_root"* ]]; do
common_root=$(dirname "$common_root")
if [[ "$common_root" == "$common_root/.." ]] || [[ "$common_root" == "/" ]]; then
common_root=""
break
fi
done
done < <(grep -rl "class $class\|static class $class" "$file_path" 2>/dev/null)

if [[ -n "$common_root" ]] && [[ "$common_root" != "/" ]]; then
if [[ -n "$common_root" && "$common_root" != "/" ]]; then
file_path="/$common_root"
else
file_path="UNKNOWN"
fi
else
file_path="UNKNOWN"
fi
fi
}
Expand Down