3

Should someone cover sphinx search results tests in there tests suits?

What I was thinking: "Thinking Sphinx is a gem that is widely used and tested by many users and contributors. So Why should we retest it in our applications."

Shaeldon
  • 873
  • 4
  • 18
  • 28
Malik Shahzad
  • 6,703
  • 3
  • 37
  • 49

1 Answers1

2

I think it's always good to have a understanding of that the code(TS in this case) your depending looks like and is tested well. Convince yourself the tests inside the TS cover what you use and are will catch regressions.

Further then that I think you have the right mindset. More importantly, having Unit tests depend on 3rd party libraries or services is normally a bad idea as you would be (unintentionally) testing their system. To cover the integration with TS in your application you should write some integration/end-to-end tests that stress the entire infrastructure. The latter is normally slow and can be a bit cumbersome but do add great value. Furthermore it's important to have your unit tests and integration tests separated so you can only run the integration tests prior to a deployment or have it run on in CI.

HTH,

Novae
  • 1,071
  • 8
  • 17
  • Further to Novae's point - spot on about unit tests not testing code from other libraries, but definitely you want integration tests, not to check that TS works, but to check that your use of TS works as you expect. – pat Nov 13 '14 at 12:17
  • How can i write a test for thinking sphinx in rails application? – Zia Qamar May 12 '16 at 09:52