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

Test that generated code is proper python code that can run #45

Open
kate-holdener opened this issue Oct 4, 2022 · 3 comments
Open
Assignees
Labels
testing Additional testing is needed

Comments

@kate-holdener
Copy link
Collaborator

kate-holdener commented Oct 4, 2022

We need to add a test for the code_generator component that verifies that whatever code our generator comes up with is in fact proper python code that can run without errors (at least on some test data that we provide). Note that this specific test would not use the flask code. It would call on the code_generator directly, and run the generated code (or somehow check if the generated code is 'runnable')

@kate-holdener kate-holdener added the testing Additional testing is needed label Oct 4, 2022
@felipealencar
Copy link
Collaborator

Hi @kate-holdener! :)
I have some clues about how to solve this issue: https://docs.python.org/2/library/subprocess.html#subprocess.check_call.
If it's not a problem, could you assign this one to me?

@kate-holdener
Copy link
Collaborator Author

Thanks @felipealencar! I assigned this issue to you.

@kate-holdener
Copy link
Collaborator Author

@felipealencar Some of the generated code will take a long time to run (once we have complex model training in the generated code). I know that tools like pylint will flag any issues with the code that's missing imports and variables that have not been defined. I wonder if there is a way to check if the code can run without actually running the code (because of the computational complexity of the generated code).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
testing Additional testing is needed
Projects
None yet
Development

No branches or pull requests

2 participants