Test object schema
The test object allows you to query information about a particular test.
Arguments
When querying for a test
, the following arguments are available.
Field | Type | Required? | Description |
uniqueId | String! | Yes | The unique ID of this particular test |
Below we show some illustrative example queries and outline the schema (all possible fields you can query) of the test object.
Example query
The example query below outputs information about a test including the state of the test result. In order of severity, the result can be one of these: "error", "fail", "warn", or "pass".
{
job(id: 123) {
test(uniqueId: "test.internal_analytics.not_null_metrics_id") {
runId
accountId
projectId
uniqueId
name
columnName
state
}
}
}
Fields
When querying for a test
, the following fields are available:
Field | Type | Description |
accountId | BigInt! | The unique ID of the account in dbt Cloud that this node was generated for |
columnName | String | The name of the column that the test pertains to |
compileCompletedAt | DateTime | The ISO timestamp when this test completed compilation |
compileStartedAt | DateTime | The ISO timestamp when this test began compilation |
compiledCode | String | The compiled code of this test |
compiledSql | String | The compiled sql of this test |
dbtVersion | String | The version of dbt used to produce this node |
dependsOn | [String!]! | The list of nodes this test depends on |
description | String | The user-supplied description for this node |
environmentId | BigInt! | The unique ID of the account in dbt Cloud that this node was generated for |
error | String | The error message in the case of state being "error" |
executeCompletedAt | DateTime | The ISO timestamp when this test finished running |
executeStartedAt | DateTime | The ISO timestamp when this test began running |
executionTime | Float | The total time elapsed during the execution of this test |
fail | Boolean | The failure result |
invocationId | String | The identifier of the run step that generated this test |
jobId | BigInt! | The unique ID of the account in dbt Cloud that this node was generated for |
language | String | The language of this test |
meta | JSONObject | The key-value store containing metadata relevant to this node |
name | String | The user-supplied name of this particular node |
projectId | BigInt! | The unique ID of the account in dbt Cloud that this node was generated for |
rawCode | String | The raw code of this test |
rawSql | String | The raw sql of this test |
resourceType | String! | The resource type of this node |
runElapsedTime | Float | The elapsed time of the specific run step (dbt run) that generated this test node |
runGeneratedAt | DateTime | The timestamp when the run step (dbt run) was completed, ISO formatted timestamp |
runId | BigInt! | The unique ID of the account in dbt Cloud that this node was generated for |
skip | Boolean | The skipped result |
state | String | The test results. Can be one of, in order of severity, "error", "fail", "warn", "pass" |
status | String | Status details the results of a test. For errors, it reads "ERROR". For other test results, it represents the number of rows that contribute to the test results |
tags | [String!] | The tags associated with this node |
threadId | String | The thread that ran the execution of this test |
uniqueId | String! | The unique ID of this node |
warn | Boolean | The warning result |
0