dbcli / mycli

A Terminal Client for MySQL with AutoCompletion and Syntax Highlighting.
http://mycli.net
Other
11.41k stars 659 forks source link

contributing and running tests #1013

Open schmeic opened 2 years ago

schmeic commented 2 years ago

I'd like to start contributing, and I followed the steps in CONTRIBUTING.md and then tried to run the version of mycli in my virtualenv bin dir. I got module not found errors and had to install the following extra modules: pyperclip, importlib_resources, pyaes

Should these be added to requirements-dev.txt?

Also, to run the tests you need to connect to mysql as a user that can create and drop tables, with the default user being root. This seems pretty dangerous. Why not use a database prefix, like _mycli__, and then create a test user that only has access to tables starting with this prefix?

amjith commented 2 years ago

Yes to adding the additional dependencies to requirements-dev.txt file.

You're right that running the tables does create/drop tables as root. We've mostly focused on speed (or ease-of-use) for the existing devs to do this and didn't put much thought into safety. If you have the cycles to address it, I'd be happy to welcome a PR.

schmeic commented 2 years ago

Ok, I'll give the prefix idea a try.

schmeic commented 2 years ago

I'm trying to run tests, and some are failing because it appears that the status command is broken - for me, it just prints out the string 'Flush_commands' instead of the normal mysql status output that I was expecting. Any ideas?

schmeic commented 2 years ago

The status command was fixed by making the change suggested in #1056.