TestService¶
A service used by Roblox to run controlled tests of the engine. It is available for developers to use, to a limited degree.
Description¶
TestService is a service used by Roblox internally to run analytical tests
on the engine.
Scripts that are executed inside of TestService (via
TestService.RunAsync()) have access to special macros that directly
invoke functions under the service. Macros are essentially substitutions for
large blocks of code that shouldn't need to be rewritten each time you want to
call them.
RBX_CHECK¶
This macro does tests with calls to the TestService.Check() function.
| Macro | Test Condition |
|---|---|
RBX_CHECK(cond) |
cond == true |
RBX_CHECK_MESSAGE(cond, failMsg) |
cond == true |
RBX_CHECK_THROW(CODE) |
pcall(function() CODE end) == false |
RBX_CHECK_NO_THROW(CODE) |
pcall(function() CODE end) == true |
RBX_CHECK_EQUAL(a, b) |
a == b |
RBX_CHECK_NE(a, b) |
a ~= b |
RBX_CHECK_GE(a, b) |
a >= b |
RBX_CHECK_LE(a, b) |
a <= b |
RBX_CHECK_GT(a, b) |
a > b |
RBX_CHECK_LT(a, b) |
a < b |
RBX_REQUIRE¶
This macro does tests with calls to the TestService.Require() function.
| Macro | Test Condition |
|---|---|
RBX_REQUIRE(cond) |
cond == true |
RBX_REQUIRE_MESSAGE(cond, failMsg) |
cond == true |
RBX_REQUIRE_THROW(CODE) |
pcall(function() CODE end) == false |
RBX_REQUIRE_NO_THROW(CODE) |
pcall(function() CODE end) == true |
RBX_REQUIRE_EQUAL(a, b) |
a == b |
RBX_REQUIRE_NE(a, b) |
a ~= b |
RBX_REQUIRE_GE(a, b) |
a >= b |
RBX_REQUIRE_LE(a, b) |
a <= b |
RBX_REQUIRE_GT(a, b) |
a > b |
RBX_REQUIRE_LT(a, b) |
a < b |
RBX_WARN¶
This macro does tests with calls to the TestService.Warn() function.
| Macro | Test Condition |
|---|---|
RBX_WARN(cond) |
cond == true |
RBX_WARN_MESSAGE(cond, failMsg) |
cond == true |
RBX_WARN_THROW(CODE) |
pcall(function() CODE end) == false |
RBX_WARN_NO_THROW(CODE) |
pcall(function() CODE end) == true |
RBX_WARN_EQUAL(a, b) |
a == b |
RBX_WARN_NE(a, b) |
a ~= b |
RBX_WARN_GE(a, b) |
a >= b |
RBX_WARN_LE(a, b) |
a <= b |
RBX_WARN_GT(a, b) |
a > b |
RBX_WARN_LT(a, b) |
a < b |
Additional Macros¶
| Macro | Description |
|---|---|
RBX_ERROR(msg) |
Directly calls the Class.TestService:Error() function. |
RBX_FAIL(msg) |
Directly calls the Class.TestService:Fail() function. |
RBX_MESSAGE(msg) |
Directly calls the Class.TestService:Message() function. |
Inheritance¶
Object → Instance → TestService
Nova inheritance: Instance → TestService
Properties¶
AutoRuns Supported Property If set to true, the game will start running when the service's TestService.RunAsync() method is called.
If set to true, the game will start running when the service's
TestService.RunAsync() method is called.
Description Supported Property A description of the test being executed.
ErrorCount Supported Property Measures how many errors have been recorded in the test session.
Measures how many errors have been recorded in the test session.
Is30FpsThrottleEnabled Supported Property Deprecated Sets whether or not the physics engine should be throttled to 30 FPS while the test is being ran.
Sets whether or not the physics engine should be throttled to 30 FPS while the test is being ran.
IsPhysicsEnvironmentalThrottled Supported Property Sets whether or not the physics environment should be throttled while running this test.
Sets whether or not the physics environment should be throttled while running this test.
IsSleepAllowed Supported Property Sets whether or not physics objects will be allowed to fall asleep while the test simulation is running.
Sets whether or not physics objects will be allowed to fall asleep while the test simulation is running.
NumberOfPlayers Supported Property The number of players expected in this test, if any.
SimulateSecondsLag Supported Property Sets a specific amount of additional latency experienced by players during the test session.
Sets a specific amount of additional latency experienced by players during the test session.
TestCount Supported Property Measures how many test calls have been recorded in the test session.
Measures how many test calls have been recorded in the test session.
Timeout Supported Property The maximum amount of time that tests are allowed to run for.
WarnCount Supported Property Measures how many warning calls have been recorded in the test session.
Measures how many warning calls have been recorded in the test session.
Methods¶
Check Supported Function Prints result of a condition to the output.
Prints result of a condition to the output.
If condition is true, prints Check passed: followed by description
to the output in blue text. Otherwise, prints Check failed: followed by
description in red text.
Roblox reference signature
Checkpoint Supported Function Prints Test checkpoint: followed by a string to the output in blue text.
Prints Test checkpoint: followed by a string to the output in blue text.
Prints Test checkpoint: followed by text to the output in blue text.
Roblox reference signature
Done Supported Function Prints Testing Done to the output in blue text.
Prints Testing Done to the output in blue text.
Error Supported Function Prints a red error message to the output, prefixed by TestService: .
Prints a red error message to the output, prefixed by TestService:.
Prints a red error message (description) to the output, prefixed by
TestService:.
Roblox reference signature
Fail Supported Function Indicates a fatal error in a TestService run.
Indicates a fatal error in a TestService run. If this is called inside
of a script running inside the service, it will initiate a breakpoint on
the line that invoked the error.
Roblox reference signature
Message Supported Function Prints TestService: followed by a string to the output in blue text.
Prints TestService: followed by a string to the output in blue text.
Prints TestService: followed by text to the output in blue text.
Roblox reference signature
Require Supported Function Prints whether a condition is true along with a description string.
Prints whether a condition is true along with a description string.
If condition is true, prints Require passed: followed by
description to the output in blue text. Otherwise prints
Require failed. Test ended: followed by description in red text.
Roblox reference signature
Run Supported Function Deprecated Runs scripts which are parented to TestService.
Runs scripts which are parented to TestService.
PluginSecurityWarn Supported Function Prints if a condition is true, otherwise prints a warning.
Prints if a condition is true, otherwise prints a warning.
If condition is true, prints Warning passed: followed by
description to the output in blue text. Otherwise prints Warning:
followed by description to the output in yellow text.
Roblox reference signature
Events¶
ServerCollectConditionalResult Supported Event Fires when the server should collect a conditional test result.
Fires when the server should collect a conditional test result.
Roblox reference signature
ServerCollectResult Supported Event Fires when the server should collect a test result.
Fires when the server should collect a test result.
Inherited members¶
Inherited from Instance: 8 properties, 36 methods, 7 events. They are documented on the base class page.
28 modern Roblox member(s) are not implemented yet — expand to inspect
Members declared by Roblox's TestService class (or by a missing base class) that Nova does not expose. Use this list to scope a migration; the compatibility guide has the recommended workaround.
Properties¶
| Member | Signature | Status | Notes | Flags |
|---|---|---|---|---|
ExecuteWithStudioRun |
ExecuteWithStudioRun: bool |
Not yet | When set to true, TestService will be executed when using the Run action in Roblox Studio. |
— |
ThrottlePhysicsToRealtime |
ThrottlePhysicsToRealtime: bool |
Not yet | Sets whether the test should be throttled to simulate time according to real world time or as fast as possible. | — |
Methods¶
| Member | Signature | Status | Notes | Flags |
|---|---|---|---|---|
CaptureScreenshotAsync |
TestService:CaptureScreenshotAsync(artifactName: string, options: Dictionary = nil): Tuple |
Not yet | — | Yields |
ConvertSlimAcrToObj |
TestService:ConvertSlimAcrToObj(acrFullFilePath: string, objFileName: string): string |
Not yet | — | RobloxScriptSecurity |
CreateAndSavePropertySet |
TestService:CreateAndSavePropertySet(source: Instance): string |
Not yet | — | RobloxScriptSecurity |
CreateExtraAssetsFileFromPropertySet |
TestService:CreateExtraAssetsFileFromPropertySet(psetFileName: string): string |
Not yet | — | RobloxScriptSecurity |
FetchExtraAssets |
TestService:FetchExtraAssets(extraAssetsFileName: string): string |
Not yet | — | RobloxScriptSecurity |
FetchTestControlsAsync |
TestService:FetchTestControlsAsync(category: string): Tuple |
Not yet | — | Yields |
GetTestControls |
TestService:GetTestControls(providerName: string): Dictionary |
Not yet | — | — |
GetTestControlSchema |
TestService:GetTestControlSchema(providerName: string): Dictionary |
Not yet | — | — |
getTestSessionProviderStats |
TestService:getTestSessionProviderStats(providerName: string): Dictionary |
Not yet | — | — |
isFeatureEnabled |
TestService:isFeatureEnabled(name: string): bool |
Not yet | Returns whether the named feature identified by name is currently enabled. |
— |
RegisterTest |
TestService:RegisterTest(testOptions: Dictionary): TestCase |
Not yet | — | — |
RegisterTestLegacy |
TestService:RegisterTestLegacy(testOptions: Dictionary): TestCase |
Not yet | — | — |
RequestValidationAsync |
TestService:RequestValidationAsync(module: string, artifactName: string, options: Variant): Tuple |
Not yet | — | Yields |
ResetTestControl |
TestService:ResetTestControl(providerName: string, controlName: string): null |
Not yet | — | — |
RunAsync |
TestService:RunAsync(): null |
Not yet | Runs scripts which are parented to TestService. |
Yields, PluginSecurity |
ScopeTime |
TestService:ScopeTime(): Dictionary |
Not yet | Returns a dictionary of per-scope physics simulation timings for performance testing. | — |
SetTestControl |
TestService:SetTestControl(providerName: string, controlName: string, value: Variant): null |
Not yet | — | — |
SignalProfilingCapture |
TestService:SignalProfilingCapture(target: string, options: Dictionary = nil): null |
Not yet | — | — |
SignalProfilingStart |
TestService:SignalProfilingStart(target: string, options: Dictionary = nil): null |
Not yet | — | — |
SignalProfilingStop |
TestService:SignalProfilingStop(target: string): null |
Not yet | — | — |
StartTestSession |
TestService:StartTestSession(): null |
Not yet | — | — |
StartVideoCaptureAsync |
TestService:StartVideoCaptureAsync(artifactName: string, options: Dictionary = nil): Tuple |
Not yet | — | Yields |
StopTestSession |
TestService:StopTestSession(): null |
Not yet | — | — |
StopVideoCaptureAsync |
TestService:StopVideoCaptureAsync(): Tuple |
Not yet | — | Yields |
TakeSnapshot |
TestService:TakeSnapshot(snapshotname: string, source: Instance = nil): null |
Not yet | — | — |
TranscodePropertySet |
TestService:TranscodePropertySet(extraAssetsFileName: string, psetFileName: string): string |
Not yet | — | RobloxScriptSecurity |
Roblox reference: TestService
Generated from Nova's API dump and Roblox creator-docs. Nova-only members come from the engine's reflection metadata.