Skip to content

Commit

Permalink
[CI] Fix lint error (require-error) (#2931)
Browse files Browse the repository at this point in the history
Signed-off-by: Chi-Sheng Liu <chishengliu@chishengliu.com>
  • Loading branch information
MortalHappiness authored Feb 6, 2025
1 parent beeb992 commit 0ac9942
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions kubectl-plugin/pkg/cmd/version/version_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (

"github.com/ray-project/kuberay/kubectl-plugin/pkg/util"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"k8s.io/cli-runtime/pkg/genericclioptions"
"k8s.io/client-go/kubernetes"
cmdtesting "k8s.io/kubectl/pkg/cmd/testing"
Expand All @@ -20,10 +21,10 @@ func TestRayVersionCheckContext(t *testing.T) {
testContext := "test-context"

kubeConfigWithCurrentContext, err := util.CreateTempKubeConfigFile(t, "my-fake-context")
assert.NoError(t, err)
require.NoError(t, err)

kubeConfigWithoutCurrentContext, err := util.CreateTempKubeConfigFile(t, "")
assert.NoError(t, err)
require.NoError(t, err)

tests := []struct {
name string
Expand Down Expand Up @@ -76,7 +77,7 @@ func TestRayVersionCheckContext(t *testing.T) {
if tc.expectError != "" {
assert.Equal(t, tc.expectError, err.Error())
} else {
assert.NoError(t, err)
require.NoError(t, err)
}
})
}
Expand Down Expand Up @@ -147,7 +148,7 @@ func TestRayVersionRun(t *testing.T) {

var buf bytes.Buffer
err := fakeVersionOptions.Run(context.Background(), fClient, &buf)
assert.NoError(t, err)
require.NoError(t, err)

assert.Equal(t, tc.expected, buf.String())
})
Expand Down

0 comments on commit 0ac9942

Please sign in to comment.