UnifiedTestRunner
in package
Unified test runner.
Tags
Table of Contents
- ATLAS_TLD = 'mongodb.net'
- MAX_SCHEMA_VERSION = '1.5'
- MIN_SCHEMA_VERSION = '1.0'
- SERVER_ERROR_INTERRUPTED = 11601
- SERVER_ERROR_UNAUTHORIZED = 13
- $allowKillAllSessions : bool
- $entityMap : EntityMap
- $entityMapObserver : mixed
- $failPointObserver : FailPointObserver
- $internalClient : Client
- $internalClientUri : string
- __construct() : mixed
- run() : void
- setEntityMapObserver() : void
- Defines a callable to receive the EntityMap after each test.
- assertOutcome() : void
- checkRunOnRequirements() : void
- Checks server version and topology requirements.
- doSetUp() : void
- doTearDown() : void
- doTestCase() : void
- getPrimaryServer() : Server
- getServerParameters() : stdClass
- getServerVersion() : string
- getTopology() : string
- Return the topology type.
- isAuthenticated() : bool
- Return whether the connection is authenticated.
- isSchemaVersionSupported() : bool
- Checks is a test format schema version is supported.
- isServerless() : bool
- Return whether serverless (i.e. proxy as mongos) is being utilized.
- isShardedClusterUsingReplicasets() : bool
- killAllSessions() : void
- Kill all sessions on the cluster.
- prepareInitialData() : void
- preventStaleDbVersionError() : void
- Work around potential error executing distinct on sharded clusters.
Constants
ATLAS_TLD
public
mixed
ATLAS_TLD
= 'mongodb.net'
MAX_SCHEMA_VERSION
public
mixed
MAX_SCHEMA_VERSION
= '1.5'
MIN_SCHEMA_VERSION
public
mixed
MIN_SCHEMA_VERSION
= '1.0'
SERVER_ERROR_INTERRUPTED
public
mixed
SERVER_ERROR_INTERRUPTED
= 11601
SERVER_ERROR_UNAUTHORIZED
public
mixed
SERVER_ERROR_UNAUTHORIZED
= 13
Properties
$allowKillAllSessions
private
bool
$allowKillAllSessions
= true
$entityMap
private
EntityMap
$entityMap
$entityMapObserver
private
mixed
$entityMapObserver
callable(EntityMap):void
$failPointObserver
private
FailPointObserver
$failPointObserver
$internalClient
private
Client
$internalClient
$internalClientUri
private
string
$internalClientUri
Methods
__construct()
public
__construct(string $internalClientUri) : mixed
Parameters
- $internalClientUri : string
Return values
mixed —run()
public
run(UnifiedTestCase $test) : void
Parameters
- $test : UnifiedTestCase
Return values
void —setEntityMapObserver()
Defines a callable to receive the EntityMap after each test.
public
setEntityMapObserver(callable $entityMapObserver) : void
This function is primarily used by the Atlas testing workload executor.
Parameters
- $entityMapObserver : callable
Return values
void —assertOutcome()
private
assertOutcome(array<string|int, mixed> $outcome) : void
Parameters
- $outcome : array<string|int, mixed>
Return values
void —checkRunOnRequirements()
Checks server version and topology requirements.
private
checkRunOnRequirements(array<string|int, mixed> $runOnRequirements) : void
Arguments for RunOnRequirement::isSatisfied() will be cached internally.
Parameters
- $runOnRequirements : array<string|int, mixed>
Tags
Return values
void —doSetUp()
private
doSetUp() : void
Return values
void —doTearDown()
private
doTearDown(bool $hasFailed) : void
Parameters
- $hasFailed : bool
Return values
void —doTestCase()
private
doTestCase(stdClass $test, string $schemaVersion[, array<string|int, mixed>|null $runOnRequirements = null ][, array<string|int, mixed>|null $createEntities = null ][, array<string|int, mixed>|null $initialData = null ]) : void
Parameters
- $test : stdClass
- $schemaVersion : string
- $runOnRequirements : array<string|int, mixed>|null = null
- $createEntities : array<string|int, mixed>|null = null
- $initialData : array<string|int, mixed>|null = null
Return values
void —getPrimaryServer()
private
getPrimaryServer() : Server
Return values
Server —getServerParameters()
private
getServerParameters() : stdClass
Return values
stdClass —getServerVersion()
private
getServerVersion() : string
Return values
string —getTopology()
Return the topology type.
private
getTopology() : string
Tags
Return values
string —isAuthenticated()
Return whether the connection is authenticated.
private
isAuthenticated() : bool
Note: if the connectionStatus command is not portable for serverless, it may be necessary to rewrite this to instead inspect the connection string or consult an environment variable, as is done in libmongoc.
Return values
bool —isSchemaVersionSupported()
Checks is a test format schema version is supported.
private
isSchemaVersionSupported(string $schemaVersion) : bool
Parameters
- $schemaVersion : string
Return values
bool —isServerless()
Return whether serverless (i.e. proxy as mongos) is being utilized.
private
isServerless() : bool
Return values
bool —isShardedClusterUsingReplicasets()
private
isShardedClusterUsingReplicasets() : bool
Return values
bool —killAllSessions()
Kill all sessions on the cluster.
private
killAllSessions() : void
This will clean up any open transactions that may remain from a previously failed test. For sharded clusters, this command will be run on all mongos nodes.
This method is a NOP if allowKillAllSessions is false.
Return values
void —prepareInitialData()
private
prepareInitialData(array<string|int, mixed> $initialData) : void
Parameters
- $initialData : array<string|int, mixed>
Return values
void —preventStaleDbVersionError()
Work around potential error executing distinct on sharded clusters.
private
preventStaleDbVersionError(array<string|int, mixed> $operations, Context $context) : void
Parameters
- $operations : array<string|int, mixed>
- $context : Context