-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add sanity check from plugin repository
- Loading branch information
1 parent
883dbb6
commit 864969d
Showing
10 changed files
with
278 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,30 @@ | ||
id: archive | ||
namespace: qa | ||
|
||
tasks: | ||
- id: download | ||
type: io.kestra.plugin.core.http.Download | ||
uri: https://sample-files.com/downloads/compressed/zip/basic-text.zip | ||
|
||
- id: decompress | ||
type: io.kestra.plugin.compress.ArchiveDecompress | ||
from: "{{ outputs.download.uri }}" | ||
algorithm: ZIP | ||
|
||
- id: assertFiles | ||
type: io.kestra.plugin.core.execution.Fail | ||
condition: "{{ outputs.decompress.files | length != 6}}" | ||
|
||
- id: compress | ||
type: io.kestra.plugin.compress.ArchiveCompress | ||
from: "{{ outputs.decompress.files }}" | ||
algorithm: JAR | ||
|
||
- id: decompress2 | ||
type: io.kestra.plugin.compress.ArchiveDecompress | ||
from: "{{ outputs.compress.uri }}" | ||
algorithm: JAR | ||
|
||
- id: assertContent | ||
type: io.kestra.plugin.core.execution.Fail | ||
condition: '{{ read(outputs.decompress2.files["readme.txt"]) != "This sample ZIP file is provided by Sample-Files.com. Visit us for more sample files and resources."}}' |
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,13 @@ | ||
id: download | ||
namespace: qa | ||
|
||
tasks: | ||
- id: download | ||
type: io.kestra.plugin.core.http.Download | ||
uri: https://huggingface.co/datasets/kestra/datasets/raw/main/csv/orders.csv | ||
|
||
- id: assert | ||
type: io.kestra.plugin.core.execution.Assert | ||
conditions: | ||
- "{{ outputs.download.length == 5837 }}" | ||
- "{{ outputs.download.code == 200 }}" |
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,13 @@ | ||
id: request | ||
namespace: qa | ||
|
||
tasks: | ||
- id: request | ||
type: io.kestra.plugin.core.http.Request | ||
uri: https://dummyjson.com/products | ||
|
||
- id: assert | ||
type: io.kestra.plugin.core.execution.Assert | ||
conditions: | ||
- "{{ outputs.request.code == 200 }}" | ||
- "{{ json(outputs.request.body).products[0].id == 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,34 @@ | ||
id: all | ||
namespace: sanitycheck.plugin.redis | ||
|
||
tasks: | ||
- id: init | ||
type: io.kestra.plugin.core.output.OutputValues | ||
values: | ||
randomPort: "{{ randomPort() }}" | ||
|
||
- id: dockerStart | ||
type: io.kestra.plugin.docker.Run | ||
containerImage: redis | ||
portBindings: | ||
- "{{ outputs.init.values.randomPort }}:6379" | ||
wait: false | ||
|
||
- id: parallel | ||
type: io.kestra.plugin.core.flow.ForEach | ||
values: ["keys-json", "keys-string", "list-json", "list-string"] | ||
concurrencyLimit: 0 | ||
tasks: | ||
- id: subflow | ||
type: io.kestra.plugin.core.flow.Subflow | ||
namespace: "{{ flow.namespace }}" | ||
flowId: "{{ taskrun.value }}" | ||
wait: true | ||
transmitFailed: true | ||
inputs: | ||
cs: "redis://:redis@localhost:{{ outputs.init.values.randomPort }}/0" | ||
|
||
finally: | ||
- id: dockerStop | ||
type: io.kestra.plugin.docker.Stop | ||
containerId: "{{ outputs.dockerStart.taskRunner.containerId }}" |
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,32 @@ | ||
id: keys-json | ||
namespace: sanitycheck.plugin.redis | ||
|
||
inputs: | ||
- id: cs | ||
type: STRING | ||
defaults: "redis://:redis@localhost:6379/0" | ||
|
||
tasks: | ||
- id: set | ||
type: io.kestra.plugin.redis.string.Set | ||
url: "{{ inputs.cs }}" | ||
serdeType: JSON | ||
key: "key_json_{{ execution.id }}" | ||
value: | | ||
{{ { | ||
"flow": flow.id, | ||
"namespace": flow.namespace | ||
} | toJson }} | ||
- id: get | ||
type: io.kestra.plugin.redis.string.Get | ||
url: "{{ inputs.cs }}" | ||
serdeType: JSON | ||
key: "key_json_{{ execution.id }}" | ||
|
||
- id: assert | ||
type: io.kestra.plugin.core.execution.Assert | ||
errorMessage: "Invalid get data {{ outputs.get.data.flow }}" | ||
conditions: | ||
- "{{ outputs.get.data.flow == flow.id }}" | ||
- "{{ outputs.get.data.namespace == flow.namespace }}" |
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,45 @@ | ||
id: keys-string | ||
namespace: sanitycheck.plugin.redis | ||
|
||
inputs: | ||
- id: cs | ||
type: STRING | ||
defaults: "redis://:redis@localhost:6379/0" | ||
|
||
tasks: | ||
- id: set | ||
type: io.kestra.plugin.redis.string.Set | ||
url: "{{ inputs.cs }}" | ||
key: "key_string_{{ execution.id }}" | ||
value: "{{ flow.id }}" | ||
serdeType: STRING | ||
|
||
- id: get | ||
type: io.kestra.plugin.redis.string.Get | ||
url: "{{ inputs.cs }}" | ||
key: "key_string_{{ execution.id }}" | ||
serdeType: STRING | ||
|
||
- id: assert | ||
type: io.kestra.plugin.core.execution.Assert | ||
errorMessage: "Invalid get data {{ outputs.get }}" | ||
conditions: | ||
- "{{ outputs.get.data == flow.id }}" | ||
|
||
- id: delete | ||
type: io.kestra.plugin.redis.string.Delete | ||
url: "{{ inputs.cs }}" | ||
keys: | ||
- "key_string_{{ execution.id }}" | ||
|
||
- id: getAfterDelete | ||
type: io.kestra.plugin.redis.string.Get | ||
url: "{{ inputs.cs }}" | ||
key: "key_string_{{ execution.id }}" | ||
serdeType: STRING | ||
|
||
- id: assertAfterDelete | ||
type: io.kestra.plugin.core.execution.Assert | ||
errorMessage: "Invalid get data {{ outputs.getAfterDelete }}" | ||
conditions: | ||
- "{{ (outputs.getAfterDelete contains 'data') == false }}" |
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,35 @@ | ||
id: list-json | ||
namespace: sanitycheck.plugin.redis | ||
|
||
inputs: | ||
- id: cs | ||
type: STRING | ||
defaults: "redis://:redis@localhost:6379/0" | ||
|
||
tasks: | ||
- id: push | ||
type: io.kestra.plugin.redis.list.ListPush | ||
url: "{{ inputs.cs }}" | ||
serdeType: JSON | ||
key: "list_json_{{ execution.id }}" | ||
from: | ||
- | | ||
{{ { | ||
"flow": flow.id, | ||
"namespace": flow.namespace | ||
} | toJson }} | ||
- id: pop | ||
type: io.kestra.plugin.redis.list.ListPop | ||
url: "{{ inputs.cs }}" | ||
serdeType: JSON | ||
key: "list_json_{{ execution.id }}" | ||
maxRecords: 1 | ||
|
||
- id: assert | ||
type: io.kestra.plugin.core.execution.Assert | ||
errorMessage: "Invalid get data {{ outputs.pop }} with uri data {{ fromIon(read(outputs.pop.uri)) }}" | ||
conditions: | ||
- "{{ outputs.pop.count == 1 }}" | ||
- "{{ fromIon(read(outputs.pop.uri)).flow == flow.id }}" | ||
- "{{ fromIon(read(outputs.pop.uri)).namespace == flow.namespace }}" |
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,32 @@ | ||
id: list-string | ||
namespace: sanitycheck.plugin.redis | ||
|
||
inputs: | ||
- id: cs | ||
type: STRING | ||
defaults: "redis://:redis@localhost:6379/0" | ||
|
||
tasks: | ||
- id: push | ||
type: io.kestra.plugin.redis.list.ListPush | ||
url: "{{ inputs.cs }}" | ||
key: "list_string_{{ execution.id }}" | ||
serdeType: STRING | ||
from: | ||
- "{{ execution.id }}" | ||
- "{{ flow.id }}" | ||
|
||
- id: pop | ||
type: io.kestra.plugin.redis.list.ListPop | ||
url: "{{ inputs.cs }}" | ||
key: "list_string_{{ execution.id }}" | ||
serdeType: STRING | ||
maxRecords: 2 | ||
|
||
- id: assert | ||
type: io.kestra.plugin.core.execution.Assert | ||
errorMessage: "Invalid get data {{ outputs.pop }}" | ||
conditions: | ||
- "{{ outputs.pop.count == 2 }}" | ||
- "{{ fromIon(read(outputs.pop.uri), allRows=true) contains execution.id }}" | ||
- "{{ fromIon(read(outputs.pop.uri), allRows=true) contains flow.id }}" |
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 @@ | ||
id: csv_to_ion | ||
namespace: qa | ||
|
||
tasks: | ||
- id: create_csv | ||
type: io.kestra.plugin.core.http.Download | ||
uri: https://huggingface.co/datasets/kestra/datasets/raw/main/csv/orders.csv | ||
|
||
- id: convert_to_ion | ||
type: io.kestra.plugin.serdes.csv.CsvToIon | ||
from: "{{ outputs.create_csv.uri}}" | ||
|
||
- id: assertIon | ||
type: io.kestra.plugin.core.execution.Fail | ||
condition: '{{ fromIon(read(outputs.convert_to_ion.uri)).order_id != "1"}}' | ||
|
||
- id: ion_to_csv | ||
type: io.kestra.plugin.serdes.csv.IonToCsv | ||
from: "{{ outputs.convert_to_ion.uri }}" |
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,25 @@ | ||
id: ion_to_excel | ||
namespace: qa | ||
variables: | ||
sheet_title: my_sheet-123 | ||
tasks: | ||
- id: create_csv | ||
type: io.kestra.plugin.core.http.Download | ||
uri: https://huggingface.co/datasets/kestra/datasets/raw/main/csv/orders.csv | ||
|
||
- id: convert_to_ion | ||
type: io.kestra.plugin.serdes.csv.CsvToIon | ||
from: "{{ outputs.create_csv.uri}}" | ||
|
||
|
||
- id: convert_to_excel | ||
type: io.kestra.plugin.serdes.excel.IonToExcel | ||
from: "{{ outputs.convert_to_ion.uri}}" | ||
sheetsTitle: "{{ vars.sheet_title }}" | ||
|
||
|
||
- id: excel_to_ion | ||
type: io.kestra.plugin.serdes.excel.ExcelToIon | ||
from: "{{ outputs.convert_to_excel.uri }}" | ||
sheetsTitle: | ||
- "{{ vars.sheet_title }}" |