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
Create new unit tests for Evennia #1458
Comments
|
i can give it a try 😄 |
|
Hi, just find out this repo for hacktoberfest. |
|
@Keda87, @vaibhavsingh97 That's great! I updated the issue with some more info. :) |
|
I also added some exceptions. No need to dig into making unit tests for the game_template since it's basically well, empty template files. |
|
@Griatch how can I see coverage report for testing on my local machine? |
|
@Keda87 It's not necessary to run
# linux
coverage run --source=../evennia --omit=*/migrations/*,*/urls.py,*/test*.py,*.sh,*.txt,*.md,*.pyc,*.service ../evennia/bin/unix/evennia test evennia
# windows (untested)
coverage run --source=../evennia --omit=*/migrations/*,*/urls.py,*/test*.py,*.sh,*.txt,*.md,*.pyc,*.service ../evennia/bin/windows/evennia test evennia
|
|
@Griatch Hi, I read some documentation and have started with some testing on syscommands.py, but I am not able to follow how the args passed on to cmdobj in each test are used. Could you direct me to the particular docs that may make me understand how the strings passed in the tests as args are handled by CommandTest? Spare me for a noobish question but am new to gitHub :p |
|
@Griatch thank you, I just want to ensure the coverage increasing |
|
@gulasnani As you can see in TestCommand, the Normally (when a real command is run in Evennia), these are the arguments passed to the command. So if the command was Now, in the case of the test, the execution of the command is emulated, with the body of the command being executed when first the In the specific case of the Hope that helps! |
|
@Griatch Thanks a lot for walking me through! Quite helpful it was, as there were just a few bits I overlooked which were of actual importance for the overall understanding. |
|
Is there a nice way to run only specific tests? I see that I can run But if I just wanted to test, say, the accounts module how would I go about that? |
|
Reading the django docs, I found writing |
|
Yes |
|
Hi, I'd like to help too by running some tests :) |
|
@BeaData Any tests are good tests. See the first post of this issue, they should help to get you going. Pick an untested module/package that looks interesting to you. :) |
|
@Griatch There seems to be an issue with the coveralls configuration. I can't view any of the source files to see where the coverage gaps are. The error is of the form: Unless I'm doing something wrong, it's been a few years since I last used coveralls. |
|
I looked into the error message and it appears that repo owners should be given an option to change the repo root directory when that error message pops up. HTH! |
|
@selberhad Oh, haven't looked at the detailed coverage in the while. I updated the root now, so you should be able to see the source code. Thanks for the heads up! (The |
|
Turns out that coverage doesn't like parallel execution. The coverage data was fixed now, so |
Brief summary of issue / Description of requested feature:
This is an issue originally started under hacktoberfest but extended beyond that. The issue is for expanding Evennia's unit test coverage. This is also a great way to learn some of Evennia's systems under the hood.
Steps to reproduce the issue / Reasons for adding feature:
evennia/that lacks unit test coverage.a. Exception:
/evennia/game_template/*is not much point to unit testb. Exception: Any
/migrationssub directories should not have unit testsevennia test evenniafrom the game dir.tests.pyfile yet exists in the sub-package in question, add it and then add your test to it. It will automatically be picked up by the test runner. See othertests.pyin the Evennia repo for help.Expected result of feature
We are currently at
53%64% unit test coverage, why not expand that?Extra information, such as Evennia revision/repo/branch, operating system and ideas for how to solve / implement:
This is against
masterbranch. Ask in forum or chat (#evennia on irc.freenode.net) if you have any questions on how to test a particular system - we are happy to help!Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: