Oh man, we’re back.
At the start of the week, I was informed of a microservice module called “Satellite”. Now, Satellite is the place where we keep any commonly used microservice. I really wanted to learn more about microservices and I thought this is the place.
During this week, I’ve worked on at least 3 modules for Satellite: createError, Redis, and Hash.
hash, and createError were pretty simple for the most part
but redis…. oh my….
Now, porting the code wasn’t the hard part. The hard part was to get the test to work properly. All I really had to do was to send a PING request, so that the service could return the string “PONG”. Well, first I realized that I needed to run Docker. Okay, understandable. but then after, I need to create a promise function that will handle the PING command. “So, what’s the problem?” you might ask. Well… there’s just one tiny problem. Jest does not quit, because the service is still running. Even when I killed Docker, it would still hang.
Now, in terms of figuring out what to do, I need to think of a couple of things: Where should the test go, Telescope or Satellite? If so, do I need to have a kill command within the test? How long should the promise wait before it receives “PONG”? These are all questions that I need to figure out, otherwise, Redis will not be properly ported.
I think that’s okay though, it’s how you learn after all, with many, many retries (and rebases).
So, what will be my next step? To be completely honest, I need to play around with Redis a lot more. I need to understand how it works in order to make the tests. I won’t give up.