Skip to content
This repository has been archived by the owner on Feb 20, 2020. It is now read-only.

Commit

Permalink
tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
petemoore committed Nov 29, 2017
1 parent 8ca4912 commit ee68dda
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,6 @@ generic-worker.config
directory-caches.json
file-caches.json
tasks-resolved-count.txt
coverage.tmp
coverage.report
/coverage.tmp
/coverage.report
/revision.txt
5 changes: 4 additions & 1 deletion build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ set /P lines=<..\tmp1.txt
:: this checks that if more than 0 lines are returned, we fail
if %lines% gtr 0 exit /b 64

git rev-parse HEAD > revision.txt
set /p REVISION=< revision.txt
del revision.txt
set GORACE=history_size=7
go test -v ./... || exit /b %ERRORLEVEL%
go test -ldflags "-X github.com/taskcluster/generic-worker.revision=%REVISION%" ./... || exit /b %ERRORLEVEL%
ineffassign . || exit /b %ERRORLEVEL%
4 changes: 2 additions & 2 deletions main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ func TestIdleWithoutCrash(t *testing.T) {
func TestRevisionNumberStored(t *testing.T) {
if !regexp.MustCompile("^[0-9a-f]{40}$").MatchString(revision) {
t.Fatalf("Git revision could not be determined - got '%v' but expected to match regular expression '^[0-9a-f](40)$'\n"+
"Did you specify `-ldflags \"-X main.revision=<SOME GIT REVISION>\"` in your go build/install/get command?\n"+
"Try using build.sh / build.cmd in root directory of generic-worker source code repository", revision)
"Did you specify `-ldflags \"-X github.com/taskcluster/generic-worker.revision=<GIT REVISION>\"` in your go test command?\n"+
"Try using build.sh / build.cmd in root directory of generic-worker source code repository.", revision)
}
t.Logf("Git revision successfully retrieved: %v", revision)
}

0 comments on commit ee68dda

Please sign in to comment.