You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Possibility to give a custom name to a suite using Name setting #4583
Suite names are got from file or directory names by default so that, for example, example_suite.robot creates a suite Example Suite. This works fine in general, but makes it inconvenient or even impossible to use special characters like ! or _. Longer suite names can also be inconvenient as file/directory names. An easy solution to allow using whatever names is adding a new Name. The name would still be set based on the file/directory name by default, but this new setting would allow overriding it.
In practice the new setting will look like this:
*** Settings ***Name Custom name!
Being able to set a custom name for suites like this would make issue #4015 more powerful. Without this you needed to use the --name option in addition to __init__.robot files to be able to fully configure the virtual top level suite created when executing multiple files/directories.
This change only affects parsing and is fairly straightforward. This is a good issue for anyone interested to get more familiar with Robot's parser!
One problem with making it possible to customize the suite name like this is that it doesn't work properly with the --suite command line option. The reason is that the --suite option has performance optimization and it causes files not matching the specified suite not being parsed at all. Thus if you have file tests.robot that changes name to Example, using --suite Example won't work because Example doesn't match the file name and tests.robot isn't even parsed. On the other hand, --suite Tests won't work either because the filtering code is used also after parsing and Tests doesn't match the parsed suite name.
The performance optimization with --suite is there for a reason and removing it wouldn't be a good idea unless there's some other way to limit parsing of files. I propose we do the following:
In RF 6.1 add Name setting so that it doesn't work properly with --suite. This is unfortunate but we can document the behavior.
In RF 6.2, or RF 6.1 if we have time, add separate command line option like --parsefiles or just --files that controls what files should be parsed. It should only look at the file names and it doesn't need to try to construct suite names from them like we do with --suite.
In RF 7 change --suite so that it doesn't affect parsed files. After that Name and --suite work together as expected. Those who want to limit parsing to certain files can use the option added earlier instead of in addition to --suite.
This issue obviously covers point 1 above. I'll submit separate issues for points 2 and 3.
Activity
robotframework#4583 initial version
robotframework#4583 add suite name for init robot files
robotframework#4583 bunch of verification atests
robotframework#4583 change suite names expected
pekkaklarck commentedon Mar 14, 2023
There's PR #4661 implementing this functionality.
pekkaklarck commentedon Mar 14, 2023
One problem with making it possible to customize the suite name like this is that it doesn't work properly with the
--suitecommand line option. The reason is that the--suiteoption has performance optimization and it causes files not matching the specified suite not being parsed at all. Thus if you have filetests.robotthat changes name toExample, using--suite Examplewon't work becauseExampledoesn't match the file name andtests.robotisn't even parsed. On the other hand,--suite Testswon't work either because the filtering code is used also after parsing andTestsdoesn't match the parsed suite name.The performance optimization with
--suiteis there for a reason and removing it wouldn't be a good idea unless there's some other way to limit parsing of files. I propose we do the following:Namesetting so that it doesn't work properly with--suite. This is unfortunate but we can document the behavior.--parsefilesor just--filesthat controls what files should be parsed. It should only look at the file names and it doesn't need to try to construct suite names from them like we do with--suite.--suiteso that it doesn't affect parsed files. After thatNameand--suitework together as expected. Those who want to limit parsing to certain files can use the option added earlier instead of in addition to--suite.This issue obviously covers point 1 above. I'll submit separate issues for points 2 and 3.
robotframework#4583 initial version
3 remaining items
Add new `Name` setting for suites (#4661)
Document new `Name` setting. #4583
pekkaklarck commentedon Apr 4, 2023
This was implemented in #4661 by @otemek. I added documentation and enhanced tests a bit in above commits. Thanks for contribution!
Localization tests for new Name setting #4583.
Include new Name setting in UG translations tables #4583
UG: Enhance --test and --suite documentation.
Add localizations for the new `Name` setting (#4583)
Add localizations for the new `Name` setting (#4583)