From dcc6ec07bfa590c2c5d30955a6ecc497aac3301c Mon Sep 17 00:00:00 2001 From: "harper@brev.dev" Date: Sat, 29 Jul 2023 01:06:16 +0000 Subject: [PATCH] add yaml file contains yaml str test --- e2etest/setup/setup.go | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/e2etest/setup/setup.go b/e2etest/setup/setup.go index e6a1ae10..a2840daf 100644 --- a/e2etest/setup/setup.go +++ b/e2etest/setup/setup.go @@ -46,6 +46,18 @@ type AllWorkspaceTestClientOption struct { TestNamePrefix string } +const testVerbYaml string = ` + build: + gpu: true + system_packages: + - libgl1-mesa-glx + - libglib2.0-0 + python_version: '3.11' + cuda: '11.1' + python_packages: + - torch==1.8.1 + ` + func NewWorkspaceTestClientOptions(options []WorkspaceTestClientOption) AllWorkspaceTestClientOption { allOptions := AllWorkspaceTestClientOption{} for _, o := range options { @@ -318,17 +330,6 @@ func (w TestWorkspace) Done() error { } func NewTestSetupParams(keyPair *store.KeyPair) *store.SetupParamsV0 { - verbYaml := ` - build: - gpu: true - system_packages: - - libgl1-mesa-glx - - libglib2.0-0 - python_version: '3.11' - cuda: '11.1' - python_packages: - - torch==1.8.1 - ` return &store.SetupParamsV0{ WorkspaceHost: "name-rand-org.x.y", WorkspacePort: 22778, @@ -340,7 +341,7 @@ func NewTestSetupParams(keyPair *store.KeyPair) *store.SetupParamsV0 { WorkspacePassword: "12345", WorkspaceKeyPair: keyPair, ProjectSetupScript: nil, - VerbYaml: verbYaml, + VerbYaml: testVerbYaml, DisableSetup: true, } } @@ -374,6 +375,7 @@ func AssertWorkspaceSetup(t *testing.T, w Workspace, password string, host strin AssertFileContainsString(t, w, "/home/brev/.config/code-server/config.yaml", password) AssertFileContainsString(t, w, "/home/brev/.config/code-server/config.yaml", host) AssertPathExists(t, w, "/home/brev/workspace/.brev/verb.yaml") + AssertFileContainsString(t, w, "/home/brev/workspace/.brev/verb.yaml", testVerbYaml) AssertInternalSSHServerRunning(t, w, "/home/brev/.ssh/id_rsa", "brev", "ls") AssertDockerRunning(t, w) }