-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f29a9e2
commit 32a5831
Showing
73 changed files
with
781 additions
and
390 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 @@ | ||
1 |
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 @@ | ||
Hostname "mysql" with port "3306" is not approved. |
Empty file.
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,18 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Keboola\DbWriter\TestsFunctional\DatadirTest; | ||
|
||
return function (DatadirTest $test): void { | ||
$sql = <<<SQL | ||
CREATE TABLE `simple` ( | ||
`id` int(11) NOT NULL AUTO_INCREMENT, | ||
`name` varchar(255) NOT NULL, | ||
`value` int(11) NOT NULL, | ||
PRIMARY KEY (`id`) | ||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; | ||
SQL; | ||
|
||
$test->connection->exec($sql); | ||
}; |
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,23 @@ | ||
{ | ||
"action": "getTablesInfo", | ||
"parameters": { | ||
"writer_class": "Common", | ||
"data_dir": "/data", | ||
"db": { | ||
"driver": "mysql", | ||
"host": "%env(string:COMMON_DB_HOST)%", | ||
"port": "%env(string:COMMON_DB_PORT)%", | ||
"database": "%env(string:COMMON_DB_DATABASE)%", | ||
"user": "%env(string:COMMON_DB_USER)%", | ||
"#password": "%env(string:COMMON_DB_PASSWORD)%" | ||
} | ||
}, | ||
"image_parameters": { | ||
"approvedHostnames": [ | ||
{ | ||
"host": "unknownHostname", | ||
"port": "%env(string:COMMON_DB_PORT)%" | ||
} | ||
] | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
tests/functional/error-check-hostname-empty-array/expected-code
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 @@ | ||
1 |
1 change: 1 addition & 0 deletions
1
tests/functional/error-check-hostname-empty-array/expected-stderr
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 @@ | ||
Hostname "mysql" with port "3306" is not approved. |
Empty file.
18 changes: 18 additions & 0 deletions
18
tests/functional/error-check-hostname-empty-array/setUp.php
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,18 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Keboola\DbWriter\TestsFunctional\DatadirTest; | ||
|
||
return function (DatadirTest $test): void { | ||
$sql = <<<SQL | ||
CREATE TABLE `simple` ( | ||
`id` int(11) NOT NULL AUTO_INCREMENT, | ||
`name` varchar(255) NOT NULL, | ||
`value` int(11) NOT NULL, | ||
PRIMARY KEY (`id`) | ||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; | ||
SQL; | ||
|
||
$test->connection->exec($sql); | ||
}; |
18 changes: 18 additions & 0 deletions
18
tests/functional/error-check-hostname-empty-array/source/data/config.json
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,18 @@ | ||
{ | ||
"action": "getTablesInfo", | ||
"parameters": { | ||
"writer_class": "Common", | ||
"data_dir": "/data", | ||
"db": { | ||
"driver": "mysql", | ||
"host": "%env(string:COMMON_DB_HOST)%", | ||
"port": "%env(string:COMMON_DB_PORT)%", | ||
"database": "%env(string:COMMON_DB_DATABASE)%", | ||
"user": "%env(string:COMMON_DB_USER)%", | ||
"#password": "%env(string:COMMON_DB_PASSWORD)%" | ||
} | ||
}, | ||
"image_parameters": { | ||
"approvedHostnames": [] | ||
} | ||
} |
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 @@ | ||
0 |
Empty file.
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 @@ | ||
{"status":"success","tables":{"simple":[{"Field":"id","Type":"int(11)","Null":"NO","Key":"PRI","Default":null,"Extra":"auto_increment"},{"Field":"name","Type":"varchar(255)","Null":"NO","Key":"","Default":null,"Extra":""},{"Field":"value","Type":"int(11)","Null":"NO","Key":"","Default":null,"Extra":""}]}} |
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,18 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Keboola\DbWriter\TestsFunctional\DatadirTest; | ||
|
||
return function (DatadirTest $test): void { | ||
$sql = <<<SQL | ||
CREATE TABLE `simple` ( | ||
`id` int(11) NOT NULL AUTO_INCREMENT, | ||
`name` varchar(255) NOT NULL, | ||
`value` int(11) NOT NULL, | ||
PRIMARY KEY (`id`) | ||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; | ||
SQL; | ||
|
||
$test->connection->exec($sql); | ||
}; |
23 changes: 23 additions & 0 deletions
23
tests/functional/error-check-hostname/source/data/config.json
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,23 @@ | ||
{ | ||
"action": "getTablesInfo", | ||
"parameters": { | ||
"writer_class": "Common", | ||
"data_dir": "/data", | ||
"db": { | ||
"driver": "mysql", | ||
"host": "%env(string:COMMON_DB_HOST)%", | ||
"port": "%env(string:COMMON_DB_PORT)%", | ||
"database": "%env(string:COMMON_DB_DATABASE)%", | ||
"user": "%env(string:COMMON_DB_USER)%", | ||
"#password": "%env(string:COMMON_DB_PASSWORD)%" | ||
} | ||
}, | ||
"image_parameters": { | ||
"approvedHostnames": [ | ||
{ | ||
"host": "%env(string:COMMON_DB_HOST)%", | ||
"port": "%env(string:COMMON_DB_PORT)%" | ||
} | ||
] | ||
} | ||
} |
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 @@ | ||
1 |
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 @@ | ||
Table "invalidtable" in storage input mapping cannot be found. |
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 @@ | ||
Creating PDO connection to "mysql:host=mysql;port=3306;dbname=testdb;charset=utf8". |
Empty file.
Empty file.
62 changes: 62 additions & 0 deletions
62
tests/functional/error-invalid-input-mapping/source/data/config.json
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,62 @@ | ||
{ | ||
"parameters": { | ||
"writer_class": "Common", | ||
"data_dir": "/data", | ||
"db": { | ||
"driver": "mysql", | ||
"host": "%env(string:COMMON_DB_HOST)%", | ||
"port": "%env(string:COMMON_DB_PORT)%", | ||
"database": "%env(string:COMMON_DB_DATABASE)%", | ||
"user": "%env(string:COMMON_DB_USER)%", | ||
"#password": "%env(string:COMMON_DB_PASSWORD)%" | ||
}, | ||
"tableId": "invalidtable", | ||
"dbName": "simple", | ||
"incremental": true, | ||
"primaryKey": [ | ||
"id" | ||
], | ||
"items": [ | ||
{ | ||
"name": "id", | ||
"dbName": "id", | ||
"type": "int", | ||
"size": null, | ||
"nullable": null, | ||
"default": null | ||
}, | ||
{ | ||
"name": "name", | ||
"dbName": "name", | ||
"type": "VARCHAR", | ||
"size": 255, | ||
"nullable": null, | ||
"default": null | ||
}, | ||
{ | ||
"name": "glasses", | ||
"dbName": "glasses", | ||
"type": "VARCHAR", | ||
"size": 20, | ||
"nullable": null, | ||
"default": null | ||
} | ||
] | ||
}, | ||
"storage": { | ||
"input": { | ||
"tables": [ | ||
{ | ||
"source": "simple", | ||
"destination": "simple.csv", | ||
"columns": [ | ||
"id", | ||
"name", | ||
"glasses", | ||
"age" | ||
] | ||
} | ||
] | ||
} | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
tests/functional/error-invalid-input-mapping/source/data/in/tables/simple.csv
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,10 @@ | ||
"id","name","glasses" | ||
"0","Miro cillik","yes" | ||
"1","Ondrej Hlavacek","no" | ||
"2","Martin Halamicek","yes" | ||
"3","Tomas Kacur","yes" | ||
"4","Erik Zigo","no" | ||
"5","Marc Raiser","sometimes" | ||
"6","Petr Simecek","yes" | ||
"7","Jakub Matejka","yes" | ||
"8","Ondrej Popelka","no" |
7 changes: 7 additions & 0 deletions
7
tests/functional/error-invalid-input-mapping/source/data/in/tables/simple.csv.manifest
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,7 @@ | ||
{ | ||
"columns": [ | ||
"id", | ||
"name", | ||
"glasses" | ||
] | ||
} |
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 @@ | ||
1 |
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 @@ | ||
Unable to create ssh tunnel. Output: ErrorOutput: ssh: Could not resolve hostname unknownhost: Name or service not known Retries count: 5 |
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,5 @@ | ||
Creating SSH tunnel to 'unknownHost' on local port '33006' | ||
Unable to create ssh tunnel. Output: ErrorOutput: ssh: Could not resolve hostname unknownhost: Name or service not known . Retrying... [1x] | ||
Unable to create ssh tunnel. Output: ErrorOutput: ssh: Could not resolve hostname unknownhost: Name or service not known . Retrying... [2x] | ||
Unable to create ssh tunnel. Output: ErrorOutput: ssh: Could not resolve hostname unknownhost: Name or service not known . Retrying... [3x] | ||
Unable to create ssh tunnel. Output: ErrorOutput: ssh: Could not resolve hostname unknownhost: Name or service not known . Retrying... [4x] |
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,10 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Keboola\DbWriter\TestsFunctional\DatadirTest; | ||
|
||
return function (DatadirTest $test): void { | ||
putenv('SSH_PUBLIC_KEY=' . file_get_contents('/root/.ssh/id_rsa.pub')); | ||
putenv('SSH_PRIVATE_KEY=' . file_get_contents('/root/.ssh/id_rsa')); | ||
}; |
Oops, something went wrong.