Skip to content

Commit

Permalink
feat(conformance): adapt pipeline API tests to KF environment (kubefl…
Browse files Browse the repository at this point in the history
  • Loading branch information
james-jwu authored and Jagadeesh J committed May 11, 2022
1 parent e453fe3 commit 9d1a6db
Showing 1 changed file with 27 additions and 3 deletions.
30 changes: 27 additions & 3 deletions backend/test/integration/pipeline_api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import (
type PipelineApiTest struct {
suite.Suite
namespace string
resourceNamespace string
pipelineClient *api_server.PipelineClient
pipelineUploadClient *api_server.PipelineUploadClient
}
Expand All @@ -47,13 +48,36 @@ func (s *PipelineApiTest) SetupTest() {
}
}
s.namespace = *namespace
clientConfig := test.GetClientConfig(*namespace)

var newPipelineUploadClient func() (*api_server.PipelineUploadClient, error)
var newPipelineClient func() (*api_server.PipelineClient, error)

if *isKubeflowMode {
s.resourceNamespace = *resourceNamespace

newPipelineUploadClient = func() (*api_server.PipelineUploadClient, error) {
return api_server.NewKubeflowInClusterPipelineUploadClient(s.namespace, *isDebugMode)
}
newPipelineClient = func() (*api_server.PipelineClient, error) {
return api_server.NewKubeflowInClusterPipelineClient(s.namespace, *isDebugMode)
}
} else {
clientConfig := test.GetClientConfig(*namespace)

newPipelineUploadClient = func() (*api_server.PipelineUploadClient, error) {
return api_server.NewPipelineUploadClient(clientConfig, *isDebugMode)
}
newPipelineClient = func() (*api_server.PipelineClient, error) {
return api_server.NewPipelineClient(clientConfig, *isDebugMode)
}
}

var err error
s.pipelineUploadClient, err = api_server.NewPipelineUploadClient(clientConfig, false)
s.pipelineUploadClient, err = newPipelineUploadClient()
if err != nil {
glog.Exitf("Failed to get pipeline upload client. Error: %s", err.Error())
}
s.pipelineClient, err = api_server.NewPipelineClient(clientConfig, false)
s.pipelineClient, err = newPipelineClient()
if err != nil {
glog.Exitf("Failed to get pipeline client. Error: %s", err.Error())
}
Expand Down

0 comments on commit 9d1a6db

Please sign in to comment.