Skip to content

Commit c73ed15

Browse files
endpoint test parseablehq#1
1 parent d8de52f commit c73ed15

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed

quest_test.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,11 +409,23 @@ func TestSmokeGetRetention(t *testing.T) {
409409
DeleteStream(t, NewGlob.QueryClient, NewGlob.Stream)
410410
}
411411

412+
func TestActivateHotTier(t *testing.T) {
413+
activateHotTier(t)
414+
}
415+
412416
func TestHotTierGetsLogs(t *testing.T) {
413417
// create stream, put hot tier, ingest data for a duration, wait for 2-3 mins to see if all data is available in hot tier
418+
if NewGlob.IngestorUrl.String() == "" {
419+
t.Skip("Skipping in standalone mode")
420+
}
414421
}
415422

423+
// create stream, ingest data for a duration, set hot tier, wait for 2-3 mins to see if all data is available in hot tier
416424
func TestHotTierGetsLogsAfter(t *testing.T) {
425+
if NewGlob.IngestorUrl.String() == "" {
426+
t.Skip("Skipping in standalone mode")
427+
}
428+
417429
logs := createAndIngest(t)
418430

419431
activateHotTier(t)
@@ -443,6 +455,10 @@ func TestHotTierGetsLogsAfter(t *testing.T) {
443455

444456
// create stream, ingest data, query get count, set hot tier, wait for 2-3 mins, query again get count, both counts should match
445457
func TestHotTierLogCount(t *testing.T) {
458+
if NewGlob.IngestorUrl.String() == "" {
459+
t.Skip("Skipping in standalone mode")
460+
}
461+
446462
createAndIngest(t)
447463
countBefore := QueryLogStreamCount(t, NewGlob.QueryClient, NewGlob.Stream, 50)
448464

@@ -455,6 +471,9 @@ func TestHotTierLogCount(t *testing.T) {
455471

456472
func TestOldestHotTierEntry(t *testing.T) {
457473
// create stream, ingest data for a duration, call GET /logstream/{logstream}/info - to get the first_event_at field then set hot tier, wait for 2-3 mins, call GET /hottier - to get oldest entry in hot tier then match both
474+
if NewGlob.IngestorUrl.String() == "" {
475+
t.Skip("Skipping in standalone mode")
476+
}
458477
}
459478

460479
// This test calls all the User API endpoints

test_utils.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -567,8 +567,14 @@ func activateHotTier(t *testing.T) {
567567
req, _ := NewGlob.QueryClient.NewRequest("PUT", "logstream/"+NewGlob.Stream+"/hottier", nil)
568568
response, err := NewGlob.QueryClient.Do(req)
569569
body := readAsString(response.Body)
570-
require.Equalf(t, 200, response.StatusCode, "Server returned http code: %s and response: %s", response.Status, body)
571-
require.NoErrorf(t, err, "Activating hot tier failed: %s", err)
570+
571+
if NewGlob.IngestorUrl.String() != "" {
572+
require.Equalf(t, 200, response.StatusCode, "Server returned unexpected http code: %s and response: %s", response.Status, body)
573+
require.NoErrorf(t, err, "Activating hot tier failed in distributed mode: %s", err)
574+
} else {
575+
// right now, hot tier is unavailable in standalone so anything other than 200 is fine
576+
require.NotEqualf(t, 200, response.StatusCode, "Hot tier has been activated in standalone mode: %s and response: %s", response.Status, body)
577+
}
572578
}
573579

574580
func disableHotTier(t *testing.T) {

0 commit comments

Comments
 (0)