68 questions
1 vote
0 answers
24 views
Ginkgo Receive(BeEquivalentTo()) fails when comparing struct with interface payload
When writing Ginkgo unit tests, I ran into an issue asserting data received from a channel that contains a struct with an interface{} field. Here's my models.go type WsBaseMsg struct { Type ...
0 votes
1 answer
236 views
Using multiple skips in Ginkgo test run
I am running tests using ginkgo, and I am trying to skip two of my tests that are not applicable to my environment. ./_output/bin/e2e.test --ginkgo.focus="sig-network.*[Conformance]" --...
1 vote
1 answer
162 views
Error on testing Gingko and Gomega for gingonic, w.Code not working
I have some tests written in Ginkgo that check the return-code, a 502 code should be returned at a specific moment in time, it returns 502 (as you can see on the logs) but the w.Code is still 200. [...
0 votes
0 answers
219 views
Ginkgo - skip tests that don't match an expression
Trying to write a REGEX for the ginkgo --skip flag, that would skip tests that do NOT contain a string ("test1"). AFAIK golang doesn't support '!' (this post) I know I can use --focus, but ...
1 vote
0 answers
173 views
How to get the current test configuration in ginkgo
Say I am runing a test suites, is there a way to get the information of the current test that's running, for example, its labels or its text? my use case is as follows: I have a test suite which ...
0 votes
1 answer
163 views
Execution failing with go error for acceptance tests
I am trying to execute acceptance testing (AATs), But when eveni try to use ginkgo command or make aat, it fails with below go error : lisha@admin-bld-box:$ ginkgo Failed to compile topology-...
3 votes
1 answer
1k views
How to output the test command Ginkgo uses
I have a Ginkgo test suite that has many test files. I can run all tests under the test suite with the following command, where ./controller is the package that has all tests. go test ./controllers/......
1 vote
1 answer
2k views
How to write a unit test to mock clientset for a http call to return all nodes in a kubernetes cluster
I am currently working on getting familiar with Ginkgo testing framework to write unit tests for api calls and just plain functions. Having trouble wrapping my head around mocking things. Right now I ...
2 votes
3 answers
2k views
Can Gomega equal with ginkgo print full strings?
Example error print of a unit test: Expected <string>: "...up - Finish..." to equal | <string>: "...up - Vault .....
1 vote
0 answers
239 views
How to recover argument sent to mock with Ginkgo
I am working with /onsi/ginkgo/v2 v2.1.4 and /golang/mock v1.6.0 in Golang v1.19.2 And I want to retrieve the argument that was sent to the mock's InsertOneProspecto function. ctrl = gomock....
2 votes
1 answer
1k views
Using ginkgo with different go versions
I'm using go with multiple version as stated in this doc https://go.dev/doc/manage-install go install golang.org/dl/go1.10.7@latest go1.10.7 download And I'm also using ginkgo, which I installed like ...
3 votes
1 answer
444 views
Can Gomega support verification of multiple return values of different types where the last one is not `error`?
For instance: If I have a wrapper for https://pkg.go.dev/sync#Map.Load: with the same method signature: func Load(key string) (value interface{}, ok bool) in Can Gomega's Equal() handle multiple ...
1 vote
0 answers
119 views
Ginkgo binaries not seen in Mac directories
I have installed ginkgo, but I cannot locate it inside the /Users/user-name/gowork/src/github.com/onsi folder. If I delete the gowork folder, I can see the ginkgo folders within it, in Trash. ginkgo ...
0 votes
1 answer
653 views
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....
2 votes
0 answers
483 views
How to run before all suites in ginkgo?
I'm integrating mock server to out tests. As part of it I need to clear all the request that was caught by mock server. Due to restrictions of the service we use, I can do it only once for all the ...