Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(354)

Unified Diff: milo/appengine/swarming/buildLog_test.go

Issue 2902323002: Milo: Swarming module test coverage (Closed)
Patch Set: Remove vestage Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: milo/appengine/swarming/buildLog_test.go
diff --git a/milo/appengine/swarming/buildLog_test.go b/milo/appengine/swarming/buildLog_test.go
new file mode 100644
index 0000000000000000000000000000000000000000..5b09658f147a32678244bc7ef53e4f293abba6e5
--- /dev/null
+++ b/milo/appengine/swarming/buildLog_test.go
@@ -0,0 +1,35 @@
+package swarming
+
+import (
+ "context"
+ "strings"
+ "testing"
+ "time"
+
+ "github.com/luci/gae/impl/memory"
+ "github.com/luci/luci-go/common/clock/testclock"
+
+ . "github.com/smartystreets/goconvey/convey"
+)
+
+var testSvc = &debugSwarmingService{
+ tc: &testCase{
+ name: "build-patch-failure",
+ swarmResult: "build-patch-failure.swarm",
+ swarmOutput: "build-patch-failure",
+ },
+}
+
+func TestBuildLogs(t *testing.T) {
+ c := context.Background()
+ c, _ = testclock.UseTime(c, time.Date(2016, time.March, 14, 11, 0, 0, 0, time.UTC))
nodir 2017/06/08 14:39:12 any reason we are not using testclock.TestRecentTi
+ c = memory.UseWithAppID(c, "dev~luci-milo")
+ Convey(`Build log tests`, t, func() {
+ _, _, err := swarmingBuildLogImpl(c, testSvc, "12340", "/update_scripts/0/stdout")
+ So(err, ShouldBeNil)
+ })
+ Convey(`List available streams`, t, func() {
+ _, _, err := swarmingBuildLogImpl(c, testSvc, "12340", "/notexist")
+ So(strings.HasPrefix(err.Error(), "stream \"steps/notexist\" not found"), ShouldEqual, true)
+ })
+}

Powered by Google App Engine
This is Rietveld 408576698