Skip to content

Commit

Permalink
feat(ci): Fix JUnit test case name uniqueness (#8046)
Browse files Browse the repository at this point in the history
  • Loading branch information
PerfectSlayer authored Dec 3, 2024
1 parent a9708ea commit 64347d6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .circleci/collect_results.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@ do
cp "$RESULT_XML_FILE" "$TEST_RESULTS_DIR/$AGGREGATED_FILE_NAME"
# Replace Java Object hashCode by marker in testcase XML nodes to get stable test names
sed -i '/<testcase/ s/@[0-9a-f]\{5,\}/@HASHCODE/g' "$TEST_RESULTS_DIR/$AGGREGATED_FILE_NAME"
# Replace random port numbers by marker in testcase XML nodes to get stable test names
sed -i '/<testcase/ s/localhost:[0-9]\{2,5\}/localhost:PORT/g' "$TEST_RESULTS_DIR/$AGGREGATED_FILE_NAME"
if cmp -s "$RESULT_XML_FILE" "$TEST_RESULTS_DIR/$AGGREGATED_FILE_NAME"; then
echo ""
else
echo " (hashCode replaced)"
echo -n " (non-stable test names detected)"
fi
done < <(find "${TEST_RESULT_DIRS[@]}" -name \*.xml -print0)

0 comments on commit 64347d6

Please sign in to comment.