Giter Club home page Giter Club logo

Comments (10)

k1LoW avatar k1LoW commented on June 12, 2024

invalid path: req

CleanShot 2023-06-07 at 14 50 18

First, the red box looks incorrect as YAML syntax.

Also, sc is an SSH Runner and does not need to be specified for HTTP Requests.

I can't be sure because it is hidden by an xxx, but it seems to work correctly with the following modification.

desc: api test in ssh server
runners:
  sc:
    host:  jump
    keepSession: true
  req:
    endpoint: https:/xxx/xxxxx
steps:
  jump_ls:
    req:
      xxxxx:
        get:
          headers:
            Content-Type: application/json
            Host: xxxx
            X-API-KEY: xxxxx
     test: steps.xxxx.res.status == 200

See also (Japanese / Paid content): https://zenn.dev/k1low/books/runn-cookbook/viewer/ssh-port-forwarding

from runn.

t-kitamura-axel avatar t-kitamura-axel commented on June 12, 2024

Thank you for advice.
But I have error. Client.Timeout exceeded while awaiting headers
Detail bellow, Is this not runn's yaml setting but my api and header miss in docker container?
I reffer to this link

  • err message
Run 'req' on 'xxxxx'.steps.xxxx_example
-----START HTTP REQUEST-----
GET /xxx/xxx/xxx/xx/xxxx/example HTTP/1.1
Host: vpce-xxxx.xxxx-api.xxx.vpce.amazonaws.com
Accept: application/json
Content-Type: application/json
X-Api-Key: xxxxxxxxxxx


-----END HTTP REQUEST-----
xxx xxx xxxx ... failed to run test/api-test.yaml: http request failed on 'xxxx'.steps.xxxx_example: Get "https://xxxxx.xxx-api.xxxx.vpce.amazonaws.com/xxx/xxx/xxx/xx/xxxxx/example": context deadline exceeded (Client.Timeout exceeded while awaiting headers)
  • yaml
runners:
  sc:
    host:  xxxxx
    keepSession: true
  req:
    endpoint: https://vpce-xxxx.xxx-api.xxx.vpce.amazonaws.com/xxx
debug: true
steps:
  xxx_example:
    req:
      /xxx/xxx/xx/xxx_xxx/example:
        get:
          headers:
            accept: application/json
            Content-Type: application/json
            Host: xxx.xxx-api.xxxx.amazonaws.com
            X-API-KEY: xxxxx
    test: steps.xxx_xxx_xxxx.res.status == 200

from runn.

t-kitamura-axel avatar t-kitamura-axel commented on June 12, 2024

As a side note, ssh runnner's curl command is success.

  • yaml
runners:
  sc:
    host:  xxxxx
    keepSession: true
  req:
    endpoint: https://vpce-xxxx.xxx-api.xxx.vpce.amazonaws.com/xxx
debug: true:
steps:
  jump_create_status:
    sc:
      command: |-
        curl -iX 'GET' \
        '{{ vars.endpoint }}/xxx/xxx/xx/xxx_xxx/xxx' \
        -H 'Content-Type: {{ vars.header.content_type }}' \
        -H 'Host:{{ vars.header.host }}' \
        -H 'X-API-KEY: {{ vars.header.x_api_key }}'
    test:
        current.stdout contains '200 OK'
        && current.stdout contains 'xx xxx xxx xxx'

from runn.

k1LoW avatar k1LoW commented on June 12, 2024

#526 (comment) and #526 (comment) have different HTTP Request routes.

from runn.

t-kitamura-axel avatar t-kitamura-axel commented on June 12, 2024

Sorry, I miss type, therfore #526 (comment) 's and #526 (comment) 's http request root is same.

In spite of same endpoint and same path, only req is no successful.

from runn.

k1LoW avatar k1LoW commented on June 12, 2024

In spite of same endpoint and same path, only #526 (comment) is no successful.

#526 (comment) and #526 (comment) have different HTTP Request routes.

This means that the network paths of the two HTTP requests are different.

from runn.

k1LoW avatar k1LoW commented on June 12, 2024

Perhaps what you want to do can be achieved in the following ways

runners:
  sc:
    host:  xxxxx
    keepSession: true
    localForward: '10443:vpce-xxxx.xxx-api.xxx.vpce.amazonaws.com:443'
  req:
    endpoint: https://127.0.0.1:10443/xxx
debug: true
steps:
  xxx_example:
    req:
      /xxx/xxx/xx/xxx_xxx/example:
        get:
          headers:
            accept: application/json
            Content-Type: application/json
            Host: xxx.xxx-api.xxxx.amazonaws.com
            X-API-KEY: xxxxx
    test: steps.xxx_xxx_xxxx.res.status == 200

from runn.

t-kitamura-axel avatar t-kitamura-axel commented on June 12, 2024

Thank you for your suggestion.
But, occur bellow err.
Although I want to api test via jump server, I want not to install package and src in jump server.
Therefore, I must api test from local.
If you are something else idea, I glad to listen it.
Thank you.

 Failure/Error: http request failed on 'mission input create'.steps.mission_input_example: Get "https://127.0.0.1:10443/dev/example": tls: failed to verify certificate: x509: cannot validate certificate for 127.0.0.1 because it doesn't contain any IP SANs

from runn.

k1LoW avatar k1LoW commented on June 12, 2024

Added skipVerify: section to HTTP Runner configuration in v0.74.1, so you can skip verifying errors.

from runn.

t-kitamura-axel avatar t-kitamura-axel commented on June 12, 2024

Oh! I suceed in http test via ssh connect server, thanks to your support!!

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.