Comments (3)
Oh, it was a version issue.
Updating to the latest version resulted in the expected outcomeπ
Just in case, I will document the results from the version before the update.
$ runn --version
runn version 0.90.2
$ cat tmp.yaml
runners:
req: https://httpbin.org
steps:
-
req:
/get?var={{ i }}:
get:
body:
application/json:
null
loop:
count: 2
bind:
loopvar: current.res
'looparr[]': current.res
-
dump: loopvar # ok, last response
-
dump: looparr # null
$ runn run tmp.yaml
{
"body": {
"args": {
"var": "1"
},
"headers": {
"Accept-Encoding": "gzip",
"Content-Type": "application/json",
"Host": "httpbin.org",
"User-Agent": "Go-http-client/2.0",
"X-Amzn-Trace-Id": "Root=1-65768036-7c85ee851dfcc2b5054b0579"
},
"url": "https://httpbin.org/get?var=1"
},
"cookies": {},
"headers": {
"Access-Control-Allow-Credentials": [
"true"
],
"Access-Control-Allow-Origin": [
"*"
],
"Content-Length": [
"337"
],
"Content-Type": [
"application/json"
],
"Date": [
"Mon, 11 Dec 2023 03:21:26 GMT"
],
"Server": [
"gunicorn/19.9.0"
]
},
"rawBody": "{\n \"args\": {\n \"var\": \"1\"\n }, \n \"headers\": {\n \"Accept-Encoding\": \"gzip\", \n \"Content-Type\": \"application/json\", \n \"Host\": \"httpbin.org\", \n \"User-Agent\": \"Go-http-client/2.0\", \n \"X-Amzn-Trace-Id\": \"Root=1-65768036-7c85ee851dfcc2b5054b0579\"\n }, \n \"url\": \"https://httpbin.org/get?var=1\"\n}\n",
"status": 200
}
null
.
1 scenario, 0 skipped, 0 failures
Anyway, thank you. It worked out well!
from runn.
Thank you!
Please use >= v0.91.2 !!
from runn.
@ap-gun Thank you for your report.
I couldn't reproduce it at hand. Could you tell me the result of running runn --version
?
$ runn --version
runn version 0.91.1
$ cat tmp.yml
runners:
req: https://httpbin.org
steps:
-
req:
/get?var={{ i }}:
get:
body:
application/json:
null
loop:
count: 2
bind:
loopvar: current.res
'looparr[]': current.res
-
dump: loopvar # ok, last response
-
dump: looparr # null
$ runn run tmp.yml
{
"body": {
"args": {
"var": "1"
},
"headers": {
"Accept-Encoding": "gzip",
"Content-Type": "application/json",
"Host": "httpbin.org",
"User-Agent": "Go-http-client/2.0",
"X-Amzn-Trace-Id": "Root=1-65767773-7f875fc07f6484f620a70a7d"
},
"origin": "123.198.33.120",
"url": "https://httpbin.org/get?var=1"
},
"cookies": {},
"headers": {
"Access-Control-Allow-Credentials": [
"true"
],
"Access-Control-Allow-Origin": [
"*"
],
"Content-Length": [
"338"
],
"Content-Type": [
"application/json"
],
"Date": [
"Mon, 11 Dec 2023 02:44:03 GMT"
],
"Server": [
"gunicorn/19.9.0"
]
},
"rawBody": "{\n \"args\": {\n \"var\": \"1\"\n }, \n \"headers\": {\n \"Accept-Encoding\": \"gzip\", \n \"Content-Type\": \"application/json\", \n \"Host\": \"httpbin.org\", \n \"User-Agent\": \"Go-http-client/2.0\", \n \"X-Amzn-Trace-Id\": \"Root=1-65767773-7f875fc07f6484f620a70a7d\"\n }, \n \"origin\": \"123.198.33.120\", \n \"url\": \"https://httpbin.org/get?var=1\"\n}\n",
"status": 200
}
[
{
"body": {
"args": {
"var": "1"
},
"headers": {
"Accept-Encoding": "gzip",
"Content-Type": "application/json",
"Host": "httpbin.org",
"User-Agent": "Go-http-client/2.0",
"X-Amzn-Trace-Id": "Root=1-65767773-7f875fc07f6484f620a70a7d"
},
"origin": "123.198.33.120",
"url": "https://httpbin.org/get?var=1"
},
"cookies": {},
"headers": {
"Access-Control-Allow-Credentials": [
"true"
],
"Access-Control-Allow-Origin": [
"*"
],
"Content-Length": [
"338"
],
"Content-Type": [
"application/json"
],
"Date": [
"Mon, 11 Dec 2023 02:44:03 GMT"
],
"Server": [
"gunicorn/19.9.0"
]
},
"rawBody": "{\n \"args\": {\n \"var\": \"1\"\n }, \n \"headers\": {\n \"Accept-Encoding\": \"gzip\", \n \"Content-Type\": \"application/json\", \n \"Host\": \"httpbin.org\", \n \"User-Agent\": \"Go-http-client/2.0\", \n \"X-Amzn-Trace-Id\": \"Root=1-65767773-7f875fc07f6484f620a70a7d\"\n }, \n \"origin\": \"123.198.33.120\", \n \"url\": \"https://httpbin.org/get?var=1\"\n}\n",
"status": 200
},
{
"body": {
"args": {
"var": "1"
},
"headers": {
"Accept-Encoding": "gzip",
"Content-Type": "application/json",
"Host": "httpbin.org",
"User-Agent": "Go-http-client/2.0",
"X-Amzn-Trace-Id": "Root=1-65767773-7f875fc07f6484f620a70a7d"
},
"origin": "123.198.33.120",
"url": "https://httpbin.org/get?var=1"
},
"cookies": {},
"headers": {
"Access-Control-Allow-Credentials": [
"true"
],
"Access-Control-Allow-Origin": [
"*"
],
"Content-Length": [
"338"
],
"Content-Type": [
"application/json"
],
"Date": [
"Mon, 11 Dec 2023 02:44:03 GMT"
],
"Server": [
"gunicorn/19.9.0"
]
},
"rawBody": "{\n \"args\": {\n \"var\": \"1\"\n }, \n \"headers\": {\n \"Accept-Encoding\": \"gzip\", \n \"Content-Type\": \"application/json\", \n \"Host\": \"httpbin.org\", \n \"User-Agent\": \"Go-http-client/2.0\", \n \"X-Amzn-Trace-Id\": \"Root=1-65767773-7f875fc07f6484f620a70a7d\"\n }, \n \"origin\": \"123.198.33.120\", \n \"url\": \"https://httpbin.org/get?var=1\"\n}\n",
"status": 200
}
]
.
1 scenario, 0 skipped, 0 failures
$
( Apart from the above, I found a bug where the respective responses are not retained, so I will fix it. )
from runn.
Related Issues (20)
- Is there way runn test of grpc with using "buf/validate/validate.proto" in proto ? HOT 5
- concurrency: option seems not working HOT 2
- π bug: Error messages are not displayed correctly HOT 1
- [Feature request] Add diff output when compare() returns false HOT 3
- How to specify an absolute path to load JSON file HOT 5
- Including string literal `{{ ... }}` in HTTP request body HOT 3
- Encountering Strange Behavior when upgrading runn HOT 4
- SQL SELECT statements with comments cannot be executed in db runner HOT 1
- pb33f/libopenapi does not support nullable attribute HOT 6
- OpenAPI validation fails for range of response codes (4XX, 5XX, ...) HOT 1
- OpenAPI validation fails on Multiple methods defined on the same path HOT 9
- fatal error: concurrent map writes HOT 3
- Could not continue execute other cases after failure case HOT 6
- How to use .env value in scenario.yaml HOT 3
- Panic occurs while validating OpenAPI response HOT 1
- Include runner ignores values after newline in variable HOT 1
- [Feature request] Time instance creation built-in functions HOT 3
- Unable to Use `vars` in `runners.endpoint` HOT 1
- [Feature request] Allow negative filtering by labels HOT 2
- [Feature Request] Allow passing enviroment variables by file HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from runn.