mirror of
https://github.com/hanzo-ml/kuberay.git
synced 2026-10-30 19:48:47 +00:00
This PR adds e2e tests for the operator, following up #1539 (comment). This e2e testing enables to assert Kuberay resources, in a way that cannot be achieved with existing tests (envtest). The e2e tests execution output is post-processed using gotestfmt: The logs and events are gathered and uploaded are part of the workflow run:
32 lines
716 B
Go
32 lines
716 B
Go
package support
|
|
|
|
import (
|
|
"os"
|
|
)
|
|
|
|
const (
|
|
// KuberayTestOutputDir is the testing output directory, to write output files into.
|
|
KuberayTestOutputDir = "KUBERAY_TEST_OUTPUT_DIR"
|
|
|
|
// KuberayTestRayVersion is the version of Ray to use for testing.
|
|
KuberayTestRayVersion = "KUBERAY_TEST_RAY_VERSION"
|
|
|
|
// KuberayTestRayImage is the Ray image to use for testing.
|
|
KuberayTestRayImage = "KUBERAY_TEST_RAY_IMAGE"
|
|
)
|
|
|
|
func GetRayVersion() string {
|
|
return lookupEnvOrDefault(KuberayTestRayVersion, RayVersion)
|
|
}
|
|
|
|
func GetRayImage() string {
|
|
return lookupEnvOrDefault(KuberayTestRayImage, RayImage)
|
|
}
|
|
|
|
func lookupEnvOrDefault(key, value string) string {
|
|
if v, ok := os.LookupEnv(key); ok {
|
|
return v
|
|
}
|
|
return value
|
|
}
|