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

Improvement the way and environment of testing #526

Open
rariyama opened this issue Jan 29, 2022 · 1 comment
Open

Improvement the way and environment of testing #526

rariyama opened this issue Jan 29, 2022 · 1 comment

Comments

@rariyama
Copy link
Contributor

Overall

I will offer some ideas about the way and environment of testing. It will improve developer experiences a lot.

Ideas

  1. to create a new command in Makefile which enables developers to test each function. Developer must currently test all functions even if they try to implement just one function.
  2. to make it possible to use the developer's credential instead of using default credential. If they would like to confirm the action of functions in pipeline, they must overwrite pygsheettest_service_account.json by their credential and also overwrite these classes by local spreadsheet. for example.
# @pytest.mark.skip()
class TestWorkSheet(object):
    def setup_class(self):
        title = test_config.get('Spreadsheet', 'title') + PYTHON_VERSION
        self.spreadsheet = pygsheet_client.create(title)
        self.worksheet = self.spreadsheet.worksheet()

        sp = self.python_client.open_by_key('MY_SPREADSHEET_KEY')
        self.worksheet = sp.sheet1 # to overwrite worksheet class by worksheet in myDrive

Any other info

If you feel positve about these ideas, I would like to contribute as much as possible.

@nithinmurali
Copy link
Owner

Hi @rariyama , these suggestions sound very promising and can improve the developer experience.

  1. since we are using pytest, this can be easily achieved by creating a new command in Makefile for calling the pytest command to run specific functions pytest test_mod.py::test_func

  2. I usually test my local changes using manual_testing.py. But you are right, if someone has to run the online tests on their account, it would need some fiddling around in config files. It would be nice to have a simpler documented method to do that.

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

No branches or pull requests

2 participants