Skip to content

Commit 64347d6

Browse files
feat(ci): Fix JUnit test case name uniqueness (#8046)
1 parent a9708ea commit 64347d6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

.circleci/collect_results.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,11 @@ do
2828
cp "$RESULT_XML_FILE" "$TEST_RESULTS_DIR/$AGGREGATED_FILE_NAME"
2929
# Replace Java Object hashCode by marker in testcase XML nodes to get stable test names
3030
sed -i '/<testcase/ s/@[0-9a-f]\{5,\}/@HASHCODE/g' "$TEST_RESULTS_DIR/$AGGREGATED_FILE_NAME"
31+
# Replace random port numbers by marker in testcase XML nodes to get stable test names
32+
sed -i '/<testcase/ s/localhost:[0-9]\{2,5\}/localhost:PORT/g' "$TEST_RESULTS_DIR/$AGGREGATED_FILE_NAME"
3133
if cmp -s "$RESULT_XML_FILE" "$TEST_RESULTS_DIR/$AGGREGATED_FILE_NAME"; then
3234
echo ""
3335
else
34-
echo " (hashCode replaced)"
36+
echo -n " (non-stable test names detected)"
3537
fi
3638
done < <(find "${TEST_RESULT_DIRS[@]}" -name \*.xml -print0)

0 commit comments

Comments
 (0)