Skip to content

Commit

Permalink
add yaml file contains yaml str test
Browse files Browse the repository at this point in the history
  • Loading branch information
harper-carroll committed Jul 29, 2023
1 parent 0c61399 commit dcc6ec0
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions e2etest/setup/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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,
Expand All @@ -340,7 +341,7 @@ func NewTestSetupParams(keyPair *store.KeyPair) *store.SetupParamsV0 {
WorkspacePassword: "12345",
WorkspaceKeyPair: keyPair,
ProjectSetupScript: nil,
VerbYaml: verbYaml,
VerbYaml: testVerbYaml,
DisableSetup: true,
}
}
Expand Down Expand Up @@ -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)
}
Expand Down

0 comments on commit dcc6ec0

Please sign in to comment.