Repository navigation
4583 custom suite name - #4661
Conversation
There was a problem hiding this comment.
On a quick look this looks really promising. I need to take a bit closer look at the code changes and added tests later, but I already noticed these things that need to be addressed:
- The setting name should be just
Name, notSuite Name, to be consistent withDocumentationandMetadatathat are suite specific as well. It won't then be consistent withSuite Setup/Teardown, but they need theSuiteprefix to separate them fromTest Setup/Teardown. - The setting needs to be translateable. This requires adding
name_setting = Noneto theLanguagebase class in therobot.conf.languagesmodule and English translation to theEnclass. You can add Finnish translationNimithere as well. - This functionality needs to be documented in the User Guide. This can be done separately after merging this PR as well.
|
Thanks for the help and I hope I understood it correctly because I've left the token name SUITE_NAME and changed only the value for it as there is already a token "NAME" for tokenizing e.g. keyword names (am I right?) |
|
I mainly meant the name of the setting you use in the data. I noticed you already changed it to What token name/type to use is a good question. It didn't occur to me there's already TESTCASE_NAME = 'TESTCASE NAME'
KEYWORD_NAME = 'KEYWORD NAME'so I guess this should be SUITE_NAME = 'SUITE NAME' |
There was a problem hiding this comment.
The added tests look pretty comprehensive, but unfortunately they aren't structured correctly. As the atest/README.rst file explains, tests on the atest/robot side should just validate that features used on the atest/testdata side work correctly. Basically all files using the new Name setting should be on the atest/testdata side and on the atest/robot side you'd have tests that validate that the name is set correctly.
There's existing atest/robot/parsing/suite_settings.robot file for testing other suite related settings. It runs atest/testdata/parsing/suite_settings.robot and validates everything works correctly. It currently checks that ${SUITE.name} is set correctly based on the file name, but you could add Name setting to the file and see that the name is set accordingly. A problem with this approach is that it would be good to have an explicit test for getting suite name from a file name as well. In addition to that, it's a good idea to test that Name works also with __init__.robot files and that with directories the name is got from the directory name by default.
An alternative would be having a separate atest/robot/parsing/suite_name.robot file that tests all aforementioned combinations. Also it would need to run some tests suites where Name is used (and not used). Instead of creating new dummy suites, it would probably be better to add Name to few suites under atest/testdata/misc/suites and run it. Also other tests run atest/testdata/misc/suites so you may need to update them after making changes, but that shouldn't be too big a task.
I didn't yet look at the code in detail but on a very quick look it looks really good. I'll review it in more detail once tests have been restructured. If you have any questions about the somewhat complicated test setup or anything else, don't hesitate to ask here or on the #devel channel on our Slack.
pekkaklarck
left a comment
There was a problem hiding this comment.
Code looks good but some things still to be done:
- There are now tests only on the
atest/testdataside which means they aren't actually run as part of the normal acceptance test run. Separateatest/robot/parsing/suite_names.robotfile is needed to run them and to validate that suite names are set correctly. If you need help with this, ping me on Slack or ask help here. - As commented separately, it would be good to test also translation.
- The code uses
Suite Namein some places andNamein others. Should consistently useNameeverywhere. - Documentation in the User Guide is missing. That can be done separately once this PR is otherwise ready.
|
I've tried to implement this feature as a |
pekkaklarck
left a comment
There was a problem hiding this comment.
Awesome work! I think all my comments were about style. Two other things to do in addition to them:
- Add localization test. You could just add e.g.
# language: Polishinto some of the data files and use useNazwathere instead ofName. Possibly existing localization tests could also be enhanced, but I can do that separately afterwards as well. - Add documentation to the User Guide. I can take care of this as well.
I hope you can take a look my comments and possibly also the two other points above. If you are busy, I can also merge this PR and make these changes myself.
|
|
||
| Multi Root Custom Suite Name | ||
| Should Be Equal As Strings ${Suite.suites[3].suites[1].name} SubParentSuite3Name | ||
| Should Be Equal As Strings ${Suite.suites[3].suites[1].suites[0].name} Another Custom Sub Suite No newline at end of file |
There was a problem hiding this comment.
- What does "Multi Root" mean here?
- Add newline at the end of the file.
There was a problem hiding this comment.
Changed name from Multi Root to Multi Init to indicate that the suite name is placed under multiple folders with __init__.robot initialization file with setting Name. Can it be like that?
There was a problem hiding this comment.
I don't understand what you mean with "placed under multiple folders". Is the file inside a sub folder that's executed? If yes, then something like Custom child suite name would be better. Anyway, the exact name doesn't matter that much.
There was a problem hiding this comment.
renamed to Custom Child Suite Name
| *** Settings *** | ||
| Documentation Tests for --test and --suite options. | ||
| Resource atest_resource.robot | ||
| Test Tags filter_by_names |
There was a problem hiding this comment.
Why wasn't this removed? According to the comment above it should have been removed, but either changes haven't been committed and pushed or there's something else going on. Same situation with various other comments that have marked as resolved.
|
I enabled running tests on CI and several tests failed due to changes to suite names under It also seems that although my comments have been marked as resolved, changes aren't seen here. Did you forget to commit and push changes? Other than the above this PR is ready to be merged. Still need to write documentation, but I already promised to do that earlier. |
|
Sorry about those delays/code not pushed/lags/etc... but as You probably have noticed - I have quite a big problem with finding some time for me to completely take care of this so I don't know if I'll be able to finish this in a reasonable time. If there is anyone else who can make it quicker then I'm totally fine with passing it to someone else :) |
|
No worries! We all have our time pressures and with some new features there's surprisingly lot to do to get everything done. If you don't have time to continue, that's totally fine. We can either continue from here or post-pone this to RF 6.2. One reason there are so many tests to be fixed is that you added a new test under |
|
I looked at the changes again and this is so close to be ready that I believe we should get this in still in RF 6.1. As I wrote above, the new test under |
|
I try to get those tests fixed and fixes pushed to this same PR! |
|
I fixed test and pushed changes here. Looking at the history, there are now some commits that are related to recent changes in master, not to actual changes in this PR. I don't know are they due to me pushing these changes without first merging/rebasing locally or were they here already. Well, if tests pass I'll merge this PR and squash all changes. Hopefully that makes the history clean as well. |
change suite names relative to atest root folder
before fixing tests
- switched to single quotes
- add Custom prefix for suite names
- remove test tags
- use capital case for global ${SUITE} variable
- add newlines for the EOF
20bf6b1 to
bd40495
Compare
|
Rebasing the PR branch locally fixed the history but then needed to force-push changes here. Changes look good and I'll merge this if the CI run succeeds. |
|
Thanks for the help and for making it done |
|
Thanks for your contribution! |
My proposal of implementation for suite names.
Any questions, ideas, or remarks are welcome as it's my first contribution to the RF project.