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

Unit tests Improvement #541

Closed
wants to merge 1 commit into from
Closed

Conversation

takato1314
Copy link
Contributor

Add unit tests to the tutor project from 60 tests to 121 tests with a total code coverage of 63.57%. The detailed changes are described in the following pull requests in my committing repo:

image

@takato1314
Copy link
Contributor Author

Btw, I do notice that the one of the latest changes in the current master branch has failed tests on it and I have fixed it on my branch via #5. Was curious if the test pipeline is not working at the moment?

Copy link
Contributor

@regisb regisb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, thanks a lot for this PR. I understand that it's a lot of work to get started on writing a comprehensive unit test suite, and I appreciate the effort. I added many comments, and I really hope that we can resolve them all because I would very much like to land this PR.

.gitignore Outdated Show resolved Hide resolved
.gitignore Outdated Show resolved Hide resolved
.vscode/launch.json Outdated Show resolved Hide resolved
.coveragerc Show resolved Hide resolved
requirements/dev.in Show resolved Hide resolved
tests/commands/test_plugins.py Outdated Show resolved Hide resolved
tests/test_utils.py Outdated Show resolved Hide resolved
tutor/config.py Outdated Show resolved Hide resolved
tutor/config.py Outdated Show resolved Hide resolved
tutor/utils.py Outdated Show resolved Hide resolved
@takato1314
Copy link
Contributor Author

Hi @regisb , thanks for the feedback, I will look at the mentioned comments and adapt them by this weekend.

takato1314 pushed a commit to takato1314/tutor that referenced this pull request Dec 6, 2021
@takato1314
Copy link
Contributor Author

Hi @regisb , please find all of the changes mentioned amended as in this PR on my own fork.

@takato1314
Copy link
Contributor Author

takato1314 commented Jan 1, 2022

Hi and happy new year @regisb , just updated the PR with the latest master and resolved conflicts. I also reverted those remaining unresolved comments.
image

@regisb
Copy link
Contributor

regisb commented Jan 3, 2022

I moved my comments to a separate PR: takato1314#9

@takato1314
Copy link
Contributor Author

Hi @regisb. I've done approving and merging PR: takato1314#9

@regisb
Copy link
Contributor

regisb commented Jan 4, 2022

Awesome! Can you please rebase your changes on top of master and squash all your commits? (git rebase -i master && git push --force) Then we should be ready to merge.

regisb
regisb previously approved these changes Jan 4, 2022
@takato1314
Copy link
Contributor Author

Please dont approve first. There are some mistakes while rebasing the commits

@regisb regisb dismissed their stale review January 4, 2022 10:09

Errors during rebase

@regisb
Copy link
Contributor

regisb commented Jan 4, 2022

Ok let me know if you are facing issues with the rebase. If necessary I can rebase myself.

Update gitignore file

Use black to format code and fix unit test for test_pathjoin to use os.path.join() instead of hardcoding the path.

Changes:

- Remove #!shebang from the codebase because it will force the integrated terminal to you the global installed python instead of the one defined in venv.
- Add launch.json

Add coveragepy for measuring code coverage for tutor.

Add click command tests

Add unit tests for utils.py while fixing some issues encountered when running the tests on win32 platform

Add unit tests for test_config and test_plugins

Add unit tests for test_context and test_images

Add tests to test_config

Created TestContext used for unit testing

Add more tests to test_config
Add tests to test_jobs

Remove unnecessary cleanup process from TestContext in test.py  because we are using static CONTEXT now for the entire test suite to improve performance.

Remove notebooks from unrelated branch

Fix script errors on jobs.py

Revert jobs.py to support code templating and write tests for jobs

Improve unit tests for utils

Fix unit test issue from recent changes on master.

Fix issues on unit tests from latest master #8f90cc1

Fix all changes required for [PR#541](overhangio#541 (review))

Remove .vscode IDE settings from PR.

Fix failing unit tests from the latest master merge

Remove load_dev_requirements()

Revert to use POpen.Wait() instead of Communicate().

Add PR comments as code

Instead of adding many comments on top of the existing PR, I thought I could
make the changes myself and push them on top of the existing PR. If you agree
with these changes, just merge them in your branch and they will be reflected
in your PR.
@takato1314
Copy link
Contributor Author

takato1314 commented Jan 4, 2022

Hi @regisb. Sry for some delay. Finally figured out the rebase and able to run the tests successfully on my local machine. I also did a few quick start tests, seems to be working.

@takato1314
Copy link
Contributor Author

takato1314 commented Jan 4, 2022

Just a quick question, I saw this dependency error while install on windows with the command pip install -e ., is this something need to be taken care of? Error doesn't show on my WSL Ubuntu.

p/s: Sorry forgot to attach image
image

@takato1314
Copy link
Contributor Author

Ok I missed the failing error while running make test earlier. Will look at it.

@regisb
Copy link
Contributor

regisb commented Jan 4, 2022

@takato1314 I think that you have multiple errors in your rebase. I wil rebase your changes locally and will push the commit myself if that's ok with you.

@takato1314
Copy link
Contributor Author

takato1314 commented Jan 4, 2022

Yes please do so I shall close this PR then.

@takato1314 takato1314 closed this Jan 4, 2022
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