Skip to content

Commit

Permalink
Make jobName random (#5578)
Browse files Browse the repository at this point in the history
  • Loading branch information
DeepikaDixit authored and Ilya Kislenko committed May 6, 2019
1 parent 9d6843e commit d04bbd7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/kube/job_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
. "gopkg.in/check.v1"
batch "k8s.io/api/batch/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/rand"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/kubernetes/fake"
k8stesting "k8s.io/client-go/testing"
Expand All @@ -20,7 +21,8 @@ type JobSuite struct{}

var _ = Suite(&JobSuite{})

const testJobName = "kanister-test-job"
var testJobName = "kanister-test-job"

const testJobNamespace = "default"
const testJobImage = "busybox"
const testJobServiceAccount = "default"
Expand All @@ -29,6 +31,10 @@ func (s *JobSuite) SetUpSuite(c *C) {
// c.Skip("Too slow")
}

func (s *JobSuite) SetUpTest(c *C) {
testJobName = testJobName + rand.String(5)
}

// Verifies that the Job object is not created if the job name is not specified.
func (s *JobSuite) TestJobsNoName(c *C) {
clientset, err := NewClient()
Expand Down

0 comments on commit d04bbd7

Please sign in to comment.