generated from fallion/go-template
-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: replace logger and debuglogger with apex/log
This should hopefully lead to a nicer UX and output. Closes #331
- Loading branch information
Showing
23 changed files
with
197 additions
and
184 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,29 @@ | ||
module github.com/aevea/commitsar | ||
|
||
go 1.13 | ||
go 1.16 | ||
|
||
require ( | ||
github.com/aevea/git/v2 v2.3.1 | ||
github.com/Microsoft/go-winio v0.4.16 // indirect | ||
github.com/aevea/git/v3 v3.0.0 | ||
github.com/aevea/integrations v0.5.0 | ||
github.com/aevea/magefiles v0.0.0-20200424121010-0004d5a7a2fe | ||
github.com/aevea/quoad v0.4.0 | ||
github.com/apex/log v1.9.0 | ||
github.com/go-git/go-git/v5 v5.2.0 | ||
github.com/go-openapi/strfmt v0.19.5 // indirect | ||
github.com/google/go-github/v32 v32.1.0 | ||
github.com/imdario/mergo v0.3.11 // indirect | ||
github.com/jedib0t/go-pretty v4.3.0+incompatible | ||
github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351 // indirect | ||
github.com/logrusorgru/aurora v2.0.3+incompatible | ||
github.com/magefile/mage v1.11.0 | ||
github.com/mattn/go-runewidth v0.0.9 // indirect | ||
github.com/spf13/cobra v1.1.3 | ||
github.com/spf13/viper v1.7.1 | ||
github.com/stretchr/testify v1.7.0 | ||
github.com/xanzy/ssh-agent v0.3.0 // indirect | ||
golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83 // indirect | ||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110 // indirect | ||
golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93 | ||
golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b // indirect | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,29 @@ | ||
package commitpipeline | ||
|
||
import ( | ||
"bytes" | ||
"log" | ||
"testing" | ||
|
||
history "github.com/aevea/git/v2" | ||
history "github.com/aevea/git/v3" | ||
"github.com/apex/log" | ||
"github.com/apex/log/handlers/memory" | ||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestLogBranch(t *testing.T) { | ||
var testString bytes.Buffer | ||
handler := memory.New() | ||
|
||
testLogger := log.Logger{} | ||
testLogger.SetOutput(&testString) | ||
log.SetHandler(handler) | ||
|
||
runner, err := New(&testLogger, nil, nil) | ||
runner, err := New(nil) | ||
|
||
assert.NoError(t, err) | ||
|
||
gitRepo, err := history.OpenGit("../../testdata/commits-on-master", nil) | ||
gitRepo, err := history.OpenGit("../../testdata/commits-on-master") | ||
|
||
assert.NoError(t, err) | ||
|
||
err = runner.logBranch(gitRepo) | ||
|
||
assert.NoError(t, err) | ||
assert.Equal(t, "Starting analysis of commits on branch refs/heads/master\n", testString.String()) | ||
assert.Equal(t, "Starting analysis of commits on branch refs/heads/master", handler.Entries[0].Message) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.