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

Unified Diff: cipd/client/cipd/client_test.go

Issue 2509803002: Add cipd selfupdate command. (Closed)
Patch Set: Add additional early-exit Created 4 years, 1 month 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
« no previous file with comments | « cipd/client/cipd/client.go ('k') | cipd/client/cipd/install_client.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cipd/client/cipd/client_test.go
diff --git a/cipd/client/cipd/client_test.go b/cipd/client/cipd/client_test.go
index 2261c636ee418d875b4ae35fe6c1f17efb7c73ab..6df3f3f4ca03a1cc8e8e4b2fc94ed7256577a814 100644
--- a/cipd/client/cipd/client_test.go
+++ b/cipd/client/cipd/client_test.go
@@ -24,6 +24,7 @@ import (
"github.com/luci/luci-go/common/logging/gologger"
"github.com/luci/luci-go/cipd/client/cipd/common"
+ "github.com/luci/luci-go/cipd/client/cipd/internal"
"github.com/luci/luci-go/cipd/client/cipd/local"
. "github.com/smartystreets/goconvey/convey"
@@ -527,6 +528,22 @@ func TestFetch(t *testing.T) {
})
}
+func TestMaybeUpdateClient(t *testing.T) {
+ ctx := makeTestContext()
+
+ Convey("MaybeUpdateClient", t, func() {
+
+ Convey("Is a NOOP when exeHash matches", func(c C) {
+ client := mockClient(c, "", nil)
+ client.tagCache = internal.NewTagCache(nil)
+ pin := common.Pin{clientPackage, "0000000000000000000000000000000000000000"}
+ So(client.tagCache.AddTag(ctx, pin, "git:deadbeef"), ShouldBeNil)
+ So(client.tagCache.AddFile(ctx, pin, clientFileName, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), ShouldBeNil)
+ So(client.MaybeUpdateClient(ctx, nil, "git:deadbeef", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "some_path"), ShouldBeNil)
+ })
+ })
+}
+
func TestProcessEnsureFile(t *testing.T) {
ctx := makeTestContext()
« no previous file with comments | « cipd/client/cipd/client.go ('k') | cipd/client/cipd/install_client.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698