[SPARK-49277] Refactor `RestartPolicyTest` to test per case

### What changes were proposed in this pull request?

This aims to refactor `RestartPolicyTest` to test per case. There is no change in terms of test coverage.

### Why are the changes needed?

`RestartPolicy` has four enum values. We had better have four test cases.

https://github.com/apache/spark-kubernetes-operator/blob/7b3dc1c77ecaf1309127bdb7d494ef81915bec34/spark-operator-api/src/main/java/org/apache/spark/k8s/operator/spec/RestartPolicy.java#L24-L28

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

Pass the CIs.

### Was this patch authored or co-authored using generative AI tooling?

No.

Closes #56 from dongjoon-hyun/SPARK-49277.

Authored-by: Dongjoon Hyun <dongjoon@apache.org>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
1 file changed
tree: 902fcbaf275084a1514c49e5bbf13b5c7dded12c
  1. .github/
  2. build-tools/
  3. config/
  4. dev/
  5. examples/
  6. gradle/
  7. spark-operator/
  8. spark-operator-api/
  9. spark-submission-worker/
  10. .asf.yaml
  11. .gitignore
  12. build.gradle
  13. gradle.properties
  14. gradlew
  15. LICENSE
  16. README.md
  17. settings.gradle
README.md

Apache Spark K8s Operator

Apache Spark K8s Operator is a subproject of Apache Spark and aims to extend K8s resource manager to manage Apache Spark applications via Operator Pattern.

GitHub Actions Build

Building Spark K8s Operator

Spark K8s Operator is built using Gradle. To build, run:

$ ./gradlew build -x test

Running Tests

$ ./gradlew build

Build Docker Image

$ docker build --build-arg APP_VERSION=0.1.0 -t spark-kubernetes-operator:0.1.0 -f build-tools/docker/Dockerfile  .

Install Helm Chart

$ ./gradlew spark-operator-api:relocateGeneratedCRD

$ helm install spark-kubernetes-operator --create-namespace -f build-tools/helm/spark-kubernetes-operator/values.yaml build-tools/helm/spark-kubernetes-operator/

Run Spark Pi App

$ kubectl apply -f examples/pi.yaml

$ kubectl get sparkapp
NAME   CURRENT STATE      AGE
pi     ResourceReleased   4m10s

$ kubectl delete sparkapp/pi

Contributing

Please review the Contribution to Spark guide for information on how to get started contributing to the project.