move git and related functions from openshift. go into a separate file

This commit is contained in:
Abhishek
2017-08-11 15:19:06 +05:30
committed by Suraj Narwade
parent a9bffa6c6a
commit 683db1230d
3 changed files with 90 additions and 87 deletions
+4 -4
View File
@@ -150,7 +150,7 @@ func TestGetGitRemote(t *testing.T) {
for name, test := range testCases {
t.Log("Test case: ", name)
output, err = getGitCurrentRemoteURL(test.dir)
output, err = GetGitCurrentRemoteURL(test.dir)
if test.expectError {
if err == nil {
@@ -190,7 +190,7 @@ func TestGitGetCurrentBranch(t *testing.T) {
for name, test := range testCases {
t.Log("Test case: ", name)
output, err = getGitCurrentBranch(test.dir)
output, err = GetGitCurrentBranch(test.dir)
if test.expectError {
if err == nil {
@@ -263,7 +263,7 @@ func TestGetAbsBuildContext(t *testing.T) {
for name, test := range testCases {
t.Log("Test case: ", name)
output, err = getAbsBuildContext(test.context)
output, err = GetAbsBuildContext(test.context)
if test.expectError {
if err == nil {
@@ -331,7 +331,7 @@ func TestInitBuildConfig(t *testing.T) {
"Assert buildconfig source git Ref": {bc.Spec.CommonSpec.Source.Git.Ref, branch},
"Assert buildconfig source context dir": {bc.Spec.CommonSpec.Source.ContextDir, testDir + "/"},
// BuildConfig output image is named after service name. If image key is set than tag from that is used.
"Assert buildconfig output name": {bc.Spec.CommonSpec.Output.To.Name, serviceName + ":" + getImageTag(test.ServiceConfig.Image)},
"Assert buildconfig output name": {bc.Spec.CommonSpec.Output.To.Name, serviceName + ":" + GetImageTag(test.ServiceConfig.Image)},
"Assert buildconfig dockerfilepath": {bc.Spec.CommonSpec.Strategy.DockerStrategy.DockerfilePath, test.ServiceConfig.Dockerfile},
}