[GH-ISSUE #38] Test Failures in Debian Build Environment #6

Open
opened 2026-02-16 10:23:44 -05:00 by yindo · 5 comments
Owner

Originally created by @MTecknology on GitHub (Mar 23, 2017).
Original GitHub issue: https://github.com/go-gitea/git/issues/38

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.

Originally created by @MTecknology on GitHub (Mar 23, 2017). Original GitHub issue: https://github.com/go-gitea/git/issues/38 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 ``` <bountysource-plugin> --- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/43381532-test-failures-in-debian-build-environment?utm_campaign=plugin&utm_content=tracker%2F47809898&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F47809898&utm_medium=issues&utm_source=github). </bountysource-plugin>
yindo added the kind/bugkind/testing labels 2026-02-16 10:23:44 -05:00
Author
Owner

@MTecknology commented on GitHub (Mar 23, 2017):

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 commented on GitHub (Mar 23, 2017): 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. :)
Author
Owner

@MTecknology commented on GitHub (Apr 17, 2017):

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

@MTecknology commented on GitHub (Apr 17, 2017): I would consider this more of a bug than a question...
Author
Owner

@strk commented on GitHub (Apr 18, 2017):

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

@strk commented on GitHub (Apr 18, 2017): I agree creating the git repo would be preferred. Can you give that a try @MTecknology ?
Author
Owner

@bkcsoft commented on GitHub (Apr 19, 2017):

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 commented on GitHub (Apr 19, 2017): 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/`
Author
Owner

@mckaygerhard commented on GitHub (Sep 21, 2017):

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

@mckaygerhard commented on GitHub (Sep 21, 2017): how its the progress of this issue? i'm very interesting
yindo changed title from Test Failures in Debian Build Environment to [GH-ISSUE #38] Test Failures in Debian Build Environment 2026-06-05 16:30:41 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: go-gitea/git#6