Interfaces

@system-inc/base-foundation · 515c140 · 2 symbols

Interface for all common environment variables used in integration tests.

extends EnvironmentVariables

Members

  • BUILD_TIMESTAMP?: string

    The build timestamp of the build.

  • CF_VERSION_METADATA?: any

    Cloudflare Worker version metadata.

  • COMMIT_SHA?: string

    The commit SHA of the build.

  • DATABASES?: string | DatabaseEnvironmentVariables[]

    A list of databases to connect to. Each database should have a name and a URL. The URL should be formatted as a MySQL connection string.

  • DEPLOYED_BY?: string

    The user who deployed the build.

  • ENCRYPTION_KEYS?: string | ExportedEncryptionKey[]

    The encryption keys to use for the server.

  • ENVIRONMENT?: string

    The type of environment you are running in. This should map to one of the possible types in EnivronmentType in base/source/core/Environment.ts

  • EXECUTION_MODE?: ExecutionModeType

    The execution mode of the worker.

  • PLATFORM?: PlatformType

    The type of platform the worker is running on.

  • PORT?: string

    The port the worker should run on.

  • RUN_CONFIG?: string

    The configuration name to use when running the worker.

  • TEST_HOST?: string

    The host to use for running integration tests. If set this will always be used and the TEST_HOST_SUFFIX will be ignored.

  • TEST_HOST_SUFFIX?: string

    The suffix to use for computing the test host. This will be combined with the worker name to form the test host. An an example, if the worker name is 'worker' and the suffix is 'test.workers.dev', then the test host will be 'worker.test.workers.dev'.

  • TEST_WORKER_NAME?: string

    This is the name of the worker to run tests for.

    This variable is only used when running tests from VSCode and is normally provided via the command line -w flag.

    This is used solely for loading additional worker specific test environment variables.

View source ↗

Options controlling how uniqueTestId formats its output.

Members

  • maxLength?: number

    Maximum total length of the generated id. When set, the helper switches to a compact format that drops the timestamp partition and uses random hex from crypto.randomUUID() truncated to fill the remaining budget.

    Use this when the consuming field has a tight length validator (e.g. a varchar(16) identifier column). With ~10 hex chars of entropy collisions are vanishingly unlikely even without the per-millisecond partitioning.

  • separator?: string

    Character placed between the prefix and the random suffix (and, in the default format, between the timestamp and random parts). Defaults to -. Pass _ for usernames where - is not a valid character.

View source ↗