# firebase_functions.test_lab_fn module

Cloud functions to handle Test Lab events.

## Classes

| ### ClientInfo *class* firebase_functions.test_lab_fn.ClientInfo(*client: str* , *details: dict\[str, str\]* ) |
|---|
| Bases: `object` Information about the client which invoked the test. client*: str* :   Client name, such as "gcloud". details*: dict\[str, str\]* :   Map of detailed information about the client. |

| ### OutcomeSummary *class* firebase_functions.test_lab_fn.OutcomeSummary(*value* ) |
|---|
| Bases: `str`, `Enum` Outcome summary for a finished test matrix. FAILURE*= 'FAILURE'* :   A run failed, for instance: - One or more test case failed. - A test timed out. - The application under test crashed. INCONCLUSIVE*= 'INCONCLUSIVE'* :   Something unexpected happened. The test run should still be considered unsuccessful but this is likely a transient problem and re-running the test might be successful. OUTCOME_SUMMARY_UNSPECIFIED*= 'OUTCOME_SUMMARY_UNSPECIFIED'* :   The default value. This value is used if the state is omitted. SKIPPED*= 'SKIPPED'* :   All tests were skipped. SUCCESS*= 'SUCCESS'* :   The test matrix run was successful, for instance: - All test cases passed. - No crash of the application under test was detected. |

| ### ResultStorage *class* firebase_functions.test_lab_fn.ResultStorage(*tool_results_history: str* , *results_uri: str* , *gcs_path: str* , *tool_results_execution: str \| None = None* ) |
|---|
| Bases: `object` Locations where test results are stored. gcs_path*: str* :   Location in Google Cloud Storage where test results are written to. In the form "gs://bucket/path/to/somewhere". results_uri*: str* :   URI to the test results in the Firebase Web Console. tool_results_execution*: str \| None* *= None* :   Tool Results execution resource containing test results. Format is projects/{project_id}/histories/{history_id}/executions/{execution_id}. Optional, can be omitted in erroneous test states. See <https://firebase.google.com/docs/test-lab/reference/toolresults/rest> for more information. tool_results_history*: str* :   Tool Results history resource containing test results. Format is projects/{project_id}/histories/{history_id}. See <https://firebase.google.com/docs/test-lab/reference/toolresults/rest> for more information. |

| ### TestMatrixCompletedData *class* firebase_functions.test_lab_fn.TestMatrixCompletedData(*create_time: datetime* , *state: [TestState](https://firebase.google.com/docs/reference/functions/2nd-gen/python/firebase_functions.test_lab_fn#firebase_functions.test_lab_fn.TestState "firebase_functions.test_lab_fn.TestState")* , *invalid_matrix_details: str \| None* , *outcome_summary: [OutcomeSummary](https://firebase.google.com/docs/reference/functions/2nd-gen/python/firebase_functions.test_lab_fn#firebase_functions.test_lab_fn.OutcomeSummary "firebase_functions.test_lab_fn.OutcomeSummary")* , *result_storage: [ResultStorage](https://firebase.google.com/docs/reference/functions/2nd-gen/python/firebase_functions.test_lab_fn#firebase_functions.test_lab_fn.ResultStorage "firebase_functions.test_lab_fn.ResultStorage")* , *client_info: [ClientInfo](https://firebase.google.com/docs/reference/functions/2nd-gen/python/firebase_functions.test_lab_fn#firebase_functions.test_lab_fn.ClientInfo "firebase_functions.test_lab_fn.ClientInfo")* , *test_matrix_id: str* ) |
|---|
| Bases: `object` The data within all Firebase test matrix completed events. client_info*: [ClientInfo](https://firebase.google.com/docs/reference/functions/2nd-gen/python/firebase_functions.test_lab_fn#firebase_functions.test_lab_fn.ClientInfo "firebase_functions.test_lab_fn.ClientInfo")* :   Information provided by the client that created the test matrix. create_time*: datetime* :   Time the test matrix was created. invalid_matrix_details*: str \| None* :   Code that describes why the test matrix is considered invalid. Only set for matrices in the INVALID state. outcome_summary*: [OutcomeSummary](https://firebase.google.com/docs/reference/functions/2nd-gen/python/firebase_functions.test_lab_fn#firebase_functions.test_lab_fn.OutcomeSummary "firebase_functions.test_lab_fn.OutcomeSummary")* :   Outcome summary of the test matrix. result_storage*: [ResultStorage](https://firebase.google.com/docs/reference/functions/2nd-gen/python/firebase_functions.test_lab_fn#firebase_functions.test_lab_fn.ResultStorage "firebase_functions.test_lab_fn.ResultStorage")* :   Locations where test results are stored. state*: [TestState](https://firebase.google.com/docs/reference/functions/2nd-gen/python/firebase_functions.test_lab_fn#firebase_functions.test_lab_fn.TestState "firebase_functions.test_lab_fn.TestState")* :   State of the test matrix. test_matrix_id*: str* :   ID of the test matrix this event belongs to. |

| ### TestState *class* firebase_functions.test_lab_fn.TestState(*value* ) |
|---|
| Bases: `str`, `Enum` Possible test states for a test matrix. ERROR*= 'ERROR'* :   The test matrix has completed because of an infrastructure failure. FINISHED*= 'FINISHED'* :   The test matrix has completed normally. INVALID*= 'INVALID'* :   The test matrix was not run because the provided inputs are not valid. PENDING*= 'PENDING'* :   The test matrix is waiting for resources to become available. TEST_STATE_UNSPECIFIED*= 'TEST_STATE_UNSPECIFIED'* :   The default value. This value is used if the state is omitted. VALIDATING*= 'VALIDATING'* :   The test matrix is being validated. |

## Functions

| ### on_test_matrix_completed firebase_functions.test_lab_fn.on_test_matrix_completed(*\*\*kwargs* ) → Callable\[\[Callable\[\[[CloudEvent](https://firebase.google.com/docs/reference/functions/2nd-gen/python/firebase_functions.core#firebase_functions.core.CloudEvent "firebase_functions.core.CloudEvent")\[[TestMatrixCompletedData](https://firebase.google.com/docs/reference/functions/2nd-gen/python/firebase_functions.test_lab_fn#firebase_functions.test_lab_fn.TestMatrixCompletedData "firebase_functions.test_lab_fn.TestMatrixCompletedData")\]\], None\]\], Callable\[\[[CloudEvent](https://firebase.google.com/docs/reference/functions/2nd-gen/python/firebase_functions.core#firebase_functions.core.CloudEvent "firebase_functions.core.CloudEvent")\[[TestMatrixCompletedData](https://firebase.google.com/docs/reference/functions/2nd-gen/python/firebase_functions.test_lab_fn#firebase_functions.test_lab_fn.TestMatrixCompletedData "firebase_functions.test_lab_fn.TestMatrixCompletedData")\]\], None\]\] |
|---|
| Event handler which triggers when a Firebase test matrix completes. Example: ``` @on_test_matrix_completed() def example(event: CloudEvent[ConfigUpdateData]) -> None: pass ``` Parameters: :   **\*\*kwargs** (as [`firebase_functions.options.EventHandlerOptions`](https://firebase.google.com/docs/reference/functions/2nd-gen/python/firebase_functions.options#firebase_functions.options.EventHandlerOptions "firebase_functions.options.EventHandlerOptions")) -- Options. Return type: :   `typing.Callable` \[ \[ [`firebase_functions.core.CloudEvent`](https://firebase.google.com/docs/reference/functions/2nd-gen/python/firebase_functions.core#firebase_functions.core.CloudEvent "firebase_functions.core.CloudEvent") \[ [`firebase_functions.test_lab_fn.TestMatrixCompletedData`](https://firebase.google.com/docs/reference/functions/2nd-gen/python/firebase_functions.test_lab_fn#firebase_functions.test_lab_fn.TestMatrixCompletedData "firebase_functions.test_lab_fn.TestMatrixCompletedData") \[ `typing.Any` \] \] \], None \] A function that takes a CloudEvent and returns None. |