Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit291d926

Browse files
committed
Revert "chore: remove unnecessary test suite"
This reverts commit3d63e36.
1 parent7fec6cf commit291d926

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed

‎provider/app_test.go‎

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -596,4 +596,66 @@ func TestApp(t *testing.T) {
596596
})
597597
}
598598
})
599+
600+
// TODO: Find a better place for this?
601+
// TODO: Do we need to test this with the schema rules already existing?
602+
t.Run("Command",func(t*testing.T) {
603+
t.Parallel()
604+
605+
cases:= []struct {
606+
namestring
607+
commandstring
608+
subdomainbool
609+
expectError*regexp.Regexp
610+
}{
611+
{
612+
name:"Command",
613+
command:"read -p\\\"Workspace spawned. Press enter to continue...\\\"",
614+
},
615+
{
616+
name:"CommandAndURL",
617+
command:"read -p\\\"Workspace spawned. Press enter to continue...\\\"",
618+
subdomain:true,
619+
expectError:regexp.MustCompile("conflicts with subdomain"),
620+
},
621+
}
622+
623+
for_,c:=rangecases {
624+
c:=c
625+
626+
t.Run(c.name,func(t*testing.T) {
627+
t.Parallel()
628+
629+
subdomainLine:=""
630+
ifc.subdomain {
631+
subdomainLine="subdomain = true"
632+
}
633+
634+
config:=fmt.Sprintf(`
635+
provider "coder" {}
636+
resource "coder_agent" "dev" {
637+
os = "linux"
638+
arch = "amd64"
639+
}
640+
resource "coder_app" "code-server" {
641+
agent_id = coder_agent.dev.id
642+
slug = "code-server"
643+
display_name = "Testing"
644+
open_in = "slim-window"
645+
command = "%s"
646+
%s
647+
}
648+
`,c.command,subdomainLine)
649+
650+
resource.Test(t, resource.TestCase{
651+
ProviderFactories:coderFactory(),
652+
IsUnitTest:true,
653+
Steps: []resource.TestStep{{
654+
Config:config,
655+
ExpectError:c.expectError,
656+
}},
657+
})
658+
})
659+
}
660+
})
599661
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp