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

Function setupGroupAIBudgetTest

enterprise/coderd/aibridge_test.go:2875–2897  ·  view source on GitHub ↗

setupGroupAIBudgetTest returns an Admin client along with a newly created group inside it.

(t *testing.T)

Source from the content-addressed store, hash-verified

2873
2874// setupGroupAIBudgetTest returns an Admin client along with a newly created group inside it.
2875func setupGroupAIBudgetTest(t *testing.T) (adminClient *codersdk.Client, group codersdk.Group) {
2876 t.Helper()
2877
2878 dv := coderdtest.DeploymentValues(t)
2879 dv.AI.BridgeConfig.Enabled = serpent.Bool(true)
2880 ownerClient, owner := coderdenttest.New(t, &coderdenttest.Options{
2881 Options: &coderdtest.Options{DeploymentValues: dv},
2882 LicenseOptions: &coderdenttest.LicenseOptions{
2883 Features: license.Features{
2884 codersdk.FeatureTemplateRBAC: 1,
2885 codersdk.FeatureAIBridge: 1,
2886 },
2887 },
2888 })
2889 adminClient, _ = coderdtest.CreateAnotherUser(t, ownerClient, owner.OrganizationID, rbac.RoleUserAdmin())
2890
2891 ctx := testutil.Context(t, testutil.WaitLong)
2892 g, err := adminClient.CreateGroup(ctx, owner.OrganizationID, codersdk.CreateGroupRequest{
2893 Name: "budget-test-group",
2894 })
2895 require.NoError(t, err)
2896 return adminClient, g
2897}

Callers 1

TestGroupAIBudgetFunction · 0.85

Calls 7

DeploymentValuesFunction · 0.92
NewFunction · 0.92
CreateAnotherUserFunction · 0.92
RoleUserAdminFunction · 0.92
ContextFunction · 0.92
CreateGroupMethod · 0.80
HelperMethod · 0.65

Tested by

no test coverage detected