This repository was archived by the owner on Apr 12, 2019. It is now read-only.
forked from gogs/git-module
-
Notifications
You must be signed in to change notification settings - Fork 38
Accept git 1.7.2 as the minimum version #90
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
355714a
Add an head ref for the sake of using self repo for testing
strk 20222c4
Add test for CommitCount
strk 3c11853
Add test for GetLatestCommitTime
strk 67a38f3
Add testing with git-1.7.2
strk 70bc2a3
Accept git 1.7.2 as the minimum version
strk 1765479
Reduce output from drone, add comments
strk 0a4f451
Interrupt step upon first failure
strk ca88fdf
Add Dockerfile for use with ci
strk 30239f0
Use ad-hoc docker image for testing git-1.7.2
strk 5ff1be1
Avoid running build/vet/clean twice
strk 9c1fd83
Set HEAD ref also in testing-1-7 step
strk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
---|---|---|
|
@@ -10,15 +10,26 @@ clone: | |
tags: true | ||
|
||
pipeline: | ||
testing: | ||
test-general: | ||
image: webhippie/golang:edge | ||
pull: true | ||
commands: | ||
- make clean | ||
- make vet | ||
- make lint | ||
- make test | ||
- make build | ||
testing-git-latest: | ||
image: webhippie/golang:edge | ||
pull: true | ||
commands: | ||
- git update-ref refs/heads/test HEAD | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why update-ref is needed? |
||
- git --version && make test | ||
testing-git-1.7: | ||
image: docker.kbt.io/gitea-git-ci:1.7 | ||
pull: true | ||
commands: | ||
- git update-ref refs/heads/test HEAD | ||
- PATH=/opt/git-1.7.2/bin git --version && make test | ||
|
||
# coverage: | ||
# image: plugins/coverage:1 | ||
|
This file contains hidden or 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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Copyright 2017 The Gitea Authors. All rights reserved. | ||
// Use of this source code is governed by a MIT-style | ||
// license that can be found in the LICENSE file. | ||
|
||
package git | ||
|
||
import ( | ||
"testing" | ||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestCommitsCount(t *testing.T) { | ||
commitsCount, _ := CommitsCount(".", "d86a90f801dbe279db095437a8c7ea42c60e8d98") | ||
assert.Equal(t, int64(3), commitsCount) | ||
} |
This file contains hidden or 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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
FROM webhippie/golang:edge | ||
RUN apk add --update autoconf zlib-dev > /dev/null && \ | ||
mkdir build && \ | ||
curl -sL "https://github.com/git/git/archive/v1.7.2.tar.gz" -o git.tar.gz && \ | ||
tar -C build -xzf git.tar.gz && \ | ||
cd build/git-1.7.2 && \ | ||
{ autoconf 2> err || { cat err && false; } } && \ | ||
./configure --without-tcltk --prefix=/opt/git-1.7.2 > /dev/null && \ | ||
{ make install NO_PERL=please > /dev/null 2> err || { cat err && false; } } && \ | ||
cd ../.. && \ | ||
rm -rf build git.tar.gz \ |
This file contains hidden or 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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
git-1.7: | ||
docker build -t gitea/ci:git-1.7 -f Dockerfile-git-1.7 . |
This file contains hidden or 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 hidden or 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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Copyright 2017 The Gitea Authors. All rights reserved. | ||
// Use of this source code is governed by a MIT-style | ||
// license that can be found in the LICENSE file. | ||
|
||
package git | ||
|
||
import ( | ||
"testing" | ||
"time" | ||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestGetLatestCommitTime(t *testing.T) { | ||
lct, err := GetLatestCommitTime(".") | ||
assert.NoError(t, err) | ||
// Time is in the past | ||
now := time.Now() | ||
assert.True(t, lct.Unix() < now.Unix(), "%d not smaller than %d", lct, now) | ||
// Time is after Mon Oct 23 03:52:09 2017 +0300 | ||
// which is the time of commit | ||
// d47b98c44c9a6472e44ab80efe65235e11c6da2a | ||
refTime, err := time.Parse("Mon Jan 02 15:04:05 2006 -0700", "Mon Oct 23 03:52:09 2017 +0300") | ||
assert.NoError(t, err) | ||
assert.True(t, lct.Unix() > refTime.Unix(), "%d not greater than %d", lct, refTime) | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems this section is unnecessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you think so ? It is the section that tests with latest git version (2.something)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test-general section should be the latest git? So that a new section is unnecessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test-general does not run
make test
, only subsequent sections doThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it not run
make test
because you remove it. Pick it back and remove sectiontesting-git-latest
is OK.