git icon indicating copy to clipboard operation
git copied to clipboard

Test Failures in Debian Build Environment

Open MTecknology opened this issue 7 years ago • 5 comments

I'm attempting to build this package for inclusion in Debian so that we can get closer to Gitea being in the Debian repos. I'm, however, having some troubles. During the build, one of the tests fail. I haven't been able to figure out why and my Golang skills are a bit lacking so I was hoping I could reach out for some help here.

The build is running in a pretty typical pbuilder environment and generating this error:

root@forge:/tmp/buildd/golang-code.gitea-git-0.0~git20170321.0.5b41327# go test -run TestBlob_Data
--- FAIL: TestBlob_Data (0.00s)
        Error Trace:    blob_test.go:44
        Error:          Received unexpected error exit status 128 - fatal: Not a git repository (or any of the parent directories): .git

        Error Trace:    blob_test.go:45
        Error:          Expected value not to be nil.

panic: runtime error: invalid memory address or nil pointer dereference [recovered]
        panic: runtime error: invalid memory address or nil pointer dereference [recovered]
        panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x4aade4] 

goroutine 18 [running]:
panic(0x658140, 0xc420010130)
        /usr/lib/go-1.7/src/runtime/panic.go:500 +0x1a1
testing.tRunner.func1(0xc4201840c0)
        /usr/lib/go-1.7/src/testing/testing.go:579 +0x25d
panic(0x658140, 0xc420010130)
        /usr/lib/go-1.7/src/runtime/panic.go:458 +0x243
io/ioutil.readAll.func1(0xc420045e90)
        /usr/lib/go-1.7/src/io/ioutil/ioutil.go:30 +0x13e
panic(0x658140, 0xc420010130)
        /usr/lib/go-1.7/src/runtime/panic.go:458 +0x243
bytes.(*Buffer).ReadFrom(0xc420034df0, 0x0, 0x0, 0xc42018e200, 0x0, 0x200)
        /usr/lib/go-1.7/src/bytes/buffer.go:176 +0x134
io/ioutil.readAll(0x0, 0x0, 0x200, 0x0, 0x0, 0x0, 0x0, 0x0)
        /usr/lib/go-1.7/src/io/ioutil/ioutil.go:33 +0x147
io/ioutil.ReadAll(0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
        /usr/lib/go-1.7/src/io/ioutil/ioutil.go:42 +0x3e
_/tmp/buildd/golang-code%2egitea-git-0%2e0~git20170321%2e0%2e5b41327.TestBlob_Data(0xc4201840c0)
        /tmp/buildd/golang-code.gitea-git-0.0~git20170321.0.5b41327/blob_test.go:47 +0x11b
testing.tRunner(0xc4201840c0, 0x6c7508)
        /usr/lib/go-1.7/src/testing/testing.go:610 +0x81
created by testing.(*T).Run
        /usr/lib/go-1.7/src/testing/testing.go:646 +0x2ec
exit status 2
FAIL    _/tmp/buildd/golang-code.gitea-git-0.0~git20170321.0.5b41327    0.011s

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

MTecknology avatar Mar 24 '17 02:03 MTecknology

There we go! If the tests are run from outside of this git repository, they will fail because these tests are meant to be run from within upstream's (this) git repository.

Could we extend these tests to creating a repository (in some tmp/ dir preferably), creating a static text file, adding it, getting the ID, and then pulling the object with that ID and making sure it still matches our expected input?

This would provide a much more complete test and should provide for more reliable testing. :)

MTecknology avatar Mar 24 '17 03:03 MTecknology

I would consider this more of a bug than a question...

MTecknology avatar Apr 18 '17 02:04 MTecknology

I agree creating the git repo would be preferred. Can you give that a try @MTecknology ?

strk avatar Apr 18 '17 10:04 strk

Maybe we should create it in os.Getenv("TMPDIR") || os.Tempdir() ? that way it ends up in /tmp unless you override it with TMPDIR=tmp/

bkcsoft avatar Apr 19 '17 07:04 bkcsoft

how its the progress of this issue? i'm very interesting

mckaygerhard avatar Sep 21 '17 22:09 mckaygerhard