Skip to content

add unit test coverage for ComputingUnitHelpers #6326

Description

@mengw15

Task Summary

computing-unit-managing-service/src/main/scala/org/apache/texera/service/util/ComputingUnitHelpers.scala (0% coverage) has getComputingUnitStatus and getComputingUnitMetrics, both switching on WorkflowComputingUnit.getType. The local and unknown-type branches are pure and unit-testable without a cluster (construct the jOOQ WorkflowComputingUnit pojo via setType(...), no DB). The kubernetes branch calls the static KubernetesClient and needs a mock seam.

Behavior to cover

  • getComputingUnitStatus with type local -> Running
  • getComputingUnitStatus with an unknown / other type -> Pending
  • getComputingUnitMetrics with type local -> WorkflowComputingUnitMetrics("NaN", "NaN")
  • getComputingUnitMetrics with an unknown type -> WorkflowComputingUnitMetrics("NaN", "NaN")
  • The kubernetes branch (calls KubernetesClient.getPodByName / getPodMetrics) needs a mock seam on the static KubernetesClient — cover once that's introduced; out of scope for the pure branches above.

Task Type

  • Refactor / Cleanup
  • DevOps / Deployment / CI
  • Testing / QA
  • Documentation
  • Performance
  • Other

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Fields

No fields configured for Task.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions