-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add test fixture for template creation with exact inputs and co…
…nfigurations
- Loading branch information
1 parent
92e15c9
commit 13334d1
Showing
52 changed files
with
503 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
template test create my-template 0.0.1 --test-name one --inputs-file ./inputs.json --test-projects-file ./projects.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,2 @@ | ||
TEST_KBC_PROJECTS_LOCK_DIR_NAME=.kac-cli-e2e-test-template-test | ||
|
1 change: 1 addition & 0 deletions
1
test/cli/template-test-create/create-test-exactlyOne/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 @@ | ||
0 |
Empty file.
6 changes: 6 additions & 0 deletions
6
test/cli/template-test-create/create-test-exactlyOne/expected-stdout
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,6 @@ | ||
Objects from "keboola/my-template/0.0.1" template: | ||
+ C main/extractor/ex-generic-v2/empty-instance | ||
+ C main/extractor/keboola.ex-db-mysql/with-rows | ||
+ R main/extractor/keboola.ex-db-mysql/with-rows/rows/users | ||
Template "keboola/my-template/0.0.1" has been applied, instance ID: %s | ||
The test was created in folder tests/two. |
26 changes: 26 additions & 0 deletions
26
test/cli/template-test-create/create-test-exactlyOne/in/.keboola/repository.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,26 @@ | ||
{ | ||
"version": 2, | ||
"author": { | ||
"name": "Example Author", | ||
"url": "https://example.com" | ||
}, | ||
"templates": [ | ||
{ | ||
"id": "my-template", | ||
"name": "My Template", | ||
"description": "Full workflow to ...", | ||
"path": "my-template", | ||
"versions": [ | ||
{ | ||
"version": "0.0.1", | ||
"description": "notes", | ||
"stable": false, | ||
"components": [ | ||
"keboola.ex-facebook" | ||
], | ||
"path": "v0" | ||
} | ||
] | ||
} | ||
] | ||
} |
6 changes: 6 additions & 0 deletions
6
test/cli/template-test-create/create-test-exactlyOne/in/inputs.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,6 @@ | ||
{ | ||
"ex-db-mysql-db-host": "host", | ||
"ex-db-mysql-db-password": "##KBC_SECRET_PASSWORD##", | ||
"ex-db-mysql-incremental": false, | ||
"ex-generic-v2-api-base-url": "https://jsonplaceholder.typicode.com" | ||
} |
4 changes: 4 additions & 0 deletions
4
...cli/template-test-create/create-test-exactlyOne/in/my-template/v0/src/README.md
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,4 @@ | ||
### My Template | ||
|
||
Full workflow to ... | ||
|
10 changes: 10 additions & 0 deletions
10
...emplate-test-create/create-test-exactlyOne/in/my-template/v0/src/description.md
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 @@ | ||
# My Template | ||
|
||
## Extended description | ||
- of a template for demo purposes | ||
- from the examples in the API documentation | ||
|
||
## Some Example | ||
``` | ||
with.a.code() | ||
``` |
7 changes: 7 additions & 0 deletions
7
...create-test-exactlyOne/in/my-template/v0/src/extractor/ex-generic-v2/empty/config.jsonnet
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 @@ | ||
{ | ||
parameters: { | ||
api: { | ||
baseUrl: Input("ex-generic-v2-api-base-url"), | ||
}, | ||
}, | ||
} |
1 change: 1 addition & 0 deletions
1
...t-exactlyOne/in/my-template/v0/src/extractor/ex-generic-v2/empty/description.md
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 @@ | ||
test fixture |
3 changes: 3 additions & 0 deletions
3
...e/create-test-exactlyOne/in/my-template/v0/src/extractor/ex-generic-v2/empty/meta.jsonnet
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,3 @@ | ||
{ | ||
name: "empty " + InstanceIdShort(), | ||
} |
8 changes: 8 additions & 0 deletions
8
...t-exactlyOne/in/my-template/v0/src/extractor/keboola.ex-db-mysql/with-rows/config.jsonnet
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,8 @@ | ||
{ | ||
parameters: { | ||
db: { | ||
host: Input("ex-db-mysql-db-host"), | ||
"#password": Input("ex-db-mysql-db-password"), | ||
}, | ||
}, | ||
} |
1 change: 1 addition & 0 deletions
1
...ne/in/my-template/v0/src/extractor/keboola.ex-db-mysql/with-rows/description.md
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 @@ | ||
test fixture |
3 changes: 3 additions & 0 deletions
3
...est-exactlyOne/in/my-template/v0/src/extractor/keboola.ex-db-mysql/with-rows/meta.jsonnet
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,3 @@ | ||
{ | ||
name: "with-rows", | ||
} |
5 changes: 5 additions & 0 deletions
5
...e/in/my-template/v0/src/extractor/keboola.ex-db-mysql/with-rows/rows/users/config.jsonnet
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 @@ | ||
{ | ||
parameters: { | ||
incremental: Input("ex-db-mysql-incremental"), | ||
}, | ||
} |
1 change: 1 addition & 0 deletions
1
...mplate/v0/src/extractor/keboola.ex-db-mysql/with-rows/rows/users/description.md
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 @@ | ||
test fixture |
4 changes: 4 additions & 0 deletions
4
...One/in/my-template/v0/src/extractor/keboola.ex-db-mysql/with-rows/rows/users/meta.jsonnet
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,4 @@ | ||
{ | ||
name: "users", | ||
isDisabled: false, | ||
} |
69 changes: 69 additions & 0 deletions
69
test/cli/template-test-create/create-test-exactlyOne/in/my-template/v0/src/inputs.jsonnet
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,69 @@ | ||
{ | ||
stepsGroups: [ | ||
{ | ||
description: "Default Group", | ||
required: "exactlyOne", | ||
steps: [ | ||
{ | ||
icon: "common:settings", | ||
name: "Default Step 1", | ||
description: "Default Step 1", | ||
inputs: [ | ||
{ | ||
id: "ex-generic-v2-api-base-url", | ||
name: "Api BaseUrl", | ||
description: "a", | ||
type: "string", | ||
kind: "input", | ||
default: "https://jsonplaceholder.typicode.com", | ||
}, | ||
], | ||
}, | ||
{ | ||
icon: "common:settings", | ||
name: "Default Step 2", | ||
description: "Default Step 2", | ||
inputs: [ | ||
{ | ||
id: "ex-db-mysql-db-host", | ||
name: "Db Host", | ||
description: "b", | ||
type: "string", | ||
kind: "input", | ||
default: "mysql.example.com", | ||
}, | ||
], | ||
}, | ||
{ | ||
icon: "common:settings", | ||
name: "Default Step 3", | ||
description: "Default Step 3", | ||
inputs: [ | ||
{ | ||
id: "ex-db-mysql-incremental", | ||
name: "Incremental", | ||
description: "c", | ||
type: "bool", | ||
kind: "confirm", | ||
default: false, | ||
}, | ||
], | ||
}, | ||
{ | ||
icon: "common:settings", | ||
name: "Default Step 4", | ||
description: "Default Step 4", | ||
inputs: [ | ||
{ | ||
id: "ex-db-mysql-db-password", | ||
name: "Db Pass", | ||
description: "b", | ||
type: "string", | ||
kind: "hidden", | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
], | ||
} |
21 changes: 21 additions & 0 deletions
21
test/cli/template-test-create/create-test-exactlyOne/in/my-template/v0/src/manifest.jsonnet
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,21 @@ | ||
{ | ||
configurations: [ | ||
{ | ||
componentId: "ex-generic-v2", | ||
id: ConfigId("empty"), | ||
path: "extractor/ex-generic-v2/empty", | ||
rows: [], | ||
}, | ||
{ | ||
componentId: "keboola.ex-db-mysql", | ||
id: ConfigId("with-rows"), | ||
path: "extractor/keboola.ex-db-mysql/with-rows", | ||
rows: [ | ||
{ | ||
id: ConfigRowId("users"), | ||
path: "rows/users", | ||
}, | ||
], | ||
}, | ||
], | ||
} |
9 changes: 9 additions & 0 deletions
9
test/cli/template-test-create/create-test-exactlyOne/in/projects.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,9 @@ | ||
[ | ||
{ | ||
"host": "%%TEST_KBC_STORAGE_API_HOST%%", | ||
"project":%%TEST_KBC_PROJECT_ID%%, | ||
"stagingStorage": "%%TEST_KBC_PROJECT_STAGING_STORAGE%%", | ||
"backend": "%%TEST_KBC_PROJECT_BACKEND%%", | ||
"token": "%%TEST_KBC_STORAGE_API_TOKEN%%" | ||
} | ||
] |
11 changes: 11 additions & 0 deletions
11
test/cli/template-test-create/create-test-exactlyOne/initial-state.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,11 @@ | ||
{ | ||
"allBranchesConfigs": [], | ||
"branches": [ | ||
{ | ||
"branch": { | ||
"name": "Main", | ||
"isDefault": true | ||
} | ||
} | ||
] | ||
} |
26 changes: 26 additions & 0 deletions
26
test/cli/template-test-create/create-test-exactlyOne/out/.keboola/repository.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,26 @@ | ||
{ | ||
"version": 2, | ||
"author": { | ||
"name": "Example Author", | ||
"url": "https://example.com" | ||
}, | ||
"templates": [ | ||
{ | ||
"id": "my-template", | ||
"name": "My Template", | ||
"description": "Full workflow to ...", | ||
"path": "my-template", | ||
"versions": [ | ||
{ | ||
"version": "0.0.1", | ||
"description": "notes", | ||
"stable": false, | ||
"components": [ | ||
"keboola.ex-facebook" | ||
], | ||
"path": "v0" | ||
} | ||
] | ||
} | ||
] | ||
} |
6 changes: 6 additions & 0 deletions
6
test/cli/template-test-create/create-test-exactlyOne/out/inputs.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,6 @@ | ||
{ | ||
"ex-db-mysql-db-host": "host", | ||
"ex-db-mysql-db-password": "##KBC_SECRET_PASSWORD##", | ||
"ex-db-mysql-incremental": false, | ||
"ex-generic-v2-api-base-url": "https://jsonplaceholder.typicode.com" | ||
} |
4 changes: 4 additions & 0 deletions
4
...li/template-test-create/create-test-exactlyOne/out/my-template/v0/src/README.md
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,4 @@ | ||
### My Template | ||
|
||
Full workflow to ... | ||
|
10 changes: 10 additions & 0 deletions
10
...mplate-test-create/create-test-exactlyOne/out/my-template/v0/src/description.md
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 @@ | ||
# My Template | ||
|
||
## Extended description | ||
- of a template for demo purposes | ||
- from the examples in the API documentation | ||
|
||
## Some Example | ||
``` | ||
with.a.code() | ||
``` |
7 changes: 7 additions & 0 deletions
7
...reate-test-exactlyOne/out/my-template/v0/src/extractor/ex-generic-v2/empty/config.jsonnet
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 @@ | ||
{ | ||
parameters: { | ||
api: { | ||
baseUrl: Input("ex-generic-v2-api-base-url"), | ||
}, | ||
}, | ||
} |
1 change: 1 addition & 0 deletions
1
...-exactlyOne/out/my-template/v0/src/extractor/ex-generic-v2/empty/description.md
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 @@ | ||
test fixture |
3 changes: 3 additions & 0 deletions
3
.../create-test-exactlyOne/out/my-template/v0/src/extractor/ex-generic-v2/empty/meta.jsonnet
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,3 @@ | ||
{ | ||
name: "empty " + InstanceIdShort(), | ||
} |
8 changes: 8 additions & 0 deletions
8
...-exactlyOne/out/my-template/v0/src/extractor/keboola.ex-db-mysql/with-rows/config.jsonnet
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,8 @@ | ||
{ | ||
parameters: { | ||
db: { | ||
host: Input("ex-db-mysql-db-host"), | ||
"#password": Input("ex-db-mysql-db-password"), | ||
}, | ||
}, | ||
} |
1 change: 1 addition & 0 deletions
1
...e/out/my-template/v0/src/extractor/keboola.ex-db-mysql/with-rows/description.md
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 @@ | ||
test fixture |
3 changes: 3 additions & 0 deletions
3
...st-exactlyOne/out/my-template/v0/src/extractor/keboola.ex-db-mysql/with-rows/meta.jsonnet
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,3 @@ | ||
{ | ||
name: "with-rows", | ||
} |
5 changes: 5 additions & 0 deletions
5
.../out/my-template/v0/src/extractor/keboola.ex-db-mysql/with-rows/rows/users/config.jsonnet
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 @@ | ||
{ | ||
parameters: { | ||
incremental: Input("ex-db-mysql-incremental"), | ||
}, | ||
} |
1 change: 1 addition & 0 deletions
1
...mplate/v0/src/extractor/keboola.ex-db-mysql/with-rows/rows/users/description.md
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 @@ | ||
test fixture |
4 changes: 4 additions & 0 deletions
4
...ne/out/my-template/v0/src/extractor/keboola.ex-db-mysql/with-rows/rows/users/meta.jsonnet
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,4 @@ | ||
{ | ||
name: "users", | ||
isDisabled: false, | ||
} |
69 changes: 69 additions & 0 deletions
69
test/cli/template-test-create/create-test-exactlyOne/out/my-template/v0/src/inputs.jsonnet
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,69 @@ | ||
{ | ||
stepsGroups: [ | ||
{ | ||
description: "Default Group", | ||
required: "exactlyOne", | ||
steps: [ | ||
{ | ||
icon: "common:settings", | ||
name: "Default Step 1", | ||
description: "Default Step 1", | ||
inputs: [ | ||
{ | ||
id: "ex-generic-v2-api-base-url", | ||
name: "Api BaseUrl", | ||
description: "a", | ||
type: "string", | ||
kind: "input", | ||
default: "https://jsonplaceholder.typicode.com", | ||
}, | ||
], | ||
}, | ||
{ | ||
icon: "common:settings", | ||
name: "Default Step 2", | ||
description: "Default Step 2", | ||
inputs: [ | ||
{ | ||
id: "ex-db-mysql-db-host", | ||
name: "Db Host", | ||
description: "b", | ||
type: "string", | ||
kind: "input", | ||
default: "mysql.example.com", | ||
}, | ||
], | ||
}, | ||
{ | ||
icon: "common:settings", | ||
name: "Default Step 3", | ||
description: "Default Step 3", | ||
inputs: [ | ||
{ | ||
id: "ex-db-mysql-incremental", | ||
name: "Incremental", | ||
description: "c", | ||
type: "bool", | ||
kind: "confirm", | ||
default: false, | ||
}, | ||
], | ||
}, | ||
{ | ||
icon: "common:settings", | ||
name: "Default Step 4", | ||
description: "Default Step 4", | ||
inputs: [ | ||
{ | ||
id: "ex-db-mysql-db-password", | ||
name: "Db Pass", | ||
description: "b", | ||
type: "string", | ||
kind: "hidden", | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
], | ||
} |
Oops, something went wrong.