Skip to content
This repository was archived by the owner on Aug 23, 2023. It is now read-only.

Commit e72b7e4

Browse files
committed
make tests for OrgIdPublic work
1 parent b25d02c commit e72b7e4

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

idx/cassandra/cassandra_test.go

+5
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,9 @@ func getMetricData(orgId, depth, count, interval int, prefix string) []*schema.M
122122
}
123123

124124
func TestGetAddKey(t *testing.T) {
125+
idx.OrgIdPublic = 100
126+
defer func() { idx.OrgIdPublic = 0 }()
127+
125128
ix := New()
126129
initForTests(ix)
127130

@@ -256,6 +259,8 @@ func TestAddToWriteQueue(t *testing.T) {
256259
}
257260

258261
func TestFind(t *testing.T) {
262+
idx.OrgIdPublic = 100
263+
defer func() { idx.OrgIdPublic = 0 }()
259264
ix := New()
260265
initForTests(ix)
261266
for _, s := range getMetricData(idx.OrgIdPublic, 2, 5, 10, "metric.demo") {

idx/memory/memory_test.go

+12
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ func TestGetAddKey(t *testing.T) {
8383
}
8484

8585
func testGetAddKey(t *testing.T) {
86+
idx.OrgIdPublic = 100
87+
defer func() { idx.OrgIdPublic = 0 }()
88+
8689
ix := New()
8790
ix.Init()
8891

@@ -126,6 +129,9 @@ func TestFind(t *testing.T) {
126129
}
127130

128131
func testFind(t *testing.T) {
132+
idx.OrgIdPublic = 100
133+
defer func() { idx.OrgIdPublic = 0 }()
134+
129135
ix := New()
130136
ix.Init()
131137
for _, s := range getMetricData(idx.OrgIdPublic, 2, 5, 10, "metric.demo", false) {
@@ -253,6 +259,9 @@ func TestDelete(t *testing.T) {
253259
}
254260

255261
func testDelete(t *testing.T) {
262+
idx.OrgIdPublic = 100
263+
defer func() { idx.OrgIdPublic = 0 }()
264+
256265
ix := New()
257266
ix.Init()
258267

@@ -268,6 +277,9 @@ func testDelete(t *testing.T) {
268277
}
269278

270279
func TestDeleteTagged(t *testing.T) {
280+
idx.OrgIdPublic = 100
281+
defer func() { idx.OrgIdPublic = 0 }()
282+
271283
ix := New()
272284
ix.Init()
273285

0 commit comments

Comments
 (0)