Repository navigation
Description
We currently have three settings for controlling tags tests get:
Force Tagsin the Settings section for specifying tags tests will unconditionally get.Default Tagsin the Settings sections for specifying tags tests get, in addition to the forced tags, unless tests themselves have tags.[Tags]with each tests to specify tags they get in addition to the forced tags. These also override the default tags.
This is rather complicated and my understanding is that all three settings are rarely used. I propose we simplify this so that in the future we'd only have two settings:
Test Tagsin the Settings section to specify tags tests always get. Same asForce Tagsnowadays.[Tags]with each test to specify tags tests get in addition to theTest Tags.
The functional difference compared to the current behavior is that there wouldn't be a possibility to specify tags tests get by default but that they could override when needed. For example, something like this wouldn't be possible anymore:
*** Settings ***
Force Tags all have
Default Tags most have
*** Test Cases ***
T1
No Operation
T2
[Tags] only one has
No Operation
T3
No OperationInstead of using Default Tags that some tests override, all tests that actually need these tags must list them explicitly. The change wouldn't be overly big and I actually like this better:
*** Settings ***
Test Tags all have
*** Test Cases ***
T1
[Tags] most have
No Operation
T2
[Tags] only one has
No Operation
T3
[Tags] most have
No OperationThis change is obviously backwards incompatible and cannot be done without a deprecation period. I propose we do it like this:
- In RF 5.1 add
Test Tagsthat basically acts as an alias forForce Tags. Also document thatTest Tagsand[Tags]are the way forward. - In RF 6.0 deprecate
Force TagsandDefault Tags. - In RF 7.0 remove
Force TagsandDefault Tags.
This is currently only a proposal and comments are welcome! If you just want to indicate your opinion, you can add 👍 or 👎 reaction to this description.
Activity
pekkaklarck commentedon Jun 14, 2022
One benefit of replacing
Force TagsandDefault Tagswith justTest Tagswould be consistency with other settings likeTest SetupandTest Timeout. Tags would work slightly differently, though, becauseTest Tagsand[Tags]would be combined together while, for example,[Setup]overridesTest Setup. We could obviously consider making it so that[Tags]would overrideTest Tagsas well, but I believe that functionality wouldn't be as convenient.pekkaklarck commentedon Jun 14, 2022
Another benefit of replacing
Force TagsandDefault Tagswith justTest Tagswould be making localization (#4096) easier. BothTestandTagsneed to be translated anyway, so most likely translatingTest Tagswouldn't need any extra work. At least in Finnish translatingForce Tagsis somewhat problematic and this change would avoid that problem altogether. If we'd addTest Tagsin RF 5.1, then translators could only translate that and forgetForce Tagsaltogether. They could also decide to ignoreDefault Tagsas it would be deprecated relatively soon anyway.asimell commentedon Jun 15, 2022
In case we have
Test Tags, there also needs to be aTask Tagsequivalent similar toTask SetupandTask Task Timeout, etc.Just dropping this in, because the discussion above has no mention of RPA and it shouldn't be forgotten 😁
rikerfi commentedon Jun 15, 2022
Voting
NOto consider[Tags]would overwrite[Test Tags]. This will cause massive refactoring for users.pekkaklarck commentedon Jun 15, 2022
You @rikerfi vote "NO" for
[Tags]overridingTest Tags(which I don't like myself) but aren't against the idea to renameForce TagstoTest Tagsand removingDefault Tags, right?[Tags]overridingTest Tagswould actually mean that we'd renameDefault TagstoTest Tagsand removeForce Tags.rikerfi commentedon Jun 15, 2022
@pekkaklarck You got me right. I love the original idea to rename
Force TagstoTest Tagsand removeDefault Tags. That would be a step ahead.Snooz82 commentedon Jun 16, 2022
Actually i do not see any advantages.
Test Tags or Force Tags are totally replaceable and non of those is 100% self explanatory.
but Force Tags give a hint on what it does.
we do use Default tags. Most tags are defaulting to A but some are B. So we use Default Tags and [Tags] for this.
instead of changing that, i would like to see Suite Tags instead. So that really a suite has a tag.
pekkaklarck commentedon Jun 17, 2022
I covered the main benefits of this change already earlier, but I summarize them here:
Test Tagswould be consistent withTest Setupand other test related settings. WithForce TagsandDefault Tagsit's not even clear are they related to tests.TestandTagneed to be translated anyway while termsForceandDefaultare likely to be harder.pekkaklarck commentedon Jun 17, 2022
The main drawback would obviously be the removed functionality: you couldn't anymore set tags that most test have so that individual tests can override them. My understanding is that this isn't too widely used feature, but I'm sure there are usages out there.
One solution to this problem would be coming up with some new syntax that provides the same functionality. One possibility would be making it possible to remove tags using the
[Tags]setting, for example, by using-tagsyntax. We actually already support that with the Fail keyword that accepts an optional list of tags to add or remove. With that syntax the example in the description would look like this:I think the above looks at least as good as the original. The basic functionality is easy to explain and understand (tags set with
Test Tagsand[Tags]are simply combined) and the special case how to remove tags with-tagis pretty simple as well.Another alternative would be using some more explicit prefix like
REMOVE: taginstead of-tag. It would avoid problems with someone possibly having tags starting with-. We could even use our reserved tags likerobot: remove: tag, but that starts to look strange. Another possibility would have adding a special marker to denote that tags after it should be removed. It could look likeor
pekkaklarck commentedon Jun 20, 2022
When discussing about tagging on Slack, @Snooz82 proposed adding
Keyword Tagsto make it easier to specify common tags for all keywords in a resource file. I think that's a good idea and submitted #4373 about it. If that's done, renamingForce TagstoTest Tagsgets more important. I also don't think adding something likeDefault Keyword Tagswould make sense regardless what we do withDefault Tagsand thus some other syntax for removing globally set tags would be really convenient. I submitted #4374 about the possible-tagsyntax I already proposed above.pekkaklarck commentedon Jun 21, 2022
In this comment I'll explain the current proposals related to changing tag related settings, what I think should be the end goal, and what would be the first steps towards that. The proposals are:
Force TagstoTest Tagsand removeDefault Tags(this issue)Keyword Tagssetting #4373-tagsyntax with[Tags]setting #4374The motivation of the first proposal, renaming
Force TagstoTest Tagsand removingDefault Tags, is making the syntax simpler, more consistent, and easier to translate. Most people seem to be in favor of renamingForce Tagsand I personally find it especially important if we plan to implement the second proposal and addKeyword Tags. There are obviously backwards compatibility concerns, but we can supportForce Tagsas an alias forTest Tagsfor long time.Removing
Default Tagsis more controversial because it would remove a concrete functionality. It wouldn't anymore be possible to specify tags that most tests have so that some tests could override them. That functionality doesn't seem to be that widely used, and it makes the whole tag setting system pretty complicated, but it would nevertheless be unfortunate to remove something that some people are using.The proposal to add
Keyword Tagsis a good motivation to removeDefault Tags, though. It would be somewhat confusing to haveTest Tags,Keyword TagsandDefault Tags, and I definitely don't want to add something likeDefault Keyword Tagsto support default tags with keywords. Having a way to set default tags for keywords would nevertheless be convenient, and if it could be done without adding a new setting we could use that approach also with tests. That would then allow removingDefault Tagswithout loosing functionality.The third proposal, being able to remove tags set globally with
-tagsyntax, aims to provide the "default tags" functionality without extra settings and so that it would work both with tests and keywords. Unlike the currentDefault Tagsthat tests can override by having their own[Tags], this proposal would allow tests (and keywords) to opt-out from having some tags. In addition to making theDefault Tags(andKeyword Default Tags) redundant, I consider this syntax easier to understand as well. I'm not absolutely sure is the-tagsyntax best, though, or should we support something likeREMOVE: taginstead. This is something to discuss further, but I believe something like this is better than havingDefault Tags.📢 I believe the end goal should be that we have only
Test TagsandKeyword Tagssettings for setting tags globally for tests and keywords. In addition to that it should be possible to use-tagsyntax (or something similar) with tests/keywords that don't need certain tags. The steps I propose to reach the end goal are listed below by version.RF 5.1
Test Tagsas an alias forForce Tags.Keyword Tags.-like-tagin[Tags]. Escaping like\-tagshould work if you really need such a tag.RF 5.2 (Q4/2022)
[Tags]by using the-tagsyntax. If we have found some better syntax, use that instead.RF 6.0 (or later)
Force Tags.Default Tags.RF 7.0 (or later)
Force Tags. Could possibly preserved even longer as it's only an alias.Default Tags.The above timeline gives us plenty of time make the final decision about the fate of
Default Tags. Before RF 6.0 we could preserve it just be changing the decision and reverting deprecation wouldn't be that big a problem either.Changes planned for RF 5.1 are pretty safe as well.
Keyword Tagsis a useful feature, and if it's addedTest Tagsis clearly betterForce Tagseven ifDefault Tagswould in the end be preserved. Deprecating literal-tagusage is easy to revert if we decide not to use that syntax for removing tags.All this looks so safe to me that I plan to work with RF 5.1 changes pretty soon. If you have questions, concerns, or anything else, comment here or participate the discussion on the #devel channel on our Slack.
glueologist commentedon Jul 30, 2022
Been writing RF code since 2015. Have a lot. In the last year had to move from v3 to v5 quickly to pick up support for a few things. Been a lot of churn because of this. Understandable, but I wonder if the older user base is considered as much as it should be with almost capricious changes like this one proposed.
Remember for your user base RF is a tool. Not something they get involved at the dev feature level on any frequent basis except using it.
Another relevant example is robotidy. I have spent the last two days trying to get some similar functionality to robot.tidy. At this point I think I will have to write an External Transformer to get pipe separators back. Additionally in those two days I have found a number of bugs/issues with robotidy (see RF user group conversations for details) So was it ready to deprecate in 5.0? Not sure. Still trying to understand the new tool. (Note the Migrating from robot.tidy example in the docs comes no where near close to robot.tidy; and example has two syntax errors in it. :-) )
The overall point here is changing older stuff just to make it 'pretty' is a lot more cost for your user base than I believe is well understood.
RF has a great tag system. I use it everywhere. Would Test Tags look better than Force Tags? Yes, Force Tags always seemed like a language translation misunderstanding. But is the ROI there? Not so sure.
When you do this please provide in the release notes a clear example of how to use the RenameKeywords transformer with a regex to replace all Force Tags with Test Tags. Then all I have to do is the many days of a test cycle on my code base. :-)
(and I understand that new functionality is also proposed but basic [Tag] usage will be the same, right?)
Thanks for the time you guys put in. This is a great product. Love using it.
pekkaklarck commentedon Sep 23, 2023
This issue exists to track the progress of renaming
Force TagstoTest Tagsand removingDefault Tags. We have addedTest Tagsin RF 6.0 (#4368) and the-tagsyntax in RF 7.0 (#4376). I believe we could loudly deprecate the old settings in RF 8.0 and moved this issue to its scope. Once we have a dedicated issues about deprecation and eventual removal, this issue probably can be closed.pekkaklarck commentedon Nov 7, 2023
@glueologist You have a very good point related to backwards compatibility. We do take it seriously, but in this particular case we believe changes are worth the problems they cause.
As you noted,
Force Tagsis a rather horrible name, but we didn't change it just becauseTest Tagsis better. The main motivation was simplifying localization (#4096), it would have been stupid to requireForce Tagsto be translated to different languages and thus we introducedTest Tagsin RF 6.0 along with localization.Default Tagsisn't as bad a name, but it isn't that great either and it also became ambiguous after we addedKeyword Tags(#4373). Same functionality would be useful also with keywords, but we didn't feel like it would be worth addingDefault Keyword Tagsor something like that. The-tagsyntax proposed in #4376 and implemented in RF 7.0 works with test and keyword tags feels much more natural.These good reasons don't change the fact that the change is backwards incompatible. Good news is that we aren't in a hurry to remove the old syntax. It will work without deprecation warnings at least until RF 8.0 (late 2024 or early 2025) and actual removal will be happen much later. I would expect tools like RoboTidy to evolve so that they update this syntax automatically.
glueologist commentedon Nov 9, 2023
Thanks for taking the time to address my concerns. I did not consider localization when seeing this change. This consideration makes sense.
Thanks for all the effort. Great tool.
Rename `Force Tags` to `Test Tags` due to deprecation
Rename `Force Tags` to `Test Tags` due to deprecation (#1134)