jupyter-xeus / xeus-sqlite

Jupyter kernel for SQLite
BSD 3-Clause "New" or "Revised" License
165 stars 25 forks source link

Increase code coverage of tests #70

Open marimeireles opened 3 years ago

marimeireles commented 3 years ago

We need more tests, this issue keeps track of tests that should be added:

These are the more latent ones. We can expand on this. The more the better :)

marimeireles commented 3 years ago

To create better tests that actually run a notebook and produce a real output we can use: https://github.com/jupyter/jupyter_kernel_test xeus-Cling and xeus-Python also use it, see the CI of cling: https://github.com/jupyter-xeus/xeus-cling/blob/7197375829dbc2848ad2b49bf8ad3ae889edc708/.travis.yml#L48 Checking the /tests/ dir and checking how they're implementing it there will be useful too.

avinal commented 3 years ago

Hey @marimeireles, I set up the test environment but I am confused about how we can test LOAD or anything that doesn't give output. We can rather check for error messages if something is unsuccessful. Or you suggest something :)

marimeireles commented 3 years ago

Hum, yeah. Most of the commands actually output an err message, like LOAD outputs Error: The path doesn't exist. if you passed the wrong path, we can check for that, if it doesn't appear, we assumed it worked. Also, if you wanna test it more extensively, for example still in the case of LOAD you can test if the loaded DB is valid by doing a simple SQLite operation on it, if it fails, then it's not, and so on. :) xeus-SQLite is full of edge cases not covered by the code, unfortunately.

If the other commands like CREATE [...] don't throw an error message, we can create new err msgs for them.

Additionally, if you wanna inspiration on how to start using this python lib: https://github.com/jupyter-xeus/xeus-cling/blob/master/test/test_xcpp_kernel.py

avinal commented 3 years ago

Additionally, if you wanna inspiration on how to start using this python lib: https://github.com/jupyter-xeus/xeus-cling/blob/master/test/test_xcpp_kernel.py

I saw this and tried to replicate but the library is throwing some weird errors, I will try them again and let you know.