Atlas Testing
test migrate
The test "migrate" "name"
block describes a migrate test case.
test "migrate" "20240613061102" {
migrate {
to = "20240613061046"
}
exec {
sql = "INSERT INTO users (name) VALUES ('Ada Lovelace')"
}
migrate {
to = "20240613061102"
}
exec {
sql = "SELECT first_name,last_name FROM users"
output = "Ada, Lovelace"
}
}
Attributes
Name | Required | Value |
---|---|---|
skip | false | bool |
Blocks
test.assert
test.assert
attributes
Name | Required | Value |
---|---|---|
error_message | false | string |
sql | true | string |
test.assert
constraints
Constraint | Value |
---|---|
Required | false |
Require Name | false |
Repeatable | true |
Allow unknown blocks | false |
Allow unknown attributes | false |
test.catch
test.catch
attributes
Name | Required | Value |
---|---|---|
error | false | string |
sql | true | string |
test.catch
constraints
Constraint | Value |
---|---|
Required | false |
Require Name | false |
Repeatable | true |
Allow unknown blocks | false |
Allow unknown attributes | false |
test.exec
test.exec
attributes
Name | Required | Value |
---|---|---|
format | false |
|
match | false | string |
output | false | string |
sql | true | string |
test.exec
constraints
Constraint | Value |
---|---|
Required | false |
Require Name | false |
Repeatable | true |
Allow unknown blocks | false |
Allow unknown attributes | false |
Mutually exclusive sets | [output, match] |
test.external
The external
allows executing external programs to insert data or run assertions on the dev-database used by test case.
external {
program = [
"go", "run", "seed.go",
"--dev-url", testing.dev_url,
]
}
test.external
attributes
Name | Required | Value |
---|---|---|
match | false | string |
output | false | string |
program | true | List of strings |
working_dir | false | string |
test.external
constraints
Constraint | Value |
---|---|
Required | false |
Require Name | false |
Repeatable | true |
Allow unknown blocks | false |
Allow unknown attributes | false |
Mutually exclusive sets | [output, match] |
test.log
test.log
attributes
Name | Required | Value |
---|---|---|
message | true | string |
test.log
constraints
Constraint | Value |
---|---|
Required | false |
Require Name | false |
Repeatable | true |
Allow unknown blocks | false |
Allow unknown attributes | false |