test_matrices
Creates, updates, deletes, gets or lists a test_matrices
resource.
Overview
Name | test_matrices |
Type | Resource |
Id | firebase.testing.test_matrices |
Fields
The following fields are returned by SELECT
queries:
- get
Successful response
Name | Datatype | Description |
---|---|---|
clientInfo | object | Information about the client which invoked the test. (id: ClientInfo) |
environmentMatrix | object | Required. The devices the tests are being executed on. (id: EnvironmentMatrix) |
extendedInvalidMatrixDetails | array | Output 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. |
failFast | boolean | If 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. |
flakyTestAttempts | integer (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. |
invalidMatrixDetails | string | Output only. Describes why the matrix is considered invalid. Only useful for matrices in the INVALID state. |
outcomeSummary | string | Output Only. The overall outcome of the test. Only set when the test matrix state is FINISHED. |
projectId | string | The cloud project that owns the test matrix. |
resultStorage | object | Required. Where the results for the matrix are written. (id: ResultStorage) |
state | string | Output only. Indicates the current progress of the test matrix. |
testExecutions | array | Output only. The list of test executions that the service creates for this matrix. |
testMatrixId | string | Output only. Unique id set by the service. |
testSpecification | object | Required. How to run the test. (id: TestSpecification) |
timestamp | string (google-datetime) | Output only. The time this test matrix was initially created. |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | projectId , testMatrixId | 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 | |
create | insert | projectId | requestId | 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. |
cancel | exec | projectId , testMatrixId | 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 |
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.
Name | Datatype | Description |
---|---|---|
projectId | string | |
testMatrixId | string | |
requestId | string |
SELECT
examples
- get
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
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: test_matrices
props:
- name: projectId
value: string
description: Required parameter for the test_matrices resource.
- name: testMatrixId
value: string
description: >
Output only. Unique id set by the service.
- name: projectId
value: string
description: >
The cloud project that owns the test matrix.
- name: clientInfo
value: object
description: >
Information about the client which invoked the test.
- name: testSpecification
value: object
description: >
Required. How to run the test.
- name: environmentMatrix
value: object
description: >
Required. The devices the tests are being executed on.
- name: testExecutions
value: array
description: >
Output only. The list of test executions that the service creates for this matrix.
- name: resultStorage
value: object
description: >
Required. Where the results for the matrix are written.
- name: state
value: string
description: >
Output only. Indicates the current progress of the test matrix.
valid_values: ['TEST_STATE_UNSPECIFIED', 'VALIDATING', 'PENDING', 'RUNNING', 'FINISHED', 'ERROR', 'UNSUPPORTED_ENVIRONMENT', 'INCOMPATIBLE_ENVIRONMENT', 'INCOMPATIBLE_ARCHITECTURE', 'CANCELLED', 'INVALID']
- name: timestamp
value: string
description: >
Output only. The time this test matrix was initially created.
- name: invalidMatrixDetails
value: string
description: >
Output only. Describes why the matrix is considered invalid. Only useful for matrices in the INVALID state.
valid_values: ['INVALID_MATRIX_DETAILS_UNSPECIFIED', 'DETAILS_UNAVAILABLE', 'MALFORMED_APK', 'MALFORMED_TEST_APK', 'NO_MANIFEST', 'NO_PACKAGE_NAME', 'INVALID_PACKAGE_NAME', 'TEST_SAME_AS_APP', 'NO_INSTRUMENTATION', 'NO_SIGNATURE', 'INSTRUMENTATION_ORCHESTRATOR_INCOMPATIBLE', 'NO_TEST_RUNNER_CLASS', 'NO_LAUNCHER_ACTIVITY', 'FORBIDDEN_PERMISSIONS', 'INVALID_ROBO_DIRECTIVES', 'INVALID_RESOURCE_NAME', 'INVALID_DIRECTIVE_ACTION', 'TEST_LOOP_INTENT_FILTER_NOT_FOUND', 'SCENARIO_LABEL_NOT_DECLARED', 'SCENARIO_LABEL_MALFORMED', 'SCENARIO_NOT_DECLARED', 'DEVICE_ADMIN_RECEIVER', 'MALFORMED_XC_TEST_ZIP', 'BUILT_FOR_IOS_SIMULATOR', 'NO_TESTS_IN_XC_TEST_ZIP', 'USE_DESTINATION_ARTIFACTS', 'TEST_NOT_APP_HOSTED', 'PLIST_CANNOT_BE_PARSED', 'TEST_ONLY_APK', 'MALFORMED_IPA', 'MISSING_URL_SCHEME', 'MALFORMED_APP_BUNDLE', 'NO_CODE_APK', 'INVALID_INPUT_APK', 'INVALID_APK_PREVIEW_SDK', 'MATRIX_TOO_LARGE', 'TEST_QUOTA_EXCEEDED', 'SERVICE_NOT_ACTIVATED', 'UNKNOWN_PERMISSION_ERROR']
- name: flakyTestAttempts
value: integer
description: >
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.
- name: outcomeSummary
value: string
description: >
Output Only. The overall outcome of the test. Only set when the test matrix state is FINISHED.
valid_values: ['OUTCOME_SUMMARY_UNSPECIFIED', 'SUCCESS', 'FAILURE', 'INCONCLUSIVE', 'SKIPPED']
- name: failFast
value: boolean
description: >
If 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.
- name: requestId
value: string
Lifecycle Methods
- cancel
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;