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

working on tests. #2

Merged
merged 2 commits into from
Mar 17, 2022
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
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