-
Notifications
You must be signed in to change notification settings - Fork 14
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 support for regexes in url ignore list #80
Conversation
Not that it matters, but I am the maintainer of Locust itself :) |
Hi @cyberw, thanks for contributing, I like the idea of giving more power to users via regexes! Do you think we could avoid making this a breaking change by enabling regex-matching with a CLI flag or an environment variable? |
We could make it a flag, but it will only very rarely break anything, so I dont think it is worth it. A regex I kind of made this PR thinking we were matching URL:s, not just hostnames. Perhaps we can have two ignore files? One that matches entire URL:s (using regex) and one that string-matches only hostnames (preserving the old behaviour). The only problem with that is that the old file is called urlignore (when it should actually be called hostignore) (I realize now that this was more of a train of thought, feel free to ignore the first two paragraphs :) |
I like the idea of deprecating I would also add an environment variable ( How does that sound? Do you feel like trying it? 😊 Meanwhile I would work on the GitHub Action setup that needs some love… 😅 |
Or we can just make a major version now, and drop the |
Cool! I'll have a look next week! |
…requests, not just host name.
I didnt implement the env var, but that could be done at a later point if needed. For a new major version I would love to drop Locust 0.x support and maybe put everything in one task (insted of And maybe optionally add Right now I post-process everything like this (slightly simplified from my actual script), and parts of it feel really dirty :)
|
Also, I had an idea: What if we were to add transformer to locust core? We could at least add it as an optional installation (using pip's optional dependencies, e.g. |
@thilp Hi! Did you have time to take a look? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the PR @cyberw!
🤖 zincr found 0 problems , 0 warnings
|
Works for me.
I must admit I’ve not kept myself up to date with Locust best practices, so I take your word for it. If I remember correctly, we are using SequentialTaskSet to attribute different weights to scenarios. How would you achieve the same flexibility with a single task, have Transformer hardcode the load-balancing code directly inside the task? Or do you simply not use weights? Perhaps we can also continue this discussion in a dedicated issue, since this will likely outlive this PR 🙂 |
Co-authored-by: Thibaut Le Page <thilp@thilp.net>
I am happy with this PR. Because of the compliance process in place for open-source at Zalando (who owns Transformer), please give me some time to get another colleague to approve it as well. This shouldn’t take long 🙂 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the PR
Yes, lets! I can raise a new ticket. |
I will now merge this PR and create a new release (associated with a new major version). |
Nice! |
Fixes #81.
Description
I didnt find an easy way to ignore requests entirely by using plugins, and just using string matching is not flexible enough. Could be a breaking change in rare cases, but should work in most cases.
Types of Changes
What types of changes does your code introduce? Keep the ones that apply:
TODO
List of tasks you will do to complete the PR: