Skip to content

Commit

Permalink
feat: add test fixture for template creation with exact inputs and co…
Browse files Browse the repository at this point in the history
…nfigurations
  • Loading branch information
hosekpeter committed Feb 14, 2025
1 parent 92e15c9 commit 2a61453
Show file tree
Hide file tree
Showing 52 changed files with 503 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/cli/template-test-create/create-test-exactlyOne/args
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
2 changes: 2 additions & 0 deletions test/cli/template-test-create/create-test-exactlyOne/env
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

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0
Empty file.
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.
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"
}
]
}
]
}
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"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
### My Template

Full workflow to ...

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()
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
parameters: {
api: {
baseUrl: Input("ex-generic-v2-api-base-url"),
},
},
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test fixture
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
name: "empty " + InstanceIdShort(),
}
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"),
},
},
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test fixture
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
name: "with-rows",
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
parameters: {
incremental: Input("ex-db-mysql-incremental"),
},
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test fixture
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
name: "users",
isDisabled: false,
}
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",
},
],
},
],
},
],
}
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",
},
],
},
],
}
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%%"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"allBranchesConfigs": [],
"branches": [
{
"branch": {
"name": "Main",
"isDefault": true
}
}
]
}
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"
}
]
}
]
}
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"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
### My Template

Full workflow to ...

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()
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
parameters: {
api: {
baseUrl: Input("ex-generic-v2-api-base-url"),
},
},
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test fixture
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
name: "empty " + InstanceIdShort(),
}
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"),
},
},
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test fixture
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
name: "with-rows",
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
parameters: {
incremental: Input("ex-db-mysql-incremental"),
},
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test fixture
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
name: "users",
isDisabled: false,
}
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",
},
],
},
],
},
],
}
Loading

0 comments on commit 2a61453

Please sign in to comment.