Skip to main content

Tests object schema

The tests object allows you to query information about all tests in a given job.

Arguments

When querying for tests, the following arguments are available.

FieldTypeRequired?Description

Below we show some illustrative example queries and outline the schema (all possible fields you can query) of the tests object.

Example query

The example query below finds all tests in this job and includes information about those tests.

{
job(id: 123) {
tests {
runId
accountId
projectId
uniqueId
name
columnName
state
}
}
}

Fields

When querying for tests, the following fields are available:

FieldTypeDescription
accountIdBigInt!The unique ID of the account in dbt Cloud that this node was generated for
columnNameStringThe name of the column that the test pertains to
compileCompletedAtDateTimeThe ISO timestamp when this test completed compilation
compileStartedAtDateTimeThe ISO timestamp when this test began compilation
compiledCodeStringThe compiled code of this test
compiledSqlStringThe compiled sql of this test
dbtVersionStringThe version of dbt used to produce this node
dependsOn[String!]!The list of nodes this test depends on
descriptionStringThe user-supplied description for this node
environmentIdBigInt!The unique ID of the account in dbt Cloud that this node was generated for
errorStringThe error message in the case of state being "error"
executeCompletedAtDateTimeThe ISO timestamp when this test finished running
executeStartedAtDateTimeThe ISO timestamp when this test began running
executionTimeFloatThe total time elapsed during the execution of this test
failBooleanThe failure result
invocationIdStringThe identifier of the run step that generated this test
jobIdBigInt!The unique ID of the account in dbt Cloud that this node was generated for
languageStringThe language of this test
metaJSONObjectThe key-value store containing metadata relevant to this node
nameStringThe user-supplied name of this particular node
projectIdBigInt!The unique ID of the account in dbt Cloud that this node was generated for
rawCodeStringThe raw code of this test
rawSqlStringThe raw sql of this test
resourceTypeString!The resource type of this node
runElapsedTimeFloatThe elapsed time of the specific run step (dbt run) that generated this test node
runGeneratedAtDateTimeThe timestamp when the run step (dbt run) was completed, ISO formatted timestamp
runIdBigInt!The unique ID of the account in dbt Cloud that this node was generated for
skipBooleanThe skipped result
stateStringThe test results. Can be one of, in order of severity, "error", "fail", "warn", "pass"
statusStringStatus 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
threadIdStringThe thread that ran the execution of this test
uniqueIdString!The unique ID of this node
warnBooleanThe warning result
0