Movatterモバイル変換


[0]ホーム

URL:


coderdenttest

package
v2.26.0Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 3, 2025 License:AGPL-3.0Imports:44Imported by:0

Details

Repository

github.com/coder/coder

Links

Documentation

Index

Constants

This section is empty.

Variables

Functions

funcAddFullLicense

func AddFullLicense(t *testing.T, client *codersdk.Client)codersdk.License

AddFullLicense generates a license with all features enabled.

funcAddLicense

func AddLicense(t *testing.T, client *codersdk.Client, optionsLicenseOptions)codersdk.License

AddLicense generates a new license with the options provided and inserts it.

funcCreateOrganizationadded inv2.14.0

func CreateOrganization(t *testing.T, client *codersdk.Client, optsCreateOrganizationOptions, mutators ...func(*codersdk.CreateOrganizationRequest))codersdk.Organization

funcGenerateLicense

func GenerateLicense(t *testing.T, optionsLicenseOptions)string

GenerateLicense returns a signed JWT using the test key.

funcGenerateLicenseRawadded inv2.25.0

func GenerateLicenseRaw(t *testing.T, claims jwt.Claims)string

funcGetRunningPrebuildsadded inv2.26.0

func GetRunningPrebuilds(ctxcontext.Context,t *testing.T,dbdatabase.Store,desiredPrebuildsint,) []database.GetRunningPrebuiltWorkspacesRow

funcMustClaimPrebuildadded inv2.26.0

func MustClaimPrebuild(ctxcontext.Context,t *testing.T,client *codersdk.Client,userClient *codersdk.Client,usernamestring,versioncodersdk.TemplateVersion,presetIDuuid.UUID,autostartSchedule ...string,)codersdk.Workspace

funcMustRunReconciliationLoopForPresetadded inv2.26.0

func MustRunReconciliationLoopForPreset(ctxcontext.Context,t *testing.T,dbdatabase.Store,reconciler *entprebuilds.StoreReconciler,presetcodersdk.Preset,) []*prebuilds.ReconciliationActions

funcNew

New constructs a codersdk client connected to an in-memory Enterprise API instance.

funcNewExternalProvisionerDaemonadded inv2.14.0

func NewExternalProvisionerDaemon(ttesting.TB, client *codersdk.Client, orguuid.UUID, tags map[string]string)io.Closer

NewExternalProvisionerDaemon runs an external provisioner daemon in agoroutine and returns a closer to stop it. The echo provisioner is usedhere. This is the default provisioner for tests and should be fine formost use cases. If you need to test terraform-specific behaviors, useNewExternalProvisionerDaemonTerraform instead.

funcNewExternalProvisionerDaemonTerraformadded inv2.18.2

func NewExternalProvisionerDaemonTerraform(ttesting.TB, client *codersdk.Client, orguuid.UUID, tags map[string]string)io.Closer

NewExternalProvisionerDaemonTerraform runs an external provisioner daemon ina goroutine and returns a closer to stop it. The terraform provisioner isused here. Avoid using this unless you need to test terraform-specificbehaviors!

funcNewWithDatabaseadded inv2.5.0

Types

typeCreateOrganizationOptionsadded inv2.14.0

type CreateOrganizationOptions struct {// IncludeProvisionerDaemon will spin up an external provisioner for the organization.// This requires enterprise and the feature 'codersdk.FeatureExternalProvisionerDaemons'IncludeProvisionerDaemonbool}

typeLicenseOptions

type LicenseOptions struct {AccountTypestringAccountIDstringDeploymentIDs    []stringTrialboolFeatureSetcodersdk.FeatureSetAllFeaturesboolPublishUsageDatabool// GraceAt is the time at which the license will enter the grace period.GraceAttime.Time// ExpiresAt is the time at which the license will hard expire.// ExpiresAt should always be greater then GraceAt.ExpiresAttime.Time// NotBefore is the time at which the license becomes valid. If set to the// zero value, the `nbf` claim on the license is set to 1 minute in the// past.NotBeforetime.Time// IssuedAt is the time at which the license was issued. If set to the// zero value, the `iat` claim on the license is set to 1 minute in the// past.IssuedAttime.TimeFeatureslicense.Features}

LicenseOptions is used to generate a license for testing.It supports the builder pattern for easy customization.

func (*LicenseOptions)Expiredadded inv2.14.0

func (opts *LicenseOptions) Expired(nowtime.Time) *LicenseOptions

func (*LicenseOptions)Featureadded inv2.14.0

func (opts *LicenseOptions) Feature(namecodersdk.FeatureName, valueint64) *LicenseOptions

func (*LicenseOptions)FutureTermadded inv2.14.3

func (opts *LicenseOptions) FutureTerm(nowtime.Time) *LicenseOptions

func (*LicenseOptions)Generateadded inv2.14.0

func (opts *LicenseOptions) Generate(t *testing.T)string

func (*LicenseOptions)GracePeriodadded inv2.14.0

func (opts *LicenseOptions) GracePeriod(nowtime.Time) *LicenseOptions

func (*LicenseOptions)ManagedAgentLimitadded inv2.25.0

func (opts *LicenseOptions) ManagedAgentLimit(softint64, hardint64) *LicenseOptions

func (*LicenseOptions)UserLimitadded inv2.14.0

func (opts *LicenseOptions) UserLimit(limitint64) *LicenseOptions

func (*LicenseOptions)Validadded inv2.14.0

func (opts *LicenseOptions) Valid(nowtime.Time) *LicenseOptions

func (*LicenseOptions)WithIssuedAtadded inv2.25.0

func (opts *LicenseOptions) WithIssuedAt(nowtime.Time) *LicenseOptions

typeOptions

type Options struct {*coderdtest.OptionsConnectionLoggingboolAuditLoggingboolBrowserOnlyboolEntitlementsUpdateIntervaltime.DurationSCIMAPIKey                 []byteUserWorkspaceQuotaintProxyHealthIntervaltime.DurationLicenseOptions             *LicenseOptionsDontAddLicenseboolDontAddFirstUserboolReplicaSyncUpdateIntervaltime.DurationReplicaErrorGracePeriodtime.DurationExternalTokenEncryption    []dbcrypt.CipherProvisionerDaemonPSKstring}

typeProxyOptions

type ProxyOptions struct {NamestringExperimentscodersdk.ExperimentsTLSCertificates []tls.CertificateAppHostnamestringDisablePathAppsboolDerpDisabledboolDerpOnlyboolBlockDirectbool// ProxyURL is optionalProxyURL *url.URL// Token is optional. If specified, a new workspace proxy region will not be// created, and the proxy will become a replica of the existing proxy// region.Tokenstring// ReplicaPingCallback is optional.ReplicaPingCallback func(replicas []codersdk.Replica, errstring)// FlushStats is optionalFlushStats chan chan<- struct{}}

typeWorkspaceProxyadded inv2.8.5

type WorkspaceProxy struct {*wsproxy.ServerServerURL *url.URL}

funcNewWorkspaceProxyReplicaadded inv2.8.5

func NewWorkspaceProxyReplica(t *testing.T, coderdAPI *coderd.API, owner *codersdk.Client, options *ProxyOptions)WorkspaceProxy

NewWorkspaceProxyReplica will configure a wsproxy.Server with the givenoptions. The new wsproxy replica will register itself with the givencoderd.API instance.

If a token is not provided, a new workspace proxy region is created using theowner client. If a token is provided, the proxy will become a replica of theexisting proxy region.

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp