Sunday 21 October 2018

How much time it will take to build/virtualize a simple, medium and complex service?

Question

I'd like to know how much time it will take to build(Virtualize) a simple, medium and Complex Service

Answer

A simple service depending on your team's maturity and setup will typically take a few minutes to a day.
A medium service can take from a few hours to a few days.
A complex service can take from a few days to a few weeks.

Question

What are all the activities involved from start to finish

Answer

That depends on your environment and team structure. As an example, I recommend having a look at http://blog.trafficparrot.com/2016/09/five-steps-on-how-to-implement-service.html

We would like to learn more about your organisation in order to help you deliver your server virtualization project. Please email us at consultation@trafficparrot.com to schedule a call where we can discuss your requirements.

Saturday 20 October 2018

If-else dynamic API mock responses

Question

How do I generate dynamic API mock/stub responses and use if + else if + else in GRPC?

Answer

You can start with multiple equals blocks one after another. For example:

{{#equal (jsonPath request.body '$.itemCode') '100'}}
    { countryCode: 'ES' }
{{/equal}}
{{#equal (jsonPath request.body '$.itemCode') '200'}}
    { countryCode: 'IC' }
{{/equal}}
{{#equal (jsonPath request.body '$.itemCode') '300'}}
    { countryCode: 'TW' }
{{/equal}}
{{#equal (jsonPath request.body '$.itemCode') '400'}}
    { countryCode: 'CH' }
{{/equal}}

If that does not satisfy your needs, you can do nested equals blocks.

{{#equal thing 'something'}}
   {{#equal 'one' 'two'}}
       Yes!
   {{else}}
       No!
   {{/equal}}
{{else}}
   Not a thing!
{{/equal}}

Saturday 6 October 2018

Sidecar Container Pattern in Service Virtualizaion and API mocking

Traffic Parrot has first-class support for the sidecar docker container pattern.

Let's assume if you work with a Jenkins Continuous Integration pipeline and test your microservices there to get to production fast. The more external dependencies the build pipeline has, the more risk you have those dependencies will cause the build to be unstable and fail because of external dependency issues, not related to the code quality. External dependencies should be kept to a minimum. For example, run your database in Docker per build (on Jenkins Slave), not in a shared environment. It is a pattern similar to the "sidecar" container pattern recommended by Jenkins.

We recommend running your API mocks in the same process as your tests. If you decide to run your API mocks or virtual services in a separate process though, run them in a docker container. This way you are taking your automation to the next level, you have a fully automated and reproducible build pipeline.

Because of issues with dependencies, avoid using centralized instances running API mocks and virtual services outside your build pipeline. You can use them for exposing mocks to other teams and departments and for manual exploratory testing, but not in your automated CI builds.