Questions tagged [goconvey]

GoConvey is a 2-pronged testing tool for the Go programming language. The first part is a package you import in your test code that allows the programmer to write tests in a BDD-like style. The second part is a web server you can run which executes your tests as you make changes to code and displays the results in a web browser.

GoConvey is a 2-pronged testing tool for the Go programming language. The first part is a package you import in your test code that allows the programmer to write tests in a BDD-like style. The second part is a web server you can run which executes your tests (using the standard go test command) as you make changes to code and displays the results in a web browser (with easy access to code coverage provided by the go cover tool). Usage of either part is not dependent on the other. Happy testing!

15 questions
3
votes
2 answers

How to test a panic in Golang?

func good(json) string { \\do something err = json.Unmarshal(body, &list) if err != nil { panic(fmt.Sprintf("Unable to parse json %s",err)) } } func Testgood_PanicStatement(t *testing.T) { Convey("And Invalid Json return error",t,…
techno
  • 111
  • 3
  • 14
3
votes
2 answers

Goconvey causing panic with go routine on Jenkins

I have a set of test that use GoConvey with Go 1.3.1 that work just fine locally. But when I trigger a build with Jenkins, with the Go 1.3.1 as well, I get a panic from Goconvey related to a go routine I use in my test. The test may be seen…
jsgoecke
  • 249
  • 3
  • 11
2
votes
1 answer

Convey fail on simple test

I am attempting to use Convey for the first time. My real test fails for an unknown reason, so I created this very simple test and it fails the same way. GO Convey func TestSimple(t *testing.T) { Convey("Given Simple Test", t, func() { …
Donald French
  • 1,731
  • 1
  • 17
  • 30
2
votes
0 answers

go test error : import path contains backslash; use slash

I got the following output upon running test in my golang project (truncated. see the complete output down below) : import path contains backslash; use slash: "gitlab.com\\group-name\\project-name/vendor/..." project-name is the name of the project…
har07
  • 88,338
  • 12
  • 84
  • 137
2
votes
1 answer

Running goconvey http server from within a docker container

I'm using docker containers for some of my golang web service projects and part of the development workflow is using goconvey for some fast tdd feedback. I'd like to spin this up within a docker container and expose the port to the host machine so I…
mcbain83
  • 492
  • 6
  • 19
2
votes
1 answer

goconvey Please run goconvey from within your $GOPATH cannot import absolute path

I'm setting up go and trying to get a simple project working with http://goconvey.co/ I have my $GOPATH set to /Users/joe/Desktop/playground/go and when I run $ go get github.com/smartystreets/goconvey it downloads all good to my GOPATH so when I…
mcbain83
  • 492
  • 6
  • 19
1
vote
3 answers

Golang not able to test in same package

Having issue creating unit test of one of my source file ( commonutil.go ) package util import "github.com/nu7hatch/gouuid" // GenerateUUID Returns generated UUID sequence func GenerateUniqueID(hostname string) (string, error) { var result,…
Rudy
  • 7,008
  • 12
  • 50
  • 85
1
vote
1 answer

Skip certain folders containing static content during GoConvey testing of endpoint REST API

I have a public folder to serve static resources. I wrote tests to save static content in this folder using Convey. It gets stuck in a never-ending loop due to the new files created in the public folder. integration.go:120: File system state…
lionelmessi
  • 1,116
  • 2
  • 10
  • 17
1
vote
1 answer

Explicitly specifying the main package to run tests for in golang with goconvey

How do I explicitly say with my go test command to run only tests for the main package and not others in my source directory. At the moment it's working with $go test -v. But... I am using goconvey as well and it seems to be running recursively.…
mcbain83
  • 492
  • 6
  • 19
0
votes
0 answers

GoConvey: command not found : goconvey

I'm begginer of Go Lang. I'm trying to the problem that I did "go get github.com/smartystreets/goconvey", but when I command goconvey, it occurs command not found. How can I work arrange this? I'd appreciate for any solution.
Uranus_ly
  • 121
  • 1
  • 6
0
votes
1 answer

goconvey not showing coverage of packages

In goconvey, there's a feature that shows package coverage, and when you click on the package under analysis, the go coverage tool pops up, showing the source code, colored by what has and hasn't been covered. For example: However, there are many…
Mike Warren
  • 3,796
  • 5
  • 47
  • 99
0
votes
2 answers

Why GoConvey Tests fail with error code 0?

I need to run my GoConvey tests as part of my build how do i make sure go test exits with error exit code (not 0)?
danfromisrael
  • 2,982
  • 3
  • 30
  • 40
0
votes
1 answer

GoConvey custom assertions not working as expected

Not sure why the following custom assertion is not working, it seems a compilation error, but the syntax I am using seems compliant with what is explained in their wiki page: https://github.com/smartystreets/goconvey/wiki/Custom-Assertions I…
TPPZ
  • 4,447
  • 10
  • 61
  • 106
0
votes
1 answer

echo c.Get("user") does not work in testing env

I am attempting to test a golang API built on the echo framework/router. I have the following test..... func TestLogout(t *testing.T) { loadConfig() db := stubDBs(t) Convey("When you post to /logout", t, func() { Convey("with a valid token, you…
Chris L
  • 1,051
  • 1
  • 7
  • 20
0
votes
1 answer

How to get goconvey working on windows 7?

I'm starting to work on some development work with golang and I would love to use the BDD style goconvey gives. I've just configured my system to be set up for golang, I've go get github.com/smartystreets/goconvey all good, but when I write some…
mcbain83
  • 492
  • 6
  • 19