Skip to content

Commit

Permalink
Merge pull request #2 from PackagrIO/configfile
Browse files Browse the repository at this point in the history
  • Loading branch information
AnalogJ authored Mar 17, 2022
2 parents ed9763b + c66d762 commit 51710ea
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pkg/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
)

func TestConfiguration_init_ShouldCorrectlyInitializeConfiguration(t *testing.T) {
t.Parallel()

//setup
defer utils.UnsetEnv("PACKAGR_")()
Expand Down Expand Up @@ -40,6 +39,7 @@ func TestConfiguration_init_EnvVariablesShouldLoadProperly(t *testing.T) {

func TestConfiguration_ReadConfig(t *testing.T) {
//setup
defer utils.UnsetEnv("PACKAGR_")()
testConfig, _ := config.Create()
testConfig.SetDefault(config.PACKAGR_PACKAGE_TYPE, "generic")
testConfig.SetDefault(config.PACKAGR_SCM, "default")
Expand Down
3 changes: 2 additions & 1 deletion pkg/engine/engine_chef_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"
"io/ioutil"
"net/http"
"path"
//"path/filepath"
"github.com/packagrio/bumpr/pkg/config/mock"
Expand All @@ -30,7 +31,7 @@ func TestEngineChef_Create(t *testing.T) {
testConfig.Set(config.PACKAGR_SCM, "github")
testConfig.Set(config.PACKAGR_PACKAGE_TYPE, "chef")
pipelineData := new(pipeline.Data)
githubScm, err := scm.Create("github", pipelineData, testConfig, nil)
githubScm, err := scm.Create("github", pipelineData, testConfig, &http.Client{})
require.NoError(t, err)

//test
Expand Down
3 changes: 2 additions & 1 deletion pkg/engine/engine_golang_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"
"io/ioutil"
"net/http"
"path"
//"path/filepath"
"github.com/packagrio/bumpr/pkg/config/mock"
Expand All @@ -30,7 +31,7 @@ func TestEngineGolang_Create(t *testing.T) {
testConfig.Set(config.PACKAGR_SCM, "github")
testConfig.Set(config.PACKAGR_PACKAGE_TYPE, "golang")
pipelineData := new(pipeline.Data)
githubScm, err := scm.Create("github", pipelineData, testConfig, nil)
githubScm, err := scm.Create("github", pipelineData, testConfig, &http.Client{})
require.NoError(t, err)

//test
Expand Down
3 changes: 2 additions & 1 deletion pkg/engine/engine_node_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"
"io/ioutil"
"net/http"
"path"
//"path/filepath"
"github.com/packagrio/bumpr/pkg/config/mock"
Expand All @@ -30,7 +31,7 @@ func TestEngineNode_Create(t *testing.T) {
testConfig.Set(config.PACKAGR_SCM, "github")
testConfig.Set(config.PACKAGR_PACKAGE_TYPE, "node")
pipelineData := new(pipeline.Data)
githubScm, err := scm.Create("github", pipelineData, testConfig, nil)
githubScm, err := scm.Create("github", pipelineData, testConfig, &http.Client{})
require.NoError(t, err)

//test
Expand Down
3 changes: 2 additions & 1 deletion pkg/engine/engine_python_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"
"io/ioutil"
"net/http"
"path"
//"path/filepath"
"github.com/packagrio/bumpr/pkg/config/mock"
Expand All @@ -30,7 +31,7 @@ func TestEnginePython_Create(t *testing.T) {
testConfig.Set(config.PACKAGR_SCM, "github")
testConfig.Set(config.PACKAGR_PACKAGE_TYPE, "python")
pipelineData := new(pipeline.Data)
githubScm, err := scm.Create("github", pipelineData, testConfig, nil)
githubScm, err := scm.Create("github", pipelineData, testConfig, &http.Client{})
require.NoError(t, err)

//test
Expand Down
3 changes: 2 additions & 1 deletion pkg/engine/engine_ruby_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"
"io/ioutil"
"net/http"
"path"
//"path/filepath"
"github.com/packagrio/bumpr/pkg/config/mock"
Expand All @@ -30,7 +31,7 @@ func TestEngineRuby_Create(t *testing.T) {
testConfig.Set(config.PACKAGR_SCM, "github")
testConfig.Set(config.PACKAGR_PACKAGE_TYPE, "ruby")
pipelineData := new(pipeline.Data)
githubScm, err := scm.Create("github", pipelineData, testConfig, nil)
githubScm, err := scm.Create("github", pipelineData, testConfig, &http.Client{})
require.NoError(t, err)

//test
Expand Down
3 changes: 2 additions & 1 deletion pkg/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/packagrio/go-common/pipeline"
"github.com/packagrio/go-common/scm"
"log"
"net/http"
"os"
"path"
"path/filepath"
Expand Down Expand Up @@ -36,7 +37,7 @@ func (p *Pipeline) Start(configData config.Interface) error {
return err
}

sourceScm, err := scm.Create(p.Config.GetString(config.PACKAGR_SCM), p.Data, p.Config, nil)
sourceScm, err := scm.Create(p.Config.GetString(config.PACKAGR_SCM), p.Data, p.Config, &http.Client{})
if err != nil {
fmt.Printf("FATAL: %+v\n", err)
os.Exit(1)
Expand Down

0 comments on commit 51710ea

Please sign in to comment.