Question

I am developing a web application that includes with it a few 3rd party libraries. I am using travis ci and have my own test suite for my tests, but should I also be running the 3rd party library test suites if they have provided one?

For example:

MyApp
    Tests
Lib1
    Tests
Lib2
    Tests

I definitely want to run my own tests, under MyApp. MyApp uses Lib1 and Lib2, therefore should I also run their test suites first.

No correct solution

OTHER TIPS

If the suite contains only tests and if you're confident that those tests have been run before the library was released, then no, you shouldn't bother running someone else's tests. It will just slow down the testing process, making it less continuous. This may result in developers getting annoyed at speed of local unit testing and they might stop running the tests locally before committing.

If you don't trust the library for any reason (for example, if the third party is actively developing the library for your consumption and the library hasn't been used by anyone else, or if your project manager is simply paranoid) then you can run the tests. There's no harm in it beyond the increased time taken. You can mitigate this by running those tests outside of the normal unit test flow, in a separate Jenkins job or similar.

If the suite contains a library of methods that you can use in your own tests for checking or mocking the third party library, then you probably do want to import the library.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top