Tasks and Test Cases cannot be included to the same run
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 32/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- python
- Domain
- testing-qa
Research direction
Start at sherlock/core.py, where TestSuiteBuilder().build is called, and reproduce the issue with the supplied rpa_test.robot and test_robot.robot files. Read how the Robot Framework suite builder handles mixed task and test execution modes, then verify that Sherlock no longer fails unexpectedly when both files are present.
Written by the indexing model from the issue text.
Description
If we have example two files:
├── rpa_test.robot
└── test_robot.robot
rpa_test.robot:
*** Tasks ***
Test Tasks
No Operation
test_robot.robot:
*** Test Cases ***
Test Case Example
No Operation
We got error:
$ sherlock
Sherlock analysis of Robot Framework code:
Using <home_path>/sources/sherlock_test as source repository
Traceback (most recent call last):
File "<home_path>/.pyenv/versions/3.8.15/envs/sherlock/lib/python3.8/site-packages/robot/running/builder/builders.py", line 177, in _build_suite
self._validate_execution_mode(suite)
File "<home_path>/.pyenv/versions/3.8.15/envs/sherlock/lib/python3.8/site-packages/robot/running/builder/builders.py", line 191, in _validate_execution_mode
raise DataError(f"Conflicting execution modes. File has {this} "
robot.errors.DataError: Conflicting execution modes. File has tests but files parsed earlier have tasks. Fix headers or use '--rpa' or '--norpa' options to set the execution mode explicitly.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<home_path>/.pyenv/versions/sherlock/bin/sherlock", line 8, in <module>
sys.exit(run_cli())
File "<home_path>/.pyenv/versions/3.8.15/envs/sherlock/lib/python3.8/site-packages/sherlock/__init__.py", line 19, in run_cli
raise err
File "<home_path>/.pyenv/versions/3.8.15/envs/sherlock/lib/python3.8/site-packages/sherlock/__init__.py", line 9, in run_cli
runner.run()
File "<home_path>/.pyenv/versions/3.8.15/envs/sherlock/lib/python3.8/site-packages/sherlock/core.py", line 29, in run
suite = TestSuiteBuilder().build(self.config.path)
File "<home_path>/.pyenv/versions/3.8.15/envs/sherlock/lib/python3.8/site-packages/robot/running/builder/builders.py", line 91, in build
suite = parser.parse(structure)
File "<home_path>/.pyenv/versions/3.8.15/envs/sherlock/lib/python3.8/site-packages/robot/running/builder/builders.py", line 138, in parse
structure.visit(self)
File "<home_path>/.pyenv/versions/3.8.15/envs/sherlock/lib/python3.8/site-packages/robot/parsing/suitestructure.py", line 46, in visit
visitor.visit_directory(self)
File "<home_path>/.pyenv/versions/3.8.15/envs/sherlock/lib/python3.8/site-packages/robot/parsing/suitestructure.py", line 166, in visit_directory
child.visit(self)
File "<home_path>/.pyenv/versions/3.8.15/envs/sherlock/lib/python3.8/site-packages/robot/parsing/suitestructure.py", line 44, in visit
visitor.visit_file(self)
File "<home_path>/.pyenv/versions/3.8.15/envs/sherlock/lib/python3.8/site-packages/robot/running/builder/builders.py", line 144, in visit_file
suite, _ = self._build_suite(structure)
File "<home_path>/.pyenv/versions/3.8.15/envs/sherlock/lib/python3.8/site-packages/robot/running/builder/builders.py", line 179, in _build_suite
raise DataError(f"Parsing '{source}' failed: {err.message}")
robot.errors.DataError: Parsing '<home_path>/sources/sherlock_test/test_robot.robot' failed: Conflicting execution modes. File has tests but files parsed earlier have tasks. Fix headers or use '--rpa' or '--norpa' options to set the execution mode explicitly.
Fatal exception occurred. You can create an issue at https://github.com/bhirsz/robotframework-sherlock/issues . Thanks!
$ pip list
Package Version
----------------------- -------
commonmark 0.9.1
Jinja2 3.1.2
MarkupSafe 2.1.2
pathspec 0.9.0
pip 22.0.4
Pygments 2.14.0
rich 13.1.0
robotframework 6.0.2
robotframework-sherlock 0.2.0
setuptools 56.0.0
tabulate 0.8.9
toml 0.10.2
typing_extensions 4.4.0
- Dominant language
- Python
- Stars
- 14
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from MarketSquare/robotframework-sherlock
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
MarketSquare/robotframework-sherlock#94 · 3 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
MarketSquare/robotframework-sherlock#71 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
MarketSquare/robotframework-sherlock#65 · 6 comments ·
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 25/100
All issues in MarketSquare/robotframework-sherlock
Similar issues
-
PAC Wording
Difficulty 1/5 Under an hour Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Harmony OPeNDAP SubSetter (HOSS) Geographic production rssmif16d 7 XYZ_PROV
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
nasa/harmony-autotester#372 ·
-
Add DomainOpen
Difficulty 1/5 Under an hour Newbie friendliness 65/100
disposable/disposable#318 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
developmentseed/titiler-cmr#270 ·
Maintainers usually reply within 1 day
-
Chart: a failed venv install is marked ready, and the 10Gi venv PVC is too small for itPossibly taken @andyne13 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day