Giter Club home page Giter Club logo

Comments (3)

ap-gun avatar ap-gun commented on June 12, 2024 1

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.

k1LoW avatar k1LoW commented on June 12, 2024 1

Thank you!

Please use >= v0.91.2 !!

from runn.

k1LoW avatar k1LoW commented on June 12, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.