Skip to content

Introduce tox, add more tests & fix bugs #114

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

Merged
merged 3 commits into from
Dec 28, 2020

Conversation

boris-42
Copy link
Contributor

  • Change structure of the repo where all tests are moved under tests/* directory
    -- All functional tests (one that exists now) are under tests/functional/*
    -- Unit tests are added under tests/unit

  • Fix most of code style issues, according to the (PEP8)

  • Introduce tox as helper that helps to unify testing experience (this is very very popular tool in python community, downloaded 1M+/month)

  • Introduce 4 tox commands:

    • tox -e py3 to run unittests
    • tox -e pep8 to run code style checks
    • tox -e cover to run unittests with coverage
    • tox -e func to run existing functional tests
  • Cover with functional tests Node, Edges, Paths

  • Fix found bugs

  • Removed assserts

If this is accepted next steps are planned:

  • To cover rest of functionality with unittests
  • Improve a bit code styles by reangling some of style checks
  • Refactoring circle CI config to use tox

Note: check commit by commit for simplicity they are separated logical steps

Plaese refer to tests/README.md

This patch as well:
- Improves readme regarding to testing
- Fixes found bugs
- Replaces asserts
@boris-42
Copy link
Contributor Author

@gkorland @swilly22 Okay guys before moving with refactoring I think it's good idea to cover everything with unittests, can you please take a look at this PR what do you think?

@swilly22
Copy link
Contributor

Hi @boris-42, we really appricate all of your help! I'll review this PR carefully tomorrow morning. thank you!

@swilly22 swilly22 merged commit 2bd540a into RedisGraph:master Dec 28, 2020
@swilly22
Copy link
Contributor

@boris-42 CI currently fails at:

run tests
0s
#!/bin/bash -eo pipefail
. venv/bin/activate
coverage run tests/functional/test_all.py
Traceback (most recent call last):
  File "tests/functional/test_all.py", line 2, in <module>
    from tests.utils import base
ModuleNotFoundError: No module named 'tests'

Exited with code exit status 1
CircleCI received exit code 1

Care to dig into this?

@boris-42
Copy link
Contributor Author

@swilly22 Will do it today

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

Successfully merging this pull request may close these issues.

2 participants