Skip to content

Commit

Permalink
Adjust 'go.embed' to accept python files
Browse files Browse the repository at this point in the history
  • Loading branch information
ChughShilpa authored and openshift-merge-bot[bot] committed Nov 22, 2024
1 parent 139f8d2 commit 6dbb295
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
2 changes: 1 addition & 1 deletion tests/kfto/core/kfto_training_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func runKFTOPyTorchJob(t *testing.T, image string, gpuLabel string, numGpus int)

// Create a ConfigMap with training script
configData := map[string][]byte{
"hf_llm_training.py": ReadFileExt(test, "hf_llm_training.py"),
"hf_llm_training.py": ReadFile(test, "hf_llm_training.py"),
}
config := CreateConfigMap(test, namespace, configData)

Expand Down
10 changes: 1 addition & 9 deletions tests/kfto/core/support.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@ package core
import (
"embed"
"fmt"
"os"
"time"

"github.com/onsi/gomega"
. "github.com/onsi/gomega"
. "github.com/project-codeflare/codeflare-common/support"

Expand All @@ -34,6 +32,7 @@ import (
)

//go:embed *.json
//go:embed *.py
var files embed.FS

func ReadFile(t Test, fileName string) []byte {
Expand All @@ -43,13 +42,6 @@ func ReadFile(t Test, fileName string) []byte {
return file
}

func ReadFileExt(t Test, fileName string) []byte {
t.T().Helper()
file, err := os.ReadFile(fileName)
t.Expect(err).NotTo(gomega.HaveOccurred())
return file
}

func PyTorchJob(t Test, namespace, name string) func(g Gomega) *kftov1.PyTorchJob {
return func(g Gomega) *kftov1.PyTorchJob {
job, err := t.Client().Kubeflow().KubeflowV1().PyTorchJobs(namespace).Get(t.Ctx(), name, metav1.GetOptions{})
Expand Down

0 comments on commit 6dbb295

Please sign in to comment.