Skip to content

Commit

Permalink
Update uploadJunitXml
Browse files Browse the repository at this point in the history
  • Loading branch information
bootstraponline committed Nov 16, 2018
1 parent bb2ac62 commit beb95a8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions test_runner/src/main/kotlin/ftl/gc/GcStorage.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,6 @@ object ReportManager {

newTestResult.mergeTestTimes(oldTestResult)

GcStorage.uploadJunitXml(newTestResult.xmlToString(), args)
GcStorage.uploadJunitXml(newTestResult, args)
}
}

0 comments on commit beb95a8

Please sign in to comment.