Scribe-Data icon indicating copy to clipboard operation
Scribe-Data copied to clipboard

Add test for CLI tool

Open mhmohona opened this issue 1 year ago • 7 comments

Contributor checklist


Description

image

Related issue

  • #ISSUE_NUMBER

mhmohona avatar Jul 10 '24 13:07 mhmohona

Thank you for the pull request!

The Scribe team will do our best to address your contribution as soon as we can. The following is a checklist for maintainers to make sure this process goes as well as possible. Feel free to address the points below yourself in further commits if you realize that actions are needed :)

If you're not already a member of our public Matrix community, please consider joining! We'd suggest using Element as your Matrix client, and definitely join the General and Data rooms once you're in. Also consider joining our bi-weekly Saturday dev syncs. It'd be great to have you!

Maintainer checklist

  • [x] The commit messages for the remote branch should be checked to make sure the contributor's email is set up correctly so that they receive credit for their contribution

    • The contributor's name and icon in remote commits should be the same as what appears in the PR
    • If there's a mismatch, the contributor needs to make sure that the email they use for GitHub matches what they have for git config user.email in their local Scribe-Data repo
  • [x] The linting and formatting workflow within the PR checks do not indicate new errors in the files changed

  • [ ] The CHANGELOG has been updated with a description of the changes for the upcoming release and the corresponding issue (if necessary)

github-actions[bot] avatar Jul 10 '24 13:07 github-actions[bot]

Hey, @mhmohona! :wave:

I noticed the tests appear to be failing when running in the CI. Did notice also though that the screenshot in the PR description shows the tests do run OK when pytest is ran within src/scribe_data/cli. Does running pytest in the root of the project still run OK too?

wkyoshida avatar Jul 10 '24 23:07 wkyoshida

Hey, @mhmohona! 👋

I noticed the tests appear to be failing when running in the CI. Did notice also though that the screenshot in the PR description shows the tests do run OK when pytest is ran within src/scribe_data/cli. Does running pytest in the root of the project still run OK too?

Thank you @wkyoshida for looking into this. The thing is this tests passes when everything is in one place. I mean all the files, total.py, list.py, query.py is in one branch, then these tests works without any error. Both unittest and Pytest passes. I tried it locally and it passes as you can see in screenshot.

mhmohona avatar Jul 11 '24 09:07 mhmohona

Ok so the tests are passing, but then a question I have is when are the tests that we have written here ran? Is it possible to move the tests for the CLI into the Scribe-Data/tests directory such that they're ran as a part of the pytest suite?

andrewtavis avatar Aug 11 '24 20:08 andrewtavis

Would you be able to make this change, @mhmohona? Let us know if you have any questions!

andrewtavis avatar Aug 11 '24 20:08 andrewtavis

Ok so the tests are passing, but then a question I have is when are the tests that we have written here ran? Is it possible to move the tests for the CLI into the Scribe-Data/tests directory such that they're ran as a part of the pytest suite?

I will work on it.

mhmohona avatar Aug 12 '24 00:08 mhmohona

@mhmohona, just updated both your branches as there have been tons of changes recently. Let us know if there's anything we can do to support with these!

andrewtavis avatar Aug 18 '24 17:08 andrewtavis

@andrewtavis @wkyoshida this PR is up for review now.

mhmohona avatar Aug 26 '24 02:08 mhmohona