MCPcopy Index your code
hub / github.com/coder/coder / TestWorkspaceWithEphemeralRichParameters

Function TestWorkspaceWithEphemeralRichParameters

coderd/workspaces_test.go:4617–4740  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

4615}
4616
4617func TestWorkspaceWithEphemeralRichParameters(t *testing.T) {
4618 t.Parallel()
4619
4620 const (
4621 firstParameterName = "first_parameter"
4622 firstParameterType = "string"
4623 firstParameterDescription = "This is first parameter"
4624 firstParameterMutable = true
4625 firstParameterDefaultValue = "1"
4626 firstParameterValue = "i_am_first_parameter"
4627
4628 ephemeralParameterName = "second_parameter"
4629 ephemeralParameterType = "string"
4630 ephemeralParameterDescription = "This is second parameter"
4631 ephemeralParameterDefaultValue = ""
4632 ephemeralParameterMutable = true
4633 ephemeralParameterValue = "i_am_ephemeral"
4634 )
4635
4636 // Create template version with ephemeral parameter
4637 client := coderdtest.New(t, &coderdtest.Options{IncludeProvisionerDaemon: true})
4638 user := coderdtest.CreateFirstUser(t, client)
4639 version := coderdtest.CreateTemplateVersion(t, client, user.OrganizationID, &echo.Responses{
4640 Parse: echo.ParseComplete,
4641 ProvisionGraph: []*proto.Response{
4642 {
4643 Type: &proto.Response_Graph{
4644 Graph: &proto.GraphComplete{
4645 Parameters: []*proto.RichParameter{
4646 {
4647 Name: firstParameterName,
4648 Type: firstParameterType,
4649 Description: firstParameterDescription,
4650 DefaultValue: firstParameterDefaultValue,
4651 Mutable: firstParameterMutable,
4652 },
4653 {
4654 Name: ephemeralParameterName,
4655 Type: ephemeralParameterType,
4656 Description: ephemeralParameterDescription,
4657 DefaultValue: ephemeralParameterDefaultValue,
4658 Mutable: ephemeralParameterMutable,
4659 Ephemeral: true,
4660 },
4661 },
4662 },
4663 },
4664 },
4665 },
4666 ProvisionApply: []*proto.Response{{
4667 Type: &proto.Response_Apply{
4668 Apply: &proto.ApplyComplete{},
4669 },
4670 }},
4671 })
4672 coderdtest.AwaitTemplateVersionJobCompleted(t, client, version.ID)
4673 template := coderdtest.CreateTemplate(t, client, user.OrganizationID, version.ID)
4674

Callers

nothing calls this directly

Calls 10

NewFunction · 0.92
CreateFirstUserFunction · 0.92
CreateTemplateVersionFunction · 0.92
CreateTemplateFunction · 0.92
CreateWorkspaceFunction · 0.92
CreateWorkspaceBuildMethod · 0.80
EqualMethod · 0.45

Tested by

no test coverage detected