Skip to main content

test_matrices

Creates, updates, deletes, gets or lists a test_matrices resource.

Overview

Nametest_matrices
TypeResource
Idfirebase.testing.test_matrices

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
clientInfoobjectInformation about the client which invoked the test. (id: ClientInfo)
environmentMatrixobjectRequired. The devices the tests are being executed on. (id: EnvironmentMatrix)
extendedInvalidMatrixDetailsarrayOutput only. Details about why a matrix was deemed invalid. If multiple checks can be safely performed, they will be reported but no assumptions should be made about the length of this list.
failFastbooleanIf true, only a single attempt at most will be made to run each execution/shard in the matrix. Flaky test attempts are not affected. Normally, 2 or more attempts are made if a potential infrastructure issue is detected. This feature is for latency sensitive workloads. The incidence of execution failures may be significantly greater for fail-fast matrices and support is more limited because of that expectation.
flakyTestAttemptsinteger (int32)The number of times a TestExecution should be re-attempted if one or more of its test cases fail for any reason. The maximum number of reruns allowed is 10. Default is 0, which implies no reruns.
invalidMatrixDetailsstringOutput only. Describes why the matrix is considered invalid. Only useful for matrices in the INVALID state.
outcomeSummarystringOutput Only. The overall outcome of the test. Only set when the test matrix state is FINISHED.
projectIdstringThe cloud project that owns the test matrix.
resultStorageobjectRequired. Where the results for the matrix are written. (id: ResultStorage)
statestringOutput only. Indicates the current progress of the test matrix.
testExecutionsarrayOutput only. The list of test executions that the service creates for this matrix.
testMatrixIdstringOutput only. Unique id set by the service.
testSpecificationobjectRequired. How to run the test. (id: TestSpecification)
timestampstring (google-datetime)Output only. The time this test matrix was initially created.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectId, testMatrixIdChecks the status of a test matrix and the executions once they are created. The test matrix will contain the list of test executions to run if and only if the resultStorage.toolResultsExecution fields have been populated. Note: Flaky test executions may be added to the matrix at a later stage. May return any of the following canonical error codes: - PERMISSION_DENIED - if the user is not authorized to read project - INVALID_ARGUMENT - if the request is malformed - NOT_FOUND - if the Test Matrix does not exist
createinsertprojectIdrequestIdCreates and runs a matrix of tests according to the given specifications. Unsupported environments will be returned in the state UNSUPPORTED. A test matrix is limited to use at most 2000 devices in parallel. The returned matrix will not yet contain the executions that will be created for this matrix. Execution creation happens later on and will require a call to GetTestMatrix. May return any of the following canonical error codes: - PERMISSION_DENIED - if the user is not authorized to write to project - INVALID_ARGUMENT - if the request is malformed or if the matrix tries to use too many simultaneous devices.
cancelexecprojectId, testMatrixIdCancels unfinished test executions in a test matrix. This call returns immediately and cancellation proceeds asynchronously. If the matrix is already final, this operation will have no effect. May return any of the following canonical error codes: - PERMISSION_DENIED - if the user is not authorized to read project - INVALID_ARGUMENT - if the request is malformed - NOT_FOUND - if the Test Matrix does not exist

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
projectIdstring
testMatrixIdstring
requestIdstring

SELECT examples

Checks the status of a test matrix and the executions once they are created. The test matrix will contain the list of test executions to run if and only if the resultStorage.toolResultsExecution fields have been populated. Note: Flaky test executions may be added to the matrix at a later stage. May return any of the following canonical error codes: - PERMISSION_DENIED - if the user is not authorized to read project - INVALID_ARGUMENT - if the request is malformed - NOT_FOUND - if the Test Matrix does not exist

SELECT
clientInfo,
environmentMatrix,
extendedInvalidMatrixDetails,
failFast,
flakyTestAttempts,
invalidMatrixDetails,
outcomeSummary,
projectId,
resultStorage,
state,
testExecutions,
testMatrixId,
testSpecification,
timestamp
FROM firebase.testing.test_matrices
WHERE projectId = '{{ projectId }}' -- required
AND testMatrixId = '{{ testMatrixId }}' -- required;

INSERT examples

Creates and runs a matrix of tests according to the given specifications. Unsupported environments will be returned in the state UNSUPPORTED. A test matrix is limited to use at most 2000 devices in parallel. The returned matrix will not yet contain the executions that will be created for this matrix. Execution creation happens later on and will require a call to GetTestMatrix. May return any of the following canonical error codes: - PERMISSION_DENIED - if the user is not authorized to write to project - INVALID_ARGUMENT - if the request is malformed or if the matrix tries to use too many simultaneous devices.

INSERT INTO firebase.testing.test_matrices (
data__testMatrixId,
data__projectId,
data__clientInfo,
data__testSpecification,
data__environmentMatrix,
data__testExecutions,
data__resultStorage,
data__state,
data__timestamp,
data__invalidMatrixDetails,
data__flakyTestAttempts,
data__outcomeSummary,
data__failFast,
projectId,
requestId
)
SELECT
'{{ testMatrixId }}',
'{{ projectId }}',
'{{ clientInfo }}',
'{{ testSpecification }}',
'{{ environmentMatrix }}',
'{{ testExecutions }}',
'{{ resultStorage }}',
'{{ state }}',
'{{ timestamp }}',
'{{ invalidMatrixDetails }}',
{{ flakyTestAttempts }},
'{{ outcomeSummary }}',
{{ failFast }},
'{{ projectId }}',
'{{ requestId }}'
RETURNING
clientInfo,
environmentMatrix,
extendedInvalidMatrixDetails,
failFast,
flakyTestAttempts,
invalidMatrixDetails,
outcomeSummary,
projectId,
resultStorage,
state,
testExecutions,
testMatrixId,
testSpecification,
timestamp
;

Lifecycle Methods

Cancels unfinished test executions in a test matrix. This call returns immediately and cancellation proceeds asynchronously. If the matrix is already final, this operation will have no effect. May return any of the following canonical error codes: - PERMISSION_DENIED - if the user is not authorized to read project - INVALID_ARGUMENT - if the request is malformed - NOT_FOUND - if the Test Matrix does not exist

EXEC firebase.testing.test_matrices.cancel 
@projectId='{{ projectId }}' --required,
@testMatrixId='{{ testMatrixId }}' --required;