Skip to content

Commit

Permalink
feat(conformance): adapt pipeline version API tests to run in KF (kub…
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 6dc3c1c commit 01af152
Showing 1 changed file with 27 additions and 3 deletions.
30 changes: 27 additions & 3 deletions backend/test/integration/pipeline_version_api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
// - Providing tarball file url
type PipelineVersionApiTest struct {
suite.Suite
namespace string
pipelineClient *api_server.PipelineClient
pipelineUploadClient *api_server.PipelineUploadClient
}
Expand All @@ -42,13 +43,36 @@ func (s *PipelineVersionApiTest) SetupTest() {
glog.Exitf("Failed to initialize test. Error: %s", err.Error())
}
}
clientConfig := test.GetClientConfig(*namespace)

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

if *isKubeflowMode {
s.namespace = *namespace

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 01af152

Please sign in to comment.