2

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/... -v --args --ginkgo.vv

say ./controller folder has the following files

add_pods.go
add_pods_test.go
update_status.go
update_status_test.go

I want to figure out how to run update_status_test.go alone. The go test ./controller -run update_status doesn't work because it cannot find any test.

Can I let ginkgo output the go test command it uses to run each test? That can give me hint on how to focus on a single test to run.

Mike
  • 1,841
  • 2
  • 18
  • 34

1 Answers1

1

Yes following to documentation (using ginkgo 1.16.5). Using options -x go test will display the go test command to run (-n go test also does it without running tests).

ginkgo help

...
-x go test
Have go test print the commands.
...
-n go test
Have go test print the commands but do not run them.
Loïc Madiès
  • 277
  • 1
  • 5
  • 19