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

Run entry when it matches some condition? #3300

Open
iredmail opened this issue Oct 11, 2024 · 3 comments
Open

Run entry when it matches some condition? #3300

iredmail opened this issue Oct 11, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@iredmail
Copy link

iredmail commented Oct 11, 2024

Problem to solve

Our application supports MySQL and OpenLDAP backends, there're few differences between them, we'd like to run certain hurl entries when it's using X backend. I didn't find condition support in hurl document.

Proposal

Any plan to support such conditions in hurl so that we don't need to handle it with shell script?

Like Ansible, use when:: https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_conditionals.html#basic-conditionals-with-when

tasks:
  - name: Shut down Debian flavored systems
    ansible.builtin.command: /sbin/shutdown -t now
    when: ansible_facts['os_family'] == "Debian"

And hurl:

POST {{server}}/domain/abc.io
WHEN: my_variable=my_value

HTTP 200
[Asserts]
...
@iredmail iredmail added the enhancement New feature or request label Oct 11, 2024
@jcamiel
Copy link
Collaborator

jcamiel commented Oct 11, 2024

Hi @iredmail

Could you use skip option on some requests (by inverting some logic)?

@iredmail
Copy link
Author

Hi @jcamiel,

Thanks for the reply.

  • How do i define when it should be true/false? For example: skip: my_var=my_value?
  • What if i need to skip for more cases and execute it for less cases? It will require more skip: checks.

A when: like Ansible might be a lot easier. :)

@SilenLoc
Copy link

SilenLoc commented Oct 18, 2024

FYI: An "if" was asked twice when I did my Hurl talk

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