Questions tagged [ginkgo]

Ginkgo is a BDD-style Golang testing framework built to help you efficiently write expressive and comprehensive tests.

About

Ginkgo is a BDD-style Golang testing framework built to help you efficiently write expressive and comprehensive tests. It is best paired with the Gomega matcher library but is designed to be matcher-agnostic.

Links

67 questions
0
votes
0 answers

Ginkgo test: How to make sure cleanup code is executed when test failed?

When Expect() fails in the It() statement, the AfterEach() won't be executed. Is there a way to always execute some code no matter It() succeeds or fails? (just like Jave's finally())
Mike
  • 1,841
  • 2
  • 18
  • 34
0
votes
2 answers

Can Gomega equal with ginkgo print full strings?

Example error print of a unit test: Expected : "...up - Finish..." to equal | : "...up - Vault ..." Is there a way to increase the print limit this is just not practical…
rufreakde
  • 542
  • 4
  • 17
0
votes
0 answers

Is there any recommend way to get a ginkgo html report

I want to use ginkgo as the integration testing tool in project, but I have searched ginkgo doc and github issues below: Feature request: HTML reporter #141 Specs aren't identified in go test . -json output #639 I find that ginkgo only support…
DSBDO
  • 73
  • 10
0
votes
0 answers

why does Ginkgo Bioworks have ~2.0 B Operating expense in 2021

why does Ginkgo Bioworks have ~2.0 B Operating expense in 2021. The company raised money in IPO and it seems its expensing equity grants, or something. Can someone explain what Ginkgo is spending its money on?
dlight
  • 29
  • 3
0
votes
1 answer

Reducing duplication in ginkgo specs/tests

I was writing tests using ginkgo framework, and wanted to reduce duplication within my tests. Suppose I have two tests, which have a exactly common middle section, but different start and end sections. ginkgo provides BeforeEach function to remove…
0
votes
2 answers

Ginkgo: Mocking a method for unit test

Please note that struct S implements the interface I. I'm trying to test MethodA by mocking the response from MethodB. sample.go: package service // This is implemented by S type I interface { MethodA(num int) int MethodB(num int)…
Skn
  • 140
  • 2
  • 2
  • 13
0
votes
1 answer

Ginkgo: how to combine test reports

I'm setting up GitLab CI. We use Ginkgo tests for BDD. Ginkgo creates a report per each folder where tests are located. This create a problem with collecting all reports and publishing it as a single test report file. Is it possible to configure…
Dmitry Dyachkov
  • 1,715
  • 2
  • 19
  • 46
0
votes
1 answer

How do you change the "Cap" value of an []map[string]interface{} in go lang?

I am trying to do some testing with ginkgo and gomega, I get down to the assertion error Expected <[]map[string]interface {} | len:1, cap:1>: [] To equal <[]map[string]interface {} | len:1, cap:4>: [] I believe that the test is…
benwasin97
  • 203
  • 4
  • 12
0
votes
1 answer

async testing with Gingko and Gomega

I have expanded the following code as per my requirement. https://github.com/radovskyb/watcher/blob/master/example/basics/main.go Purpose of this code is to watch of certain events (CREATE, WRITE) and take appropriate action based on that. To test…
tgcloud
  • 857
  • 6
  • 18
  • 37
0
votes
1 answer

Correct way to check for non null values in ginkgo test

Suppose a function Builder that returns a struct like this: type MyStruct struct{ List []OtherStruct } I want to test the Builder function using ginkgo. I created a test suite with the following structure: Describe("Builder Test", func()…
pablochacin
  • 947
  • 1
  • 14
  • 35
0
votes
1 answer

Cannot start app server in BeforeSuit before running test on the endpoint

I wanna start my app in BeforeSuit and run a GET Request. Is that possible? example_suite_test.go func TestExample(t *testing.T) { RegisterFailHandler(Fail) RunSpecs(t, "Example Suite") } example_test.go var appTest *app.Application var _…
Jen
  • 121
  • 1
  • 1
  • 7
0
votes
0 answers

Why reassign value from range loop in body of loop?

I stumbled upon something weird as I was writing tests. I have written a lot of table tests and I like the pattern recently I started working on a project that uses Ginkgo, and I wanted to write a table test like I am used to. I spent a few hours…
0
votes
0 answers

Whether we can run ginkgo test cases using console input or test data in any file formats?

I need to pass user data via console or any file formats to ginkgo test methods. Let me know the ways. I am looking into Table Driven Tests, but I am looking for test data which is located outside of test case/scripts. Thanks for sharing the…
Vasanthi
  • 37
  • 6
0
votes
0 answers

How to match private struct types using Ginkgo and Gomega?

Assume that I have a function called GetQueue with GoLang and depends on the configuration, it would return different types of queue implementations. func GetQueue(config string) *service.Queue { switch(config): case "A": return…
injoy
  • 3,993
  • 10
  • 40
  • 69
0
votes
1 answer

Ginkgo to cobertura and JUnit

I am using Shippable as my CI and my project is based on Go 1.11. All the unit tests are written in BDD style using Ginkgo and Gomega. In my test pipeline, I have something like: gocov test ./... | gocov-xml > shippable/codecoverage/coverage.xml go…
Tejashwi Kalp Taru
  • 2,994
  • 2
  • 20
  • 35