-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Support tagging in FTR tests #84897
Comments
Pinging @elastic/kibana-operations (Team:Operations) |
Hey @banderror, the issue in your screenshot is that you're using an arrow function for your describe block, so the The flags are intended to function like the existing filtering flags from Mocha, but powered by more machine-readable values rather than pattern matching suite names; To only run the Not sure if that helps 😬 but if it does I can work up a version of that description for the CLI |
Hi @spalger, thanks a lot for your clarification and sorry for a delayed reply from my side.
Oh, my bad, absolutely! It's just so common to use arrows in these test blocks so I even didn't think about that. I used an anonymous function, tagged my test suite with a tag, and it worked well: export default function ({ getService }: FtrProviderContext) {
const supertest = getService('supertest');
const esArchiver = getService('esArchiver');
describe('Generating signals from source indexes', function () {
this.tags('license-trial'); node scripts/functional_tests --config x-pack/test/detection_engine_api_integration/security_and_spaces/config.ts --include-tag=license-trial
That would be great for sure. I missed some clarification regarding that in the help text and also in the docs. I also noticed (if I'm not mistaken) that the logic of combining tags works like that. If we have Thank you! Please close the issue at will or let me know if you prefer me to close it. |
Summary
Heya! TL;DR:
Is there a way to add multiple tags to an FTR test (on
describe
and/orit
levels) and then be able to run tests filtered by tags you need in a certain situation?A good example of that would be something like mocha-tags that allows to filter tests with AND and OR logic. Or something like that.
Existing FTR CLI parameters
Before filing this issue I tried to find an existing solution. I checked the docs on testing and the
kbn-test
package. Noticed there are these parameters:Also noticed they are used to group tests on CI. Does it mean if I add a new tag, a new CI group will be created? I don't want to necessarily interfere with CI.
Unfortunately I couldn't find documentation describing how this tagging exactly works, what's the logic (AND, OR), and how it's related to the CI.
Original issue
We at @elastic/security-detections-response team have some FTR tests in x-pack/.../detection_engine_api_integration. There are
basic
andsecurity_and_spaces
subfolders each containing (mostly) the same tests. The only difference is their config - one usesbasic
ES license while the other usingtrial
.Instead of maintaining two sets of duplicated tests, would be nice to be able to tag some tests as e.g.
license-basic
, some aslicense-trial
, some with both. And then be able to do 2 test runs like that:I tried to use the existing tags functionality in
detection_engine_api_integration
, but there's some issue with types:The text was updated successfully, but these errors were encountered: