kyungjunim
kyungjunim

Jun Im

@kyungjunim

I write things that I learnt here and there. Happy to be corrected!

3 Posts 216 Views

  • No matching results...
  • Searching...

/ 255

Poll Options

One of the resource files was causing a n+1 problem. But, due to our business logic, we made a decision not to eager load the relationship. My solution was to save the owner_id of each businesses in a cache.

I wrote tests and they passed without a problem. Existing functionalities worked as expected locally. But, when it was pushed to the production, it caused an issue where the returning value was always false, even when it should have been true.

The issue was that I was using a different cache driver. This was an issue because Redis stores everything as a string value and would not return an integer (which I did not know about).

Lessons learnt:
1. Mirror your production env as closely as possible.
2. Redis stores everything in string.

image
image

79

@nunomaduro How does mutation testing work? (it's magical by the way!! thank you). Does it pretty much temporarily remove any line/parts of code that cause mutation? and hence if your test coverage is good, make your tests fail and catch them?

203