-
Notifications
You must be signed in to change notification settings - Fork 425
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] Run Ginkgo tests with Ginkgo CLI #2658
Comments
@MortalHappiness Hi! I’d like to take this on—please assign it to me if possible. Thanks! |
Does |
No, it only works for regular Golang tests, not Ginkgo tests. |
Hmm would this work? |
I've tested running specific Ginkgo tests using Given these benefits, do you think switching from go test to the Ginkgo CLI would be a good move? |
Yes. I still think it's better to switch to use Ginkgo CLI, because it has more features. |
I forgot about |
Upon reviewing the issue, it was confirmed that a conflict occurs when Ginkgo tests are mixed with standard Go tests. (When running Ginkgo --focus, all tests defined in the standard go test are also executed.) This happens because, to use Ginkgo with go test, all test code must be written in the Ginkgo format. The flags -ginkgo.focus and -ginkgo.skip only work with tests written in the Ginkgo framework. Conflicts can arise when Ginkgo tests are mixed with standard Go tests, and to resolve this, all tests need to be standardized to the Ginkgo format. Converting all tests to the Ginkgo format will require considerable time and effort, making it a long-term task. For further reference on similar issues, you can check Ginkgo Issue #358. |
Could we use |
As a temporary measure, can we introduce a new make target that just runs the ginkgo tests, with support for passing in a focus string? We dont need to run it through CI, it's just for local development |
@MortalHappiness @andrewsykim Script:test-target: WHAT ?= ./controllers/ray/
test-target: TEST_NAME ?= ""
test-target: ENVTEST_K8S_VERSION ?= 1.24.2
test-target: manifests fmt vet envtest
@go test -run $(TEST_NAME) $(WHAT) -count=1 | tee >(if grep -q "no tests to run"; then \
echo "No matching Go tests found. Running Ginkgo tests…"; \
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) —bin-dir $(LOCALBIN) -p path)" ginkgo —focus "$(TEST_NAME)" $(WHAT); \
fi) For ginkgo test:make test-target TEST_NAME=RayClusterwithinvalidNumOfHosts WHAT=./controllers/ray/ For go test:make test-target TEST_NAME=TestCreateRayJobSubmitterIfNeed If this approach looks reasonable, I will proceed to create a PR. |
Search before asking
Description
Currently, Ginkgo tests are run with
go test
, and we cannot run a single test, which is annoying. We should use the Ginkgo CLI to run Ginkgo tests.Implementation Details
Describe(
using your IDE to identify which files contain Ginkgo tests..github/
and.buildkite/
folders to use the Ginkgo CLI instead ofgo test
for running Ginkgo tests.Use case
No response
Related issues
No response
Are you willing to submit a PR?
The text was updated successfully, but these errors were encountered: