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

Unified Diff: server/logdog/storage/bigtable/rowKey_test.go

Issue 1909943003: LogDog: Add project support to Storage. (Closed) Base URL: https://github.com/luci/luci-go@logdog-project-coordinator-services
Patch Set: Rebase? Created 4 years, 8 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
« no previous file with comments | « server/logdog/storage/bigtable/rowKey.go ('k') | server/logdog/storage/bigtable/storage.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: server/logdog/storage/bigtable/rowKey_test.go
diff --git a/server/logdog/storage/bigtable/rowKey_test.go b/server/logdog/storage/bigtable/rowKey_test.go
index 2ba96413f0311cc87d9e45ad5e12fd01687b0308..92f5f86f00eafac2fad6a7096188f86ee18faa8a 100644
--- a/server/logdog/storage/bigtable/rowKey_test.go
+++ b/server/logdog/storage/bigtable/rowKey_test.go
@@ -15,22 +15,29 @@ import (
func TestRowKey(t *testing.T) {
t.Parallel()
- Convey(`A row key, constructed from "a/b/+/c/d"`, t, func() {
+ Convey(`A row key, constructed from "test-project" and "a/b/+/c/d"`, t, func() {
+ project := "test-project"
path := "a/b/+/c/d"
- rk := newRowKey(path, 1337, 42)
+
+ rk := newRowKey(project, path, 1337, 42)
Convey(`Shares a path with a row key from the same Path.`, func() {
- So(rk.sharesPathWith(newRowKey(path, 2468, 0)), ShouldBeTrue)
+ So(rk.sharesPathWith(newRowKey(project, path, 2468, 0)), ShouldBeTrue)
})
- for _, v := range []string{
- "a/b/+/c",
- "asdf",
+ for _, project := range []string{
"",
+ "other-test-project",
} {
- Convey(fmt.Sprintf(`Does not share a path with: %q`, v), func() {
- So(rk.sharesPathWith(newRowKey(v, 0, 0)), ShouldBeFalse)
- })
+ for _, path := range []string{
+ "a/b/+/c",
+ "asdf",
+ "",
+ } {
+ Convey(fmt.Sprintf(`Does not share a path with project %q, path %q`, project, path), func() {
+ So(rk.sharesPathWith(newRowKey(project, path, 0, 0)), ShouldBeFalse)
+ })
+ }
}
Convey(`Can be encoded, then decoded into its fields.`, func() {
@@ -58,7 +65,7 @@ func TestRowKey(t *testing.T) {
1337,
} {
Convey(fmt.Sprintf(`Row key %d should be ascendingly sorted and parsable.`, i), func() {
- rk := newRowKey("test", i, i)
+ rk := newRowKey("test-project", "test", i, i)
// Test that it encodes/decodes back to identity.
enc := rk.encode()
« no previous file with comments | « server/logdog/storage/bigtable/rowKey.go ('k') | server/logdog/storage/bigtable/storage.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698