opentelemetry-php
opentelemetry-php copied to clipboard
Move Integration Tests out of Unit Tests.
At the moment there are a few tests marked as Unit tests, which are actually integration tests. They test side-effects of a class or do not provide isolation through mocks, stubs or test-doubles. They create false positives in code coverage because of code execution in the leaking into the Unit Tests' code coverage reports.
- Move "integration test like" tests from Unit Tests into the Integration Test suite(s)
(This will probably drop the code-coverage by a bit, since we will get a more realistic picture. A PR with above adjustments, does not necessarily need to provide new tests to make up for the code-coverage drop))
I'm working on this. Am moving a few obvious integration tests across into the Integration area, but also annotating existing unit tests with @covers to reduce false coverage, which should make clearer what is not being tested properly.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
@tidal Can you please assign this issue to me?
@tidal This issue was created long back. From numerous merges to the main branch after that, seems like unit tests and integration tests are segregated into respective folders and that too in a proper way. Can someone please confirm that this issue is still valid, and help me with identifying the key areas to look into, if any.
Hi @sangeethjohn07 You are correct that a lot of work has been done to fix up the tests since this issue was created, either as part of this issue or as a side-effect of other contributions.
I suspect there are still some integration tests disguised as unit tests, i.e Move "integration test like" tests from Unit Tests into the Integration Test suite(s) from the issue description.
Please spend some time going through our existing unit tests looking for such tests and move them out if you find them. When you're satisfied that our unit tests are all "true" unit tests, let us know and we can close this issue.
We've decided to close this issue because it's getting a bit long in the tooth. If anyone has any reservations about this, please feel free to open this issue again or a new issue.