Skip to content

Commit

Permalink
Fix uploading logic
Browse files Browse the repository at this point in the history
  • Loading branch information
bootstraponline committed Nov 16, 2018
1 parent 7844101 commit bb2ac62
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions test_runner/src/main/kotlin/ftl/gc/GcStorage.kt
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,8 @@ object GcStorage {
runGcsPath = runGcsPath
)

fun uploadJunitXml(localJunitXml: String, args: IArgs) {
fun uploadJunitXml(xmlData: String, args: IArgs) {
if (args.junitGcsPath.isEmpty()) return
if (File(localJunitXml).exists().not()) return

// bucket/path/to/object
val rawPath = args.junitGcsPath.drop(GCS_PREFIX.length)
Expand All @@ -53,7 +52,7 @@ object GcStorage {
val fileBlob = BlobInfo.newBuilder(bucket, name).build()

try {
storage.create(fileBlob, Files.readAllBytes(Paths.get(localJunitXml)))
storage.create(fileBlob, xmlData.toByteArray())
} catch (e: Exception) {
fatalError(e)
}
Expand Down

0 comments on commit bb2ac62

Please sign in to comment.