Interfaces
@system-inc/base-foundation · 515c140 · 2 symbols
IntegrationTestEnvironmentVariables
Interface for all common environment variables used in integration tests.
extends EnvironmentVariables
Members
BUILD_TIMESTAMP?:stringThe build timestamp of the build.
CF_VERSION_METADATA?:anyCloudflare Worker version metadata.
COMMIT_SHA?:stringThe 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?:stringThe user who deployed the build.
ENCRYPTION_KEYS?:string | ExportedEncryptionKey[]The encryption keys to use for the server.
ENVIRONMENT?:stringThe 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?:ExecutionModeTypeThe execution mode of the worker.
PLATFORM?:PlatformTypeThe type of platform the worker is running on.
PORT?:stringThe port the worker should run on.
RUN_CONFIG?:stringThe configuration name to use when running the worker.
TEST_HOST?:stringThe 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?:stringThe 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?:stringThis 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.
UniqueTestIdOptions
Options controlling how uniqueTestId formats its output.
Members
maxLength?:numberMaximum 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?:stringCharacter 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.