Skip to content

How to package the robot file (.robot) from PyInstaller #5081

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

Closed
nba2023 opened this issue Mar 15, 2024 · 2 comments
Closed

How to package the robot file (.robot) from PyInstaller #5081

nba2023 opened this issue Mar 15, 2024 · 2 comments

Comments

@nba2023
Copy link

nba2023 commented Mar 15, 2024

Python version: Python 3.6.9
Robot Framework version: 4.1.3
PyInstaller Version: 4.10
OS: Linux 5.4.0-77-generic x86~18.04.1-Ubuntu

My purpose is to package the source code from here (https://github.com/openbmc/openbmc-test-automation).
And I create an entry point by .py (loop_test.py) to execute target test case in .robot.
Then run following packaging command:
pyinstaller -D -n openbmc_robot tools/multiple-rounds/loop_test.py --distpath dist/openbmc_robot --add-data "./docs/**:docs" --add-data "./test_files/**:test_files" --add-data "./test_lists/**:test_lists"
The executable command as follows:
./openbmc_robot -c "-i 2.1.1" -n test
And get these errors:

[ ERROR ] Error in file '/openbmc/ipmi/test_ipmi_general.robot' on line 4: Resource file '../lib/ipmi_client.robot' does not exist.
[ ERROR ] Error in file '/openbmc/ipmi/test_ipmi_general.robot' on line 5: Resource file '../lib/openbmc_ffdc.robot' does not exist.
[ ERROR ] Error in file '/openbmc/ipmi/test_ipmi_general.robot' on line 6: Variable file '../data/ipmi_raw_cmd_table.py' does not exist.
[ ERROR ] Error in file '/openbmc/ipmi/test_ipmi_general.robot' on line 7: Variable file '../data/ipmi_variable.py' does not exist.
[ ERROR ] Error in file '/openbmc/ipmi/test_ipmi_general.robot' on line 8: Test library '../lib/bmc_network_utils.py' does not exist.
[ ERROR ] Error in file '/openbmc/ipmi/test_ipmi_general.robot' on line 9: Test library '../lib/ipmi_utils.py' does not exist.

Is there any way to package the robot file to run or only package .py file for now?

@Lenormju
Copy link

Usually, you can embed "resources" (files that are not Python) in your bundles. I never used PyInstaller directly (only indirectly).
Would --add-data work for you ?

Additional non-binary files or folders to be added to the executable. [...]

@pekkaklarck
Copy link
Member

Sorry, cannot help you with this one. I know users have created one file distributions, but I don't know have they included test data. I recommend you to ask help on our Slack or Forum. This tracker is for bug reports and enhancement request so I close this issue.

@pekkaklarck pekkaklarck closed this as not planned Won't fix, can't repro, duplicate, stale May 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants