Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add units for duration value #2653

Closed
jcamiel opened this issue Apr 9, 2024 · 3 comments · Fixed by #3129
Closed

Add units for duration value #2653

jcamiel opened this issue Apr 9, 2024 · 3 comments · Fixed by #3129
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@jcamiel
Copy link
Collaborator

jcamiel commented Apr 9, 2024

Duration value is Hurl format are sometimes milliseconds, (--delay) or seconds (--max-time). It would increase the readibility of Hurl format if we could optionally specify a time unit:

Without time unit:

GET https://foo.com
[Options]
delay: 2000
max-time: 60
HTTP 200

POST https://foo.com
[Options]
retry-interval: 100
HTTP 200
[Asserts]
duration < 1000

With time unit:

GET https://foo.com
[Options]
delay: 2s
max-time: 60s
HTTP 200

POST https://foo.com
[Options]
retry-interval: 100ms
HTTP 200
[Asserts]
duration < 1s

Question: do we want to support this with command line values ?

@jcamiel jcamiel added the enhancement New feature or request label Apr 9, 2024
@fabricereix fabricereix self-assigned this Apr 9, 2024
@jcamiel jcamiel added this to the 5.0.0 milestone Apr 17, 2024
@jcamiel jcamiel linked a pull request Aug 23, 2024 that will close this issue
@jcamiel jcamiel closed this as completed Aug 23, 2024
@Jiehong
Copy link

Jiehong commented Dec 12, 2024

I would like to re-open this issue, because the PR #3129 only implemented is for delay and retry-interval, but not for duration.

I can reproduce this issue with the latest hurl version:

hurl --version
hurl 6.0.0 (x86_64-apple-darwin23.0) libcurl/8.7.1 (SecureTransport) LibreSSL/3.3.6 zlib/1.2.12 nghttp2/1.61.0
Features (libcurl):  alt-svc AsynchDNS HSTS HTTP2 IPv6 Largefile libz NTLM SPNEGO SSL UnixSockets
Features (built-in): brotli

Running a test, I get an error:

error: Parsing literal
  --> performance_tests/perf.hurl:17:14
   |
17 | duration < 20s
   |              ^ expecting 'line_terminator'
   |

@jcamiel : would you mind re-opening this issue?

@fabricereix
Copy link
Collaborator

fabricereix commented Dec 12, 2024

This issue is linked to the current release.
I've created a new issue: #3519

@Jiehong
Copy link

Jiehong commented Dec 12, 2024

@fabricereix well, this issue did show units on durations, but it was not implemented.

From the first comment on this ticket:

[Asserts]
duration < 1s

So, maybe it's more a bug than a feat, or both. Fair enough. Thanks for the new ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants