Skip to content

Commit

Permalink
Do not save logs when RayJob status is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
jiripetrlik authored and sutaakar committed Nov 15, 2023
1 parent 6cab591 commit df40a5f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tests/integration/ray_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"net/url"
"testing"

"github.com/onsi/gomega"
. "github.com/onsi/gomega"
support "github.com/project-codeflare/codeflare-operator/test/support"
rayv1alpha1 "github.com/ray-project/kuberay/ray-operator/apis/ray/v1alpha1"
Expand Down Expand Up @@ -114,7 +115,13 @@ func TestRayCluster(t *testing.T) {
dashboardHostname := dashboard.Status.Ingress[0].Host

rayClient := support.NewRayClusterClient(url.URL{Scheme: "http", Host: dashboardHostname})
defer support.WriteRayJobLogs(test, rayClient, rayJob.Namespace, rayJob.Name)
defer func() {
job, err := test.Client().Ray().RayV1alpha1().RayJobs(rayJob.Namespace).Get(test.Ctx(), rayJob.Name, metav1.GetOptions{})
test.Expect(err).NotTo(gomega.HaveOccurred())
if job.Status.JobId != "" {
support.WriteRayJobLogs(test, rayClient, rayJob.Namespace, rayJob.Name)
}
}()

test.T().Logf("Waiting for RayJob %s/%s to complete", rayJob.Namespace, rayJob.Name)
// Will be removed when RHODS-12857 is fixed
Expand Down

0 comments on commit df40a5f

Please sign in to comment.