Skip to content

[Bug] Dashboard HTTP client tests not run #4172

@alimaazamat

Description

@alimaazamat

Search before asking

  • I searched the issues and found no similar issues.

KubeRay Component

ci

What happened + What you expected to happen

This previous refactoring of the utils package: #4057 moved the dashboard client to a seperate package. Test file was moved but no suite_test.go was moved/created so the tests never get run. Also Github CI/CD never picked up the tests so they never ran.

Background information:
Ginkgo tests use functions like Describe() which var declarations. You need TestDashboardClient() function that calls RunSpecs() to run the actual Describe() tests. That TestDashboardClient() function gets run with go test.

This went undetected because Ray Operator CI runs make test which runs go test across all packages:
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test $(WHAT) -coverprofile cover.out
and for dashboardclient go test found no TestDashboardClient function and no tests ran.

Reproduction script

ginkgo run -r -v ray-operator/controllers/ray/utils/

Will run 0 of 0 specs
Ran 0 of 0 Specs in 0.000 seconds
SUCCESS! -- 0 Passed | 0 Failed | 0 Pending | 0 Skipped
PASS
PASS
testing: warning: no tests to run
Found no test suites, did you forget to run "ginkgo bootstrap"?
Ginkgo ran 2 suites in 4.889140541s
Test Suite Passed

and
ginkgo run -v ./controllers/ray/utils/dashboardclient/

PASS
testing: warning: no tests to run
Found no test suites, did you forget to run "ginkgo bootstrap"?
Ginkgo ran 1 suite in 1.858397167s
Test Suite Passed

Anything else

No response

Are you willing to submit a PR?

  • Yes I am willing to submit a PR!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions