Skip to content

Commit

Permalink
Change name of TBPL log file to buildbot_text.
Browse files Browse the repository at this point in the history
  • Loading branch information
davehunt committed Apr 12, 2017
1 parent 7fb8469 commit 1cd9c44
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,26 @@ class SubmitToTreeherderTests extends BasePipelineTest {
assert !display.containsKey('groupName')
}

@Test
void getLogsReturnsListOfLinkMaps() {
helper.registerAllowedMethod('publishToS3', [String.class, String.class], {path, bucket ->
[[url:'linkURL', name:'linkName']]})
def script = loadScript('vars/submitToTreeherder.groovy')
def links = script.getLogs('foo')
assert links.size() == 1
assert links[0].url == 'linkURL'
assert links[0].name == 'linkName'
}

@Test
void tbplLogNameIsModified() {
helper.registerAllowedMethod('publishToS3', [String.class, String.class], {path, bucket ->
[[url:'linkURL', name:'my-tbpl-log']]})
def script = loadScript('vars/submitToTreeherder.groovy')
def links = script.getLogs('foo')
assert links.size() == 1
assert links[0].url == 'linkURL'
assert links[0].name == 'buildbot_text'
}

}
3 changes: 2 additions & 1 deletion vars/submitToTreeherder.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ def getLogs(logPath) {
if ( logPath != null ) {
logLinks = publishToS3(logPath, 'net-mozaws-stage-fx-test-treeherder')
for (link in logLinks) {
links.add([url: link.url, name: link.name])
name = link.name =~ 'tbpl' ? 'buildbot_text' : link.name
links.add([url: link.url, name: name])
}
}
return links
Expand Down

0 comments on commit 1cd9c44

Please sign in to comment.