diff --git a/test-report/src/main/java/io/opentelemetry/instrumentation/testreport/FlakyTestReporter.java b/test-report/src/main/java/io/opentelemetry/instrumentation/testreport/FlakyTestReporter.java index 00372618b465..0af2383ea5cf 100644 --- a/test-report/src/main/java/io/opentelemetry/instrumentation/testreport/FlakyTestReporter.java +++ b/test-report/src/main/java/io/opentelemetry/instrumentation/testreport/FlakyTestReporter.java @@ -277,7 +277,8 @@ private void report(String accessKey, String buildScanUrl, String jobUrl) throws row.add(flakyTest.testName); row.add(buildScanUrl); row.add(jobUrl); - row.add(flakyTest.message); + // there is a limit of 50000 characters in a single cell + row.add(abbreviate(flakyTest.message, 10000)); data.add(row); } @@ -291,6 +292,14 @@ private void report(String accessKey, String buildScanUrl, String jobUrl) throws .execute(); } + private static String abbreviate(String text, int maxLength) { + if (text.length() > maxLength) { + return text.substring(0, maxLength - 3) + "..."; + } + + return text; + } + public static void main(String... args) throws Exception { String path = System.getProperty("scanPath"); if (path == null) {