Comments (10)
invalid path: req
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.
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.
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.
#526 (comment) and #526 (comment) have different HTTP Request routes.
- #526 (comment) is making an HTTP request from the host server.
- #526 (comment) is making an HTTP request from within the remote server.
from runn.
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.
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.
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.
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.
Added skipVerify:
section to HTTP Runner configuration in v0.74.1, so you can skip verifying errors.
from runn.
Oh! I suceed in http test via ssh connect server, thanks to your support!!
from runn.
Related Issues (20)
- Enable configurable HttpRunner timeout HOT 1
- Panic may occur during load testing HOT 5
- Proposal: GraphQL runner HOT 2
- What are some possible ways to have a unique id issued for each scenario? HOT 3
- Found `Failure/Error: invalid` when stdin has a json previous result HOT 7
- How to read and execute a proto file on the command line? HOT 3
- openapi3 not working when running via ssh connected server HOT 20
- In loop, json is recognized as string HOT 13
- When using loop, how to change description HOT 4
- Allow HTTPRunner to take over cookies HOT 3
- http request fails when using numeric value for variable in multipart/form-data HOT 1
- Define an accessor to get the Host of the endPoint of HTTPRunner HOT 5
- How to use json data when using gRPC runner? HOT 1
- Access to response results during loop HOT 8
- Too many connections error occurs when multiple scenarios run HOT 4
- The notFollowRedirect option does not work. HOT 2
- Add step description and test point to list command HOT 3
- Add before/after Hooks for Efficient Testing HOT 1
- Support SSH Proxy HOT 2
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.