DEV Community

George Offley
George Offley

Posted on

Unit Testing Communication

Just a question about unit testing. How do you communicate that unit tests are passed. We started putting together libraries for some of our most used database functions. I'm trying to conduct unit testing for some of the stuff I'm adding. I'm curious what others do.

Is it in your guidelines for pushing to your repos that all tests must pass?

Is it part of your peer review to go over passed tests?

Do you put a comment in your code that the class or method passes.

Is it something else?

Top comments (2)

Collapse
 
hawarioware profile image
Wajdi Al-Hawari • Edited

This is dependent on what language you are using followed by the system you push to. Coming from a Python background, this would mean using something like tox to run all the tests I have written. All being past and new tests.

Then the system you are pushing to would be some combination of your central repo coupled with some CI tooling like Jenkins.

Currently in my professional domain it is actually Gitlab.

If I'm working upstream on GitHub I would use Travis.

But very important to note that your CI system is as strong as what you give it. So you need to make sure whatever language you are using, you have used the appropriate tooling to run your tests and provide a result that these systems can use to indicate the pass/fail scenario.

In terms of rules and guidelines. Focusing more on just the reviewing part. The rule is to checkout the code and try to break the code ensuring that the tests behave accordingly to ensure the appropriate cases are caught and we are collectively confident in pushing to master.

Collapse
 
erikwhiting88 profile image
Erik

Usually the build server (Circle CI, Jenkins, etc) runs the unit tests on every push and rolls back the deployment if there's a failure. This way, everyone can see the status of the tests.