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

Function configureDeployment

enterprise/coderd/usage/publisher_test.go:641–659  ·  view source on GitHub ↗
(ctx context.Context, t *testing.T, db database.Store)

Source from the content-addressed store, hash-verified

639}
640
641func configureDeployment(ctx context.Context, t *testing.T, db database.Store) (uuid.UUID, string) {
642 t.Helper()
643 deploymentID := uuid.New()
644 err := db.InsertDeploymentID(ctx, deploymentID.String())
645 require.NoError(t, err)
646
647 licenseRaw := coderdenttest.GenerateLicense(t, coderdenttest.LicenseOptions{
648 PublishUsageData: true,
649 })
650 _, err = db.InsertLicense(ctx, database.InsertLicenseParams{
651 UploadedAt: dbtime.Now(),
652 JWT: licenseRaw,
653 Exp: dbtime.Now().Add(48 * time.Hour),
654 UUID: uuid.New(),
655 })
656 require.NoError(t, err)
657
658 return deploymentID, licenseRaw
659}
660
661func configureMockDeployment(t *testing.T, db *dbmock.MockStore) (uuid.UUID, string) {
662 t.Helper()

Callers 2

TestIntegrationFunction · 0.85
TestPublisherClaimExpiryFunction · 0.85

Calls 8

GenerateLicenseFunction · 0.92
NowFunction · 0.92
HelperMethod · 0.65
NewMethod · 0.65
InsertDeploymentIDMethod · 0.65
InsertLicenseMethod · 0.65
AddMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected