functionbuilder
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Nathan Coad
2023-02-10 16:13:50 +11:00
parent 3cdb2afdd8
commit cb490453d2
23 changed files with 0 additions and 2987 deletions

View File

@@ -1,46 +0,0 @@
url: ""
functions:
- type: subflow
id: call-karate
workflow: karate
start:
type: event
state: call-subflow
event:
type: io.direktiv.function.test
context:
function: 'export-xlsx'
version: '1.0'
states:
- id: call-subflow
type: action
action:
function: call-karate
input:
host: jq(."io.direktiv.function.test".host)
catch:
- error: "*"
transition: report-failure
transition: report-success
- id: report-success
type: generateEvent
event:
type: io.direktiv.function.test.result.karate
source: karate
data: ''
context:
result: success
function: jq(."io.direktiv.function.test".function)
version: jq(."io.direktiv.function.test".version)
- id: report-failure
type: generateEvent
event:
type: io.direktiv.function.test.result.karate
source: karate
data: jq(.error)
context:
result: failure
function: jq(."io.direktiv.function.test".function)
version: jq(."io.direktiv.function.test".version)

View File

@@ -1,22 +0,0 @@
url: ""
functions:
- type: knative-workflow
id: karate
image: gcr.io/direktiv/functions/karate:1.0
states:
- id: run-test
type: action
action:
function: karate
input:
commands:
- command: java -DtestURL=jq(.host) -Dexport-xlsxSecret=jq(.secrets.export-xlsxSecret)
-jar /karate.jar test.feature
print: false
- command: cat target/karate-reports/karate-summary-json.txt
logging: info
secrets:
- export-xlsxSecret
files:
- key: test.feature
scope: workflow

View File

@@ -1,41 +0,0 @@
Feature: Basic
# The secrects can be used in the payload with the following syntax #(mysecretname)
Background:
* def export-xlsxSecret = karate.properties['export-xlsxSecret']
Scenario: get request
Given url karate.properties['testURL']
And path '/'
And header Direktiv-ActionID = 'development'
And header Direktiv-TempDir = '/tmp'
And request
"""
{
"commands": [
{
"command": "ls -la",
"silent": true,
"print": false,
}
]
}
"""
When method POST
Then status 200
And match $ ==
"""
{
"export-xlsx": [
{
"result": "#notnull",
"success": true
}
]
}
"""

View File

@@ -1,44 +0,0 @@
url: ""
functions:
- type: subflow
id: call-tests
workflow: tests
start:
type: event
state: call-subflow
event:
type: io.direktiv.function.test
context:
function: 'export-xlsx'
version: '1.0'
states:
- id: call-subflow
type: action
action:
function: call-tests
catch:
- error: "*"
transition: report-failure
transition: report-success
- id: report-success
type: generateEvent
event:
type: io.direktiv.function.test.result
source: tests
data: ''
context:
result: success
function: jq(."io.direktiv.function.test".function)
version: jq(."io.direktiv.function.test".version)
- id: report-failure
type: generateEvent
event:
type: io.direktiv.function.test.result
source: tests
data: jq(.error)
context:
result: failure
function: jq(."io.direktiv.function.test".function)
version: jq(."io.direktiv.function.test".version)

View File

@@ -1,16 +0,0 @@
url: ""
functions:
- type: knative-workflow
id: export-xlsx
image: registry.coadcorp.com/export-xlsx:test
states:
- id: state0
type: action
action:
function: export-xlsx
input:
files:
- data: "jq(.input) \n"
name: /tmp/input.json
out-filename: example.xlsx
worksheet-name: TestSpreadsheet