-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Add tests with pytest #133
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
Conversation
This reverts commit 9508b4d905d1d048d98f7ca28ee11735906ad2f8.
- cmd.exe //c "RefreshEnv.cmd" | ||
- python -m pip install --upgrade pip | ||
- python -m pip install --user -r ./.travis/travis-requirements.txt | ||
- python ./scripts/pycairoinstall.py | ||
- cmd.exe //c "RefreshEnv.cmd" | ||
- python -m pip install --user . | ||
script: | ||
- python -m pytest | ||
- python -m pytest --skip_end_to_end -rs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same thing (as far as DRY goes) for Windows here. We probably want to use a .bat
script to set up the environment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment was supposed to be 3 lines up in before-install
, but you get the gist.
As a lot of things depend on when this PR is merged, I propose to merge it now. All of the suggestions that had been said here were all very good and I'm working on them, but they don't concern the core of the tests. I will do another PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what are the tests_cache
and tests_data
directories for? Shouldn't Travis or whatever automatically generate those folders? Then they shouldn't be in the repo and should be in .gitignore
Also, should we follow guidelines and also add typings to the testing_utils.py
file?
These files are the whole point of the tests. tests_data contains the previously rendered frames that serve for the comparison (if the frames match, then all good and if not, a thing had been changed). Thus, in essence, it can't be generated by Travis itself. About typing stuff, maybe you're right but that's not the correct PR to do that, I think. |
I see. In this case, the files should be stored elsewhere in my opinion, such as in a separate branch or site or whatever, then we should have Travis fetch those.
Same comment as above ^
You're probably right, but what about documentation following the guidelines? |
To be honest, I don't think this is a good idea. For two main reasons :
But why do you want this? Is there like a convention or something? Or is it just cleaner ? For documentation following the guidelines, you are totally right. I will commit asap. |
Co-authored-by: Pg Biel <9021226+PgBiel@users.noreply.github.com>
Co-authored-by: Pg Biel <9021226+PgBiel@users.noreply.github.com>
Co-authored-by: Pg Biel <9021226+PgBiel@users.noreply.github.com>
I simply thought it would be cleaner in a way, given that we will all be cloning this repo (+ users downloading, soon) so I thought it would be a good idea to not have a lot of otherwise irrelevant "bloat" yk. There probably are alternatives here, but we gotta think this through |
Then if you find a way that would be nice, I would suggest doing a new PR |
The test cache files are an integral part of the testing system we have setup. I think they should be in this repo, in the @huguesdevimeux you do raise a good point. Most of our comments were not about the core testing system that this is setting up. Can I ask you to please extract the standing discussion points and making separate issues for those that warrant it? If you think this is ready to be merged, then say so and I'll merge it. |
So I created a bunch of tests for pytest. To run them,
pytest
command is enougI tried to test pretty much all of the features that manim currently has. Don't hesitate to tell if some miss.
Functioning :
See #34 and #97.
For performances purpose it just compares the last frame with a previously-rendered one (and not a frame every n seconds, as it was mentioned in #34. On my computer, it takes around 30 seconds.
Adding a new test
I created the function
utils.set_test
that is intended to be used when we add a new feature.I think that we should create a section in the wiki to explain how to create a new test and mention it in #127.
For the moment I marked this PR as a draft since it uses some stuff (see conftest.py) that will be completely rewritten when #98 is merged.
closes #28 closes #34 closes #97