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:
26 lines
403 B
Go
26 lines
403 B
Go
package support
|
|
|
|
import (
|
|
"io/fs"
|
|
"os"
|
|
"path"
|
|
|
|
"github.com/onsi/gomega"
|
|
)
|
|
|
|
func Ptr[T any](v T) *T {
|
|
return &v
|
|
}
|
|
|
|
type OutputType string
|
|
|
|
const (
|
|
Log OutputType = "log"
|
|
)
|
|
|
|
func WriteToOutputDir(t Test, fileName string, fileType OutputType, data []byte) {
|
|
t.T().Helper()
|
|
t.Expect(os.WriteFile(path.Join(t.OutputDir(), fileName+"."+string(fileType)), data, fs.ModePerm)).
|
|
To(gomega.Succeed())
|
|
}
|