How to Run Integration K8s Test
Introduction
- The test cases under the directory - test-k8sare integration tests to ensure the correctness of the Submarine RESTful API.
- You can run these tests either locally or on GitHub Actions. - Before running the tests, the minikube (KinD) cluster must be created.
- Then, compile and package the submarine project in submarine-distdirectory for building a docker image.
- In addition, the 8080 port in submarine-traefik should be forwarded.
 
Run k8s test locally
- Ensure you have setup the KinD cluster or minikube cluster. If you haven't, follow this - minikube tutorial
- Build the submarine from source and upgrade the server pod through this - guide
- Forward port - kubectl port-forward --address 0.0.0.0 service/submarine-traefik 8080:80
- Install the latest package "submarine-server-core" into the local repository, for use as a dependency in the module - test-k8s- mvn install -DskipTests
- Execute the test command - mvn verify -DskipRat -pl :submarine-test-k8s -Phadoop-2.9 -B

Run k8s test in GitHub Actions
- Each time a code is submitted, GitHub Actions is triggered automatically.