mirror of
https://github.com/lukaszraczylo/semver-generator.git
synced 2026-06-10 23:28:58 +00:00
Use well tested logging sub-library.
This commit is contained in:
+6
-23
@@ -21,6 +21,7 @@ import (
|
||||
"testing"
|
||||
|
||||
git "github.com/go-git/go-git/v5"
|
||||
libpack_logging "github.com/lukaszraczylo/graphql-monitoring-proxy/logging"
|
||||
"github.com/lukaszraczylo/pandati"
|
||||
assertions "github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/suite"
|
||||
@@ -36,13 +37,17 @@ var (
|
||||
)
|
||||
|
||||
func (suite *Tests) SetupTest() {
|
||||
os.Chdir(testCurrentPath)
|
||||
err := os.Chdir(testCurrentPath)
|
||||
if err != nil {
|
||||
logger.Critical("main", map[string]interface{}{"error": err.Error(), "message": "Unable to change directory to test directory"})
|
||||
}
|
||||
assert = assertions.New(suite.T())
|
||||
params.varDebug = true
|
||||
params.varRepoBranch = "main"
|
||||
}
|
||||
|
||||
func TestSuite(t *testing.T) {
|
||||
logger = libpack_logging.NewLogger()
|
||||
testCurrentPath, _ = os.Getwd()
|
||||
suite.Run(t, new(Tests))
|
||||
}
|
||||
@@ -467,28 +472,6 @@ func (suite *Tests) TestSetup_CalculateSemver() {
|
||||
}
|
||||
}
|
||||
|
||||
func (suite *Tests) Test_debugPrint() {
|
||||
type args struct {
|
||||
content string
|
||||
}
|
||||
tests := []struct {
|
||||
name string
|
||||
args args
|
||||
}{
|
||||
{
|
||||
name: "Test debug print",
|
||||
args: args{
|
||||
content: "Test debug",
|
||||
},
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
suite.T().Run(tt.name, func(t *testing.T) {
|
||||
debugPrint(tt.args.content)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func (suite *Tests) Test_main() {
|
||||
type vars struct {
|
||||
varRepoName string
|
||||
|
||||
Reference in New Issue
Block a user