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

Group frequently used small tasks in a hurl file and include it in many other hurl files #1723

Open
iredmail opened this issue Jul 5, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@iredmail
Copy link

iredmail commented Jul 5, 2023

Problem to solve

We need to delete and re-create some SQL records frequently to make sure data clean, so we want to write deleting in a small .hurl file, write re-creating in another .hurl file, then include them in other hurl files.

Proposal

Add directive to support including hurl files.

Additional context and resources

Like Nginx, we can include config snippet with the include directive, for example:

http {
    include /etc/nginx/conf-enabled/*.conf;
    include /etc/nginx/sites-enabled/*.conf;
}
@iredmail iredmail added the enhancement New feature or request label Jul 5, 2023
@jcamiel
Copy link
Collaborator

jcamiel commented Jul 5, 2023

Hi @iredmail thanks for the issue.

Other related issue are #115 #1273 #317.

As noted in #1273

Reusing, importing, macros are also important but it's not our current priority. These are good features, but they come
with really major additional complexity that we don't want to support, for the moment. We've designed the Hurl file
format to be like a Markdown for HTTP rather than a proper programming language. This, for sure, is limiting, but we
also see it as a force of the tool. With a simple format, you can image simple way of generating Hurl files (with template
engine, scripts etc...). I hope this answer is not too deceptive (and closing it now doesn't mean we won't revisit it in
the future)

For the moment, mainly due to implementation complexity, we aren't going to develop "import" files. If this is too limiting for your use case, we advise to generate Hurl files as it's just plain text. To give you feedback and to inform you if you need to invest time in Hurl or not, we can say that we may revisited this feature in the future, but certainly not in the next months.

Hope it's not too harsh from us!

@markallanson
Copy link

markallanson commented May 17, 2024

This is also something that immediately came to mind, when a series of different tests need to use a common set of pre-requests to configure variables etc.

The best I could come up with, which was good enough for me given my simple use case, was simply to cat the files and pipe them into hurl.

cat setup.hurl my-test.hurl | hurl

This works fine so long as all you want is to combine the files end-to-end.

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

No branches or pull requests

3 participants