You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've started implementing tests on the linked development branch.
Starting with pipelines.py, my intention is to test in the following way:
Mocking tests (in tests/unit):
Mock the _tw_run method through isolation of methods in Pipelines() (i.e. Pipelines.add(), and Pipelines.get_list()) and making sure these correctly call the _tw_run method with correct arguments (this is the lowest level of isolation for testing)
Mock subprocess to make sure methods in Pipelines() work when arguments are passed to _tw_run and a shell command string is correctly called/constructed (do the commands match with how you would run it on the CLI?)
Integration tests (in tests/integration):
Test methods through actual execution of the subprocess commands in a suitable environment
For example, on scidev/testing or scidev/showcase, include a test that will actually run Pipelines.get_list("scidev/testing")
Here, we can make assertions about the JSON outputs and etc
Long term, this should include a workspace like scidev/showcase that is reliably maintained but how do we set up an access token to use in a different environment (i.e. CI/CD)?
These don't have to be immediate because if we have tests that mock subprocess we have assurance we're constructing the correct CLI commands as mentioned above
Will serve as a starting point for additional unit tests for other classes, and run with CI/CD
monkeypatch
fixture to make the tests simplerThe text was updated successfully, but these errors were encountered: