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

allows to use a variable for a file body #2259

Closed
glb-cblin opened this issue Dec 18, 2023 · 8 comments · Fixed by #2295
Closed

allows to use a variable for a file body #2259

glb-cblin opened this issue Dec 18, 2023 · 8 comments · Fixed by #2295
Labels
enhancement New feature or request
Milestone

Comments

@glb-cblin
Copy link

Problem to solve

I have a test file to run for multiple data

Inside the test file, I have this

POST {{PUBLIC_URL}}/public-picture-api/my-pictures
Authorization: Bearer {{id_token}}
Content-Type: application/json
#TODO: hurl does not allow to use a var to specify a file like "file,{{JSON_REQUEST_FILE}};" so we use same picture for all users :(
file,add-picture.body.json;

Proposal

I'd like to use file,{{RIB_REQUEST}};

@glb-cblin glb-cblin added the enhancement New feature or request label Dec 18, 2023
@jcamiel
Copy link
Collaborator

jcamiel commented Dec 18, 2023

Hi @glb-cblin

Thanks for the feedback, you should be able to use variable in filename, indeed. The Hurl grammar specifies that you can templatize the filename (see https://hurl.dev/docs/grammar.html#oneline-file) but we haven't implemented it yet. Noted!

@glb-cblin
Copy link
Author

hi @jcamiel

Thanks for the answer !

Do you have an idea of the roadmap for this feature ? LIke in some weeks or some months ?

@fabricereix
Copy link
Collaborator

I would say weeks

@jcamiel
Copy link
Collaborator

jcamiel commented Dec 21, 2023

See also #464

@fabricereix fabricereix linked a pull request Jan 6, 2024 that will close this issue
@jcamiel jcamiel added this to the 4.2.0 milestone Jan 6, 2024
@glb-cblin
Copy link
Author

Still failing with hurl latest docker image

Is the fix released ?

PS C:\Users\cblin\source\repos\apps\apis\tests\hurl-tests> docker pull ghcr.io/orange-opensource/hurl
Using default tag: latest
latest: Pulling from orange-opensource/hurl
9398808236ff: Pull complete
72d818db6daa: Pull complete
6bfabeab9aa4: Pull complete
bb967a1a7f3c: Pull complete
0237c0507387: Pull complete
98e01f234299: Pull complete
44b59b6e1e96: Pull complete
6dc437f01b56: Pull complete
ed3124a06138: Pull complete
f49ecdc5efca: Pull complete
Digest: sha256:a9344f706f4581e2eb5361a37d861dbb1d4d51deefa9838025f6fba69c4981b6
Status: Downloaded newer image for ghcr.io/orange-opensource/hurl:latest
ghcr.io/orange-opensource/hurl:latest

PS C:\Users\cblin\source\repos\apps\apis\tests\hurl-tests> docker run --rm -v ${PWD}:/tests ghcr.io/orange-opensource/hurl:latest --test "/tests/public-rib.hurl" --variables-file /tests/vars.txt --report-html /tests/out --error-format long --insecure $verbose_arg
/tests/public-rib.hurl: Running [1/1]
error: Parsing filename
  --> /tests/public-rib.hurl:22:6
   |
22 | file,{{RIB_REQUEST}};
   |      ^ expecting a filename
   |

image

@fabricereix
Copy link
Collaborator

@glb-cblin
Copy link
Author

ok thanks for the fast reply 👍

do we have a date for this next release ?

@fabricereix
Copy link
Collaborator

within a week

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