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

Delete modeldb from unit tests #391

Merged
merged 2 commits into from
Feb 20, 2019
Merged
Show file tree
Hide file tree
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
18 changes: 3 additions & 15 deletions cmd/manager/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@ import (

api "github.com/kubeflow/katib/pkg/api"
mockdb "github.com/kubeflow/katib/pkg/mock/db"
mockmodelstore "github.com/kubeflow/katib/pkg/mock/modelstore"
)

func TestCreateStudy(t *testing.T) {
ctrl := gomock.NewController(t)
defer ctrl.Finish()
mockDB := mockdb.NewMockVizierDBInterface(ctrl)
mockModelStore := mockmodelstore.NewMockModelStore(ctrl)
sid := "teststudy"
sc := &api.StudyConfig{
Name: "test",
Expand All @@ -27,16 +25,9 @@ func TestCreateStudy(t *testing.T) {
mockDB.EXPECT().CreateStudy(
sc,
).Return(sid, nil)
ssr := &api.SaveStudyRequest{
StudyName: "test",
Owner: "admin",
Description: "StudyID: " + sid,
}
mockModelStore.EXPECT().SaveStudy(ssr).Return(nil)

s := &server{
msIf: mockModelStore,
}
s := &server{}

req := &api.CreateStudyRequest{StudyConfig: sc}
ret, err := s.CreateStudy(context.Background(), req)
if err != nil {
Expand All @@ -50,11 +41,8 @@ func TestGetStudies(t *testing.T) {
ctrl := gomock.NewController(t)
defer ctrl.Finish()
mockDB := mockdb.NewMockVizierDBInterface(ctrl)
mockModelStore := mockmodelstore.NewMockModelStore(ctrl)
sid := []string{"teststudy1", "teststudy2"}
s := &server{
msIf: mockModelStore,
}
s := &server{}
dbIf = mockDB
sc := []*api.StudyConfig{
&api.StudyConfig{
Expand Down
3 changes: 1 addition & 2 deletions pkg/db/interface_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@ import (

_ "github.com/go-sql-driver/mysql"
"github.com/golang/protobuf/jsonpb"
"gopkg.in/DATA-DOG/go-sqlmock.v1"

api "github.com/kubeflow/katib/pkg/api"
sqlmock "gopkg.in/DATA-DOG/go-sqlmock.v1"
)

var dbInterface, mysqlInterface VizierDBInterface
Expand Down
2 changes: 1 addition & 1 deletion test/scripts/create-cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ echo "Creating GPU cluster"
gcloud --project ${PROJECT} beta container clusters create ${CLUSTER_NAME} \
--zone ${ZONE} \
--accelerator type=nvidia-tesla-k80,count=1 \
--cluster-version 1.10
--cluster-version 1.11
echo "Configuring kubectl"
gcloud --project ${PROJECT} container clusters get-credentials ${CLUSTER_NAME} \
--zone ${ZONE}