-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
all: add support for migrate test (#176)
- Loading branch information
Showing
13 changed files
with
10,868 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/bash | ||
echo $@ >> test-out.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
test "migrate" "expected_success" { | ||
migrate { | ||
to = "20230922132634" | ||
} | ||
exec { | ||
sql = "select * from t1" | ||
output = "" | ||
} | ||
} | ||
|
||
test "migrate" "expected_failure" { | ||
migrate { | ||
to = "20230922132634" | ||
} | ||
exec { | ||
sql = "select * from t1" | ||
output = "0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: 'Migrate Test' | ||
description: 'CI for database schema changes with Atlas' | ||
branding: | ||
icon: database | ||
author: 'Ariga' | ||
inputs: | ||
dev-url: | ||
description: | | ||
The URL of the dev-database to use for analysis. For example: `mysql://root:pass@localhost:3306/dev`. | ||
Read more about [dev-databases](https://atlasgo.io/concepts/dev-database). | ||
required: false | ||
dir: | ||
description: | | ||
The URL of the migration directory to apply. For example: `atlas://dir-name` for cloud | ||
based directories or `file://migrations` for local ones. | ||
required: false | ||
run: | ||
description: | | ||
Filter tests to run by regexp. For example, `^test_.*` will only run tests that start with `test_`. | ||
Default is to run all tests. | ||
required: false | ||
config: | ||
description: | | ||
The URL of the Atlas configuration file. By default, Atlas will look for a file | ||
named `atlas.hcl` in the current directory. For example, `file://config/atlas.hcl`. | ||
Learn more about [Atlas configuration files](https://atlasgo.io/atlas-schema/projects). | ||
required: false | ||
env: | ||
description: The environment to use from the Atlas configuration file. For example, `dev`. | ||
required: false | ||
working-directory: | ||
description: Atlas working directory, default is project root | ||
required: false | ||
vars: | ||
description: | | ||
A JSON object containing variables to be used in the Atlas configuration file. | ||
For example, `{"var1": "value1", "var2": "value2"}`. | ||
required: false | ||
runs: | ||
using: node20 | ||
main: dist/index.js |
Oops, something went wrong.