Comments (6)
Thanks @jcamiel I got it working using the python files provided in the integration/hurl/ directory. I only needed to install Flask in addition to python3, which is packaged in openSUSE and is easy to install during package build.
Thanks for your help!
from hurl.
When running cargo test
, the "integration" tests and docs tests are executed and they need a running local HTTP server. I don't know if it's possible for you but the simplest way to test without any HTTP server is to run cargo test --lib
instead of cargo test
. This command will execute only tests units that don't need an HTTP server.
Tell me if it's okay this way,
from hurl.
Hey @jcamiel thanks for the fast reply. Using --lib
seems to work!
Regarding the HTTP server, I was hoping it would be spun up by magic during the testing. That does not seem to be the case.
Any special requirements for that server? Would a simple python3 -m http.server
or similar suffice? Or does it need to be a "real" one like Apache/nginx/caddy?
from hurl.
No, for the test we only need a simple server that responds on http://localhost:8000/hello
.
python3 -m http.server
should be sufficient!
You can find some docs on the test suite here https://github.com/Orange-OpenSource/hurl/blob/master/integration/README.md if you want,
from hurl.
I almost got the tests working with a python http.server. Almost, just one error:
[ 164s] Running tests/sample.rs (target/debug/deps/sample-587c3e4b0b396a78)
[ 164s]
[ 164s] running 1 test
[ 164s] 127.0.0.1 - - [15/Jul/2024 04:42:18] "GET /hello HTTP/1.1" 301 -
[ 164s] test simple_sample ... FAILED
[ 164s]
[ 164s] failures:
[ 164s]
[ 164s] ---- simple_sample stdout ----
[ 164s] error: Assert status code
[ 164s] --> -:3:10
[ 164s] |
[ 164s] | GET http://localhost:8000/hello
[ 164s] 3 | HTTP 200
[ 164s] | ^^^ actual value is <301>
Apparently the server responds with a 301 if there is no trailing slash. Which works in all other tests, but not in this one.
I just saw the link to the README you gave, I'll have a look later (maybe this is solved in there).
from hurl.
Can you create, if possible, an empty file inside the directory where you're launching the HTTP server?
$ cd /tmp
$ touch hello
$ python3 -m http.server
And then it should be OK:
$ echo 'GET http://locallost:8000/hello' | hurl -i
HTTP/1.0 200
Server: SimpleHTTP/0.6 Python/3.12.4
Date: Mon, 15 Jul 2024 07:09:07 GMT
Content-type: application/octet-stream
Content-Length: 0
Last-Modified: Mon, 15 Jul 2024 06:40:47 GMT
from hurl.
Related Issues (20)
- jsonpath: indexing inside of Filter expression does not work HOT 1
- Support secrets: things that should not be saved verbatim HOT 3
- Allow users to parameterize test
- turning on `serde_json`'s `arbitrary_precision` feature is infectious to importers HOT 6
- Capturing sensitive data : hiding the value in the report HOT 3
- Print useful statistics of the response time in the final summary when using the --repeat option HOT 4
- Lint JSON multi-linestring
- Can you output certain fields in JSON format to output? HOT 3
- Cargo install failed HOT 3
- Insert a JSON body from another file, instead of putting the full JSON in the hurl file? HOT 3
- Add expected value field in all assert Error Message HOT 2
- Add Hurl build instructions for Fedora HOT 2
- Improve JSONPath eval performance
- 😎☀️Hurl Summer Holidays🏄♂️🏝
- max-redirs: -1 can't be set in [Options] section
- Getting SSL certificate info on reused connection HOT 1
- APP
- Building hurl with newer rust versions (1.79) errors out due to "error: field `XXX` is never read" HOT 5
- Sporadic failures/timeout on CI for Arch Linux / HTTP/3 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 hurl.