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

Generating weird folders during test gen #6

Closed
xnuinside opened this issue Apr 14, 2021 · 3 comments
Closed

Generating weird folders during test gen #6

xnuinside opened this issue Apr 14, 2021 · 3 comments

Comments

@xnuinside
Copy link

Hi, I installed pynguin==0.7.2
and run it with command

pynguin --algorithm WHOLE_SUITE --project_path /Users/iuliia_volkova2/work/simple-ddl-parser/temp --output_path testgen --module_name simple_ddl_parser.output.common

I got a dozens of strange named folders in project path (take a look at the screen).

And got the error )
Screen Shot 2021-04-14 at 1 16 49 PM

Behaviour re-produceable.
Python 3.8.7
OS: Darwin (MacOS)

@stephanlukasczyk
Copy link
Member

Hi @xnuinside ,

First of all, thank you for your interest in Pynguin.

We've noticed this behaviour, when generating tests for a module that contains some code that can create files or directories. Unfortunately, I don't know about the code of your example module—is there a chance to have access to it to play around with it, if needed? Is this the case for your module under test that it contains (or includes) some code that can create files and directories?

Anyway, what we recommend is to run Pynguin in some isolated environment, e.g., a Docker container. This not only applies to this special case but is a general recommendation because Pynguin, while executing the generated tests, will execute basically arbitrary code. Assume, you generate tests for a module that contains code to remove all contents from your home directory. If Pynguin generates a test for that particular code and execute it, it might whipe your home directory. Unfortunately, there is, to the best of my knowledge, no such thing as a security manager in Python (like it exists in Java), which would allow us more easily to prevent some of this potentially dangerous behaviour.

Best,
Stephan

@xnuinside
Copy link
Author

@stephanlukasczyk, exactly! ) in this module I have file creating, okay, thank you!
btw, I really was glad to find Pynguin, several years ago I 'play' this test generation idea in https://github.com/xnuinside/laziest, but I leave it, because at the end of the day I did n't like approach that I chose. I glad to see, that exists people who move also in this way. Good luck in development! About issue - I will close it, thanks for answer!, maybe just make sense to add some note about this behaviour in Doc.

@stephanlukasczyk
Copy link
Member

Thanks for the nice feedback. I'll add a large warning hint into the documentation to avoid others struggling with this in the future.

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