From beb95a8cbc01c77ddc658d369bef7cbde9adad1a Mon Sep 17 00:00:00 2001 From: bootstraponline Date: Fri, 16 Nov 2018 14:47:59 -0500 Subject: [PATCH] Update uploadJunitXml --- test_runner/src/main/kotlin/ftl/gc/GcStorage.kt | 6 ++++-- .../src/main/kotlin/ftl/reports/util/ReportManager.kt | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/test_runner/src/main/kotlin/ftl/gc/GcStorage.kt b/test_runner/src/main/kotlin/ftl/gc/GcStorage.kt index d204c63105..ec9924ccdf 100644 --- a/test_runner/src/main/kotlin/ftl/gc/GcStorage.kt +++ b/test_runner/src/main/kotlin/ftl/gc/GcStorage.kt @@ -9,6 +9,8 @@ import ftl.args.IArgs import ftl.args.IosArgs import ftl.config.FtlConstants import ftl.config.FtlConstants.GCS_PREFIX +import ftl.reports.xml.model.JUnitTestResult +import ftl.reports.xml.xmlToString import ftl.util.Utils.fatalError import ftl.util.Utils.join import java.io.File @@ -41,7 +43,7 @@ object GcStorage { runGcsPath = runGcsPath ) - fun uploadJunitXml(xmlData: String, args: IArgs) { + fun uploadJunitXml(testResult: JUnitTestResult, args: IArgs) { if (args.junitGcsPath.isEmpty()) return // bucket/path/to/object @@ -52,7 +54,7 @@ object GcStorage { val fileBlob = BlobInfo.newBuilder(bucket, name).build() try { - storage.create(fileBlob, xmlData.toByteArray()) + storage.create(fileBlob, testResult.xmlToString().toByteArray()) } catch (e: Exception) { fatalError(e) } diff --git a/test_runner/src/main/kotlin/ftl/reports/util/ReportManager.kt b/test_runner/src/main/kotlin/ftl/reports/util/ReportManager.kt index faa651787b..cdf05f378c 100644 --- a/test_runner/src/main/kotlin/ftl/reports/util/ReportManager.kt +++ b/test_runner/src/main/kotlin/ftl/reports/util/ReportManager.kt @@ -105,6 +105,6 @@ object ReportManager { newTestResult.mergeTestTimes(oldTestResult) - GcStorage.uploadJunitXml(newTestResult.xmlToString(), args) + GcStorage.uploadJunitXml(newTestResult, args) } }