Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes to time and custom partition tests #97

Merged
merged 1 commit into from
Feb 23, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 1 addition & 97 deletions quest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -658,55 +658,6 @@ func TestLoadStreamBatchWithCustomPartitionWithK6(t *testing.T) {
DeleteStream(t, NewGlob.QueryClient, customPartitionStream)
}

func TestLoadStreamBatchWithTimePartitionWithK6(t *testing.T) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is passing, why remove this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is another test with a different name - TestLoadHistoricalStreamBatchWithK6, so removed this one

if NewGlob.Mode == "load" {
customPartitionStream := NewGlob.Stream + "timepartition"
customHeader := map[string]string{"X-P-Time-Partition": "source_time"}
CreateStreamWithHeader(t, NewGlob.QueryClient, customPartitionStream, customHeader)
if NewGlob.IngestorUrl.String() == "" {
cmd := exec.Command("k6",
"run",
"-e", fmt.Sprintf("P_URL=%s", NewGlob.QueryUrl.String()),
"-e", fmt.Sprintf("P_USERNAME=%s", NewGlob.QueryUsername),
"-e", fmt.Sprintf("P_PASSWORD=%s", NewGlob.QueryPassword),
"-e", fmt.Sprintf("P_STREAM=%s", customPartitionStream),
"-e", fmt.Sprintf("P_SCHEMA_COUNT=%s", schema_count),
"-e", fmt.Sprintf("P_EVENTS_COUNT=%s", events_count),
"./scripts/load_historical_batch_events.js",
"--vus=", vus,
"--duration=", duration)

cmd.Run()
op, err := cmd.Output()
if err != nil {
t.Log(err)
}
t.Log(string(op))
} else {
cmd := exec.Command("k6",
"run",
"-e", fmt.Sprintf("P_URL=%s", NewGlob.IngestorUrl.String()),
"-e", fmt.Sprintf("P_USERNAME=%s", NewGlob.IngestorUsername),
"-e", fmt.Sprintf("P_PASSWORD=%s", NewGlob.IngestorPassword),
"-e", fmt.Sprintf("P_STREAM=%s", customPartitionStream),
"-e", fmt.Sprintf("P_SCHEMA_COUNT=%s", schema_count),
"-e", fmt.Sprintf("P_EVENTS_COUNT=%s", events_count),
"./scripts/load_historical_batch_events.js",
"--vus=", vus,
"--duration=", duration)

cmd.Run()
op, err := cmd.Output()
if err != nil {
t.Log(err)
}
t.Log(string(op))
}

DeleteStream(t, NewGlob.QueryClient, customPartitionStream)
}
}

func TestLoadStreamNoBatchWithK6(t *testing.T) {
if NewGlob.Mode == "load" {
CreateStream(t, NewGlob.QueryClient, NewGlob.Stream)
Expand Down Expand Up @@ -800,7 +751,7 @@ func TestLoadHistoricalStreamNoBatchWithK6(t *testing.T) {

func TestLoadStreamNoBatchWithCustomPartitionWithK6(t *testing.T) {
customPartitionStream := NewGlob.Stream + "custompartition"
customHeader := map[string]string{"X-P-Custom-Partition": "level,os"}
customHeader := map[string]string{"X-P-Custom-Partition": "level"}
CreateStreamWithHeader(t, NewGlob.QueryClient, customPartitionStream, customHeader)
if NewGlob.IngestorUrl.String() == "" {
cmd := exec.Command("k6",
Expand Down Expand Up @@ -843,53 +794,6 @@ func TestLoadStreamNoBatchWithCustomPartitionWithK6(t *testing.T) {
DeleteStream(t, NewGlob.QueryClient, customPartitionStream)
}

func TestLoadStreamNoBatchWithTimeAndCustomPartitionWithK6(t *testing.T) {
if NewGlob.Mode == "load" {
customPartitionStream := NewGlob.Stream + "timeandcustompartition"
customHeader := map[string]string{"X-P-Custom-Partition": "level,os", "X-P-Time-Partition": "source_time"}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we switch to customPartition only here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is one - TestLoadStreamNoBatchWithCustomPartitionWithK6

CreateStreamWithHeader(t, NewGlob.QueryClient, customPartitionStream, customHeader)
if NewGlob.IngestorUrl.String() == "" {
cmd := exec.Command("k6",
"run",
"-e", fmt.Sprintf("P_URL=%s", NewGlob.QueryUrl.String()),
"-e", fmt.Sprintf("P_USERNAME=%s", NewGlob.QueryUsername),
"-e", fmt.Sprintf("P_PASSWORD=%s", NewGlob.QueryPassword),
"-e", fmt.Sprintf("P_STREAM=%s", customPartitionStream),
"-e", fmt.Sprintf("P_SCHEMA_COUNT=%s", schema_count),
"./scripts/load_single_events.js",
"--vus=", vus,
"--duration=", duration)

cmd.Run()
op, err := cmd.Output()
if err != nil {
t.Log(err)
}
t.Log(string(op))
} else {
cmd := exec.Command("k6",
"run",
"-e", fmt.Sprintf("P_URL=%s", NewGlob.IngestorUrl.String()),
"-e", fmt.Sprintf("P_USERNAME=%s", NewGlob.IngestorUsername),
"-e", fmt.Sprintf("P_PASSWORD=%s", NewGlob.IngestorPassword),
"-e", fmt.Sprintf("P_STREAM=%s", customPartitionStream),
"-e", fmt.Sprintf("P_SCHEMA_COUNT=%s", schema_count),
"./scripts/load_single_events.js",
"--vus=", vus,
"--duration=", duration)

cmd.Run()
op, err := cmd.Output()
if err != nil {
t.Log(err)
}
t.Log(string(op))
}

DeleteStream(t, NewGlob.QueryClient, customPartitionStream)
}
}

func TestDeleteStream(t *testing.T) {
DeleteStream(t, NewGlob.QueryClient, NewGlob.Stream)
}