Skip to content

Commit

Permalink
fix: Fix test cases
Browse files Browse the repository at this point in the history
Signed-off-by: Ce Gao <gaoce@caicloud.io>
  • Loading branch information
gaocegege committed Sep 19, 2019
1 parent e4ac147 commit 9036983
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 48 deletions.
36 changes: 0 additions & 36 deletions pkg/controller.v1alpha3/experiment/experiment_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,42 +168,6 @@ spec:
containers:
- name: tensorflow
image: kubeflow/tf-dist-mnist-test:1.0`, nil).AnyTimes()
generator.EXPECT().GetMetricsCollectorManifest(
gomock.Any(), gomock.Any(),
gomock.Any(), gomock.Any(),
gomock.Any(), gomock.Any()).Return(`apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: test
namespace: default
spec:
schedule: "*/1 * * * *"
successfulJobsHistoryLimit: 0
failedJobsHistoryLimit: 1
jobTemplate:
spec:
backoffLimit: 0
template:
spec:
serviceAccountName: metrics-collector
containers:
- name: test
image: katib/metrics-collector
args:
- "./metricscollector.v1alpha3"
- "-e"
- "teste"
- "-t"
- "test"
- "-k"
- "TFJob"
- "-n"
- "default"
- "-m"
- "test"
- "-mn"
- "test"
restartPolicy: Never`, nil).AnyTimes()

mgr, err := manager.New(cfg, manager.Options{})
g.Expect(err).NotTo(gomega.HaveOccurred())
Expand Down
12 changes: 0 additions & 12 deletions pkg/webhook/v1alpha3/experiment/validator/validator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,19 +97,7 @@ metadata:
name: "fake-trial"
namespace: fakens`

metricsCollectorTemplate := `apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: fake-trial
namespace: fakens
spec:
schedule: "*/1 * * * *"`

p.EXPECT().GetRunSpec(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return(trialJobTemplate, nil).AnyTimes()
p.EXPECT().GetMetricsCollectorManifest(
gomock.Any(), gomock.Any(), gomock.Any(),
gomock.Any(), gomock.Any(), gomock.Any()).
Return(metricsCollectorTemplate, nil).AnyTimes()
mc.EXPECT().PreCheckRegisterExperimentInDB(gomock.Any()).Return(
&api_pb.PreCheckRegisterExperimentReply{
CanRegister: true,
Expand Down

0 comments on commit 9036983

Please sign in to comment.