forked from deblan/database-anonymizer
[wip] add run tests
This commit is contained in:
parent
9440835453
commit
ae77b65281
3 changed files with 5 additions and 3 deletions
|
|
@ -48,7 +48,7 @@ func TestAppRun(t *testing.T) {
|
||||||
schema, _ := config.LoadSchemaConfigFromFile("../tests/schema.yml")
|
schema, _ := config.LoadSchemaConfigFromFile("../tests/schema.yml")
|
||||||
|
|
||||||
dsns := []string{
|
dsns := []string{
|
||||||
"mysql://root@tcp(service-mysql)/test",
|
"mysql://root:root@tcp(service-mysql)/test",
|
||||||
// "postgres://postgres@tcp(service-postgres)/test",
|
// "postgres://postgres@tcp(service-postgres)/test",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,8 @@ CREATE TABLE `table_truncate1` (
|
||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||||
|
|
||||||
|
INSERT INTO `table_truncate1` (`id`) VALUES (1), (2), (3);
|
||||||
|
|
||||||
|
|
||||||
DROP TABLE IF EXISTS `table_truncate2`;
|
DROP TABLE IF EXISTS `table_truncate2`;
|
||||||
CREATE TABLE `table_truncate2` (
|
CREATE TABLE `table_truncate2` (
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
rules:
|
rules:
|
||||||
actions:
|
actions:
|
||||||
- table: table_truncate1
|
- table: table_truncate1
|
||||||
truncate: false
|
truncate: true
|
||||||
|
|
||||||
- table: table_truncate2
|
- table: table_truncate2
|
||||||
query: 'select * from table_truncate2 where delete_me=1'
|
query: 'select * from table_truncate2 where delete_me=1'
|
||||||
truncate: false
|
truncate: true
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue