Skip to content

fix: automated tests #6300

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

Merged
merged 4 commits into from
Mar 31, 2025
Merged
Show file tree
Hide file tree
Changes from 2 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
17 changes: 0 additions & 17 deletions contrib/executor/k6/pkg/runner/runner_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
ctx := context.Background()

t.Run("Run k6 with simple script", func(t *testing.T) {
t.Parallel()

tempDir, err := os.MkdirTemp("", "*")
assert.NoErrorf(t, err, "failed to create temp dir: %v", err)
defer os.RemoveAll(tempDir)
Expand Down Expand Up @@ -53,8 +51,6 @@
})

t.Run("Run k6 with simple failing script", func(t *testing.T) {
t.Parallel()

tempDir, err := os.MkdirTemp("", "*")
assert.NoErrorf(t, err, "failed to create temp dir: %v", err)
defer os.RemoveAll(tempDir)
Expand All @@ -81,13 +77,11 @@

// then
assert.NoError(t, err)
assert.Equal(t, testkube.ExecutionStatusFailed, result.Status)

Check failure on line 80 in contrib/executor/k6/pkg/runner/runner_integration_test.go

View workflow job for this annotation

GitHub Actions / Integration Tests

runner_integration_test.go:80: Error Trace: /home/runner/work/testkube/testkube/contrib/executor/k6/pkg/runner/runner_integration_test.go:80 Error: Not equal: expected: (*testkube.ExecutionStatus)(0xc000066b30) actual : (*testkube.ExecutionStatus)(0xc000066b40) Diff: --- Expected +++ Actual @@ -1,2 +1,2 @@ -(*testkube.ExecutionStatus)((len=6) "failed") +(*testkube.ExecutionStatus)((len=6) "passed") Test: TestRunFiles_Integration/Run_k6_with_simple_failing_script ---
assert.Len(t, result.Steps, 1)
})

t.Run("Run k6 with arguments and simple script", func(t *testing.T) {
t.Parallel()

tempDir, err := os.MkdirTemp("", "*")
assert.NoErrorf(t, err, "failed to create temp dir: %v", err)
defer os.RemoveAll(tempDir)
Expand Down Expand Up @@ -123,8 +117,6 @@
})

t.Run("Run k6 with ENV variables and script", func(t *testing.T) {
t.Parallel()

tempDir, err := os.MkdirTemp("", "*")
assert.NoErrorf(t, err, "failed to create temp dir: %v", err)
defer os.RemoveAll(tempDir)
Expand Down Expand Up @@ -159,7 +151,6 @@

func TestRunAdvanced_Integration(t *testing.T) {
test.IntegrationTest(t)
t.Parallel()

ctx := context.Background()

Expand Down Expand Up @@ -197,8 +188,6 @@
})

t.Run("Run k6 with checks and thresholds", func(t *testing.T) {
t.Parallel()

tempDir, err := os.MkdirTemp("", "*")
assert.NoErrorf(t, err, "failed to create temp dir: %v", err)
defer os.RemoveAll(tempDir)
Expand Down Expand Up @@ -233,7 +222,6 @@

func TestRunDirs_Integtaion(t *testing.T) {
test.IntegrationTest(t)
t.Parallel()

ctx := context.Background()
// setup
Expand Down Expand Up @@ -292,7 +280,6 @@

func TestRunErrors_Integration(t *testing.T) {
test.IntegrationTest(t)
t.Parallel()

ctx := context.Background()

Expand Down Expand Up @@ -329,8 +316,6 @@
})

t.Run("Run k6 with invalid arguments", func(t *testing.T) {
t.Parallel()

tempDir, err := os.MkdirTemp("", "*")
assert.NoErrorf(t, err, "failed to create temp dir: %v", err)
defer os.RemoveAll(tempDir)
Expand Down Expand Up @@ -365,8 +350,6 @@
})

t.Run("Run k6 from directory with missing script arg", func(t *testing.T) {
t.Parallel()

tempDir, err := os.MkdirTemp("", "*")
assert.NoErrorf(t, err, "failed to create temp dir: %v", err)
defer os.RemoveAll(tempDir)
Expand Down
16 changes: 0 additions & 16 deletions pkg/diagnostics/validators/license/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,4 @@ func TestValidateLicense(t *testing.T) {
assert.NoError(t, err)
assert.False(t, resp.Valid)
})

t.Run("RealValidation license valid", func(t *testing.T) {
client := NewClient()

response, err := client.ValidateLicense(LicenseRequest{License: "AB24F3-405E39-C3F657-94D113-F06C13-V3"})
if err != nil {
t.Fatalf("Expected no error, got %v", err)
}

if !response.Valid {
t.Errorf("Expected license to be valid, got %v", response.Valid)
}
if response.Code != "VALID" {
t.Errorf("Expected message 'VALID', got %s", response.Code)
}
})
}
Loading