Skip to content
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

WeTest creates temporary files which are not removed #89

Open
vnadot opened this issue Apr 18, 2024 · 0 comments
Open

WeTest creates temporary files which are not removed #89

vnadot opened this issue Apr 18, 2024 · 0 comments
Assignees

Comments

@vnadot
Copy link
Contributor

vnadot commented Apr 18, 2024

I run a first time the script (with macros) as user a. The script works fine. Then I try to run it as user b and I got the following message:

$ ./${WETEST_PATH}/${WETEST_NAME} ./test/misc/WeTest/destination/WeTest_sbct_destinations.yaml --no-gui --force-play --propagate-macros -m on_failure="continue"
Traceback (most recent call last):
  File "/nix/store/pnkbr2dx35h9rz9zn3fgvcgvfr73smvs-python3.9-wetest-2.0.0rc1/bin/..wetest-wrapped-wrapped", line 9, in <module>
    sys.exit(main())
  File "/nix/store/pnkbr2dx35h9rz9zn3fgvcgvfr73smvs-python3.9-wetest-2.0.0rc1/lib/python3.9/site-packages/wetest/command_line.py", line 426, in main
    suite, configs = generate_tests(
  File "/nix/store/pnkbr2dx35h9rz9zn3fgvcgvfr73smvs-python3.9-wetest-2.0.0rc1/lib/python3.9/site-packages/wetest/command_line.py", line 171, in generate_tests
    tests_data = ScenarioReader(
  File "/nix/store/pnkbr2dx35h9rz9zn3fgvcgvfr73smvs-python3.9-wetest-2.0.0rc1/lib/python3.9/site-packages/wetest/testing/reader.py", line 343, in __init__
    self.deserialized = self._deserialize()
  File "/nix/store/pnkbr2dx35h9rz9zn3fgvcgvfr73smvs-python3.9-wetest-2.0.0rc1/lib/python3.9/site-packages/wetest/testing/reader.py", line 437, in _deserialize
    new_sc = ScenarioReader(
  File "/nix/store/pnkbr2dx35h9rz9zn3fgvcgvfr73smvs-python3.9-wetest-2.0.0rc1/lib/python3.9/site-packages/wetest/testing/reader.py", line 356, in __init__
    with open(tempo_file_path, "w") as yml_wo_macros:
PermissionError: [Errno 13] Permission denied: '/tmp/no_macros.yml'

The 2 users can write in /tmp but can't overwrite the `/tmp/no_macros.yml' file of the other user.

I think that WeTest should remove these files at the end of WeTest execution (and should manage the case of a savage exit (ctrl-c in terminal for example).

(for CEA agent only: this happened here)

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

2 participants