Skip to content

Commit 6dbb295

Browse files
Adjust 'go.embed' to accept python files
1 parent 139f8d2 commit 6dbb295

2 files changed

Lines changed: 2 additions & 10 deletions

File tree

tests/kfto/core/kfto_training_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ func runKFTOPyTorchJob(t *testing.T, image string, gpuLabel string, numGpus int)
4646

4747
// Create a ConfigMap with training script
4848
configData := map[string][]byte{
49-
"hf_llm_training.py": ReadFileExt(test, "hf_llm_training.py"),
49+
"hf_llm_training.py": ReadFile(test, "hf_llm_training.py"),
5050
}
5151
config := CreateConfigMap(test, namespace, configData)
5252

tests/kfto/core/support.go

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,8 @@ package core
1919
import (
2020
"embed"
2121
"fmt"
22-
"os"
2322
"time"
2423

25-
"github.com/onsi/gomega"
2624
. "github.com/onsi/gomega"
2725
. "github.com/project-codeflare/codeflare-common/support"
2826

@@ -34,6 +32,7 @@ import (
3432
)
3533

3634
//go:embed *.json
35+
//go:embed *.py
3736
var files embed.FS
3837

3938
func ReadFile(t Test, fileName string) []byte {
@@ -43,13 +42,6 @@ func ReadFile(t Test, fileName string) []byte {
4342
return file
4443
}
4544

46-
func ReadFileExt(t Test, fileName string) []byte {
47-
t.T().Helper()
48-
file, err := os.ReadFile(fileName)
49-
t.Expect(err).NotTo(gomega.HaveOccurred())
50-
return file
51-
}
52-
5345
func PyTorchJob(t Test, namespace, name string) func(g Gomega) *kftov1.PyTorchJob {
5446
return func(g Gomega) *kftov1.PyTorchJob {
5547
job, err := t.Client().Kubeflow().KubeflowV1().PyTorchJobs(namespace).Get(t.Ctx(), name, metav1.GetOptions{})

0 commit comments

Comments
 (0)