fn
fn copied to clipboard
Fn test --remote wraps test input into extra object
Description
fn test --remote seems to have a slightly incorrect behavior. It wraps input in additional { "Body": ... } object.
Steps to reproduce the issue:
$ fn init --runtime=node js
$ cd js/
$ cat <<EOF > func.js
var fdk=require('@fnproject/fdk');
fdk.handle(function(input){
return input;
})
EOF
$ cat <<EOF > test.json
{
"tests": [
{
"input": {
"body": {
"first_name": "Johnny",
"last_name": "Smith"
}
},
"output": {
"body": {
"first_name": "Johnny",
"last_name": "Smith"
}
}
}
]
}
EOF
$ cat <<EOF > func.yaml
name: js
version: 0.0.1
runtime: node
entrypoint: node func.js
format: json
path: /js
EOF
Describe the results you received:




fn test --remoteresulted in PASSED statusfn test --remotewrapped input into a extra object so function received unexpected input and test is actually failed
Describe the results you expected:
fn test --remote should not be different from fn test in handling tests.json
Additional information you deem important (e.g. issue happens only occasionally):
Same behavior for other runtimes (at least with node and python).
Output of fn version (CLI command):
fn version 0.4.117