Skip to content
This repository was archived by the owner on Apr 12, 2019. It is now read-only.

Commit e8ae926

Browse files
bkcsoftlafriks
authored andcommitted
Fix blob test and drone git-pull (#82)
* use require * Fix drone * import testify/require * cleanup tree-entry benchmark
1 parent 878757c commit e8ae926

File tree

11 files changed

+844
-4
lines changed

11 files changed

+844
-4
lines changed

.drone.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ workspace:
55
clone:
66
git:
77
image: plugins/git:1
8-
depth: 50
8+
# Tests require the entire history (for some reason)
9+
#depth: 50
910
tags: true
1011

1112
pipeline:

blob_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"testing"
1111

1212
"github.com/stretchr/testify/assert"
13+
"github.com/stretchr/testify/require"
1314
)
1415

1516
var testBlob = &Blob{
@@ -42,7 +43,7 @@ THE SOFTWARE.`
4243

4344
r, err := testBlob.Data()
4445
assert.NoError(t, err)
45-
assert.NotNil(t, r)
46+
require.NotNil(t, r)
4647

4748
data, err := ioutil.ReadAll(r)
4849
assert.NoError(t, err)

tree_entry_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ func BenchmarkEntries_GetCommitsInfo(b *testing.B) {
3838
{url: "https://github.com/torvalds/linux.git", name: "linux"},
3939
}
4040
for _, benchmark := range benchmarks {
41-
b.StopTimer()
4241
var commit *Commit
4342
var entries Entries
4443
if repoPath, err := setupGitRepo(benchmark.url, benchmark.name); err != nil {
@@ -51,7 +50,7 @@ func BenchmarkEntries_GetCommitsInfo(b *testing.B) {
5150
b.Fatal(err)
5251
}
5352
entries.Sort()
54-
b.StartTimer()
53+
b.ResetTimer()
5554
b.Run(benchmark.name, func(b *testing.B) {
5655
for i := 0; i < b.N; i++ {
5756
_, err := entries.GetCommitsInfo(commit, "")

vendor/github.com/stretchr/testify/require/doc.go

Lines changed: 28 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/stretchr/testify/require/forward_requirements.go

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)