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

Create friendly way for users to test their code #1

Open
PinkShnack opened this issue Aug 5, 2021 · 1 comment
Open

Create friendly way for users to test their code #1

PinkShnack opened this issue Aug 5, 2021 · 1 comment

Comments

@PinkShnack
Copy link
Contributor

When users add a script, it should work within a virtual environment with the requirements given by the user.

This means each folder will have a .py python script and a requirements.txt file.

We have two options:

  1. We can have the user create a test file and test via pytest.
    • Pros: The testing with pytest is easy.
    • Cons: The first part may be difficult for the user.
  2. We can create a bash script that runs the new script with source run_script [path] from the terminal. This has been implemented in the tests folder and in github actions.
    • Pros: This means the user does not need to provide anything other than the .py and .txt files. For me this is very important.
    • Cons: It is more complicated to implement and because it is a bash script, it doesn't stop if there is a Python error. Could capture and parse the stdout and display a "Fail" message at the end of the script.
@PinkShnack
Copy link
Contributor Author

PinkShnack commented Nov 15, 2021

After not working on this for a while, I think that just having scripts run without errors is enough for them to be tested.

However, shared functions should be tested with a test_*py file. Bst to have this in the same directory as the functions, as the requirements file is already there, and so can be called during the same workflow or in a separate one.

This could be done by just parsing the filenames and feeding those with test in the name to pytest and those without test just run with python as done right now.

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

1 participant