1

Our microservices are going to be deployed on AWS, using Pipelines. A step on this pipeline will execute integration tests using a dedicated database on AWS, a MySQL instance.

My question is: since I want to execute integration tests also locally, while developing, should I need to replicate exactly what's happening on AWS?

Locally I could use an in-memory database like H2, which can receive different SQL dialect, like MySQL ones, but it's still something different from what CI will offer to us.

So:

1) Should I replicate a MySQL instance locally, maybe using Docker (i.e.)?

2) Can be H2 database a good solution?

3) Should I avoid integration tests locally, and execute them on CI only?

  • 2
    3) No. 2) we do not make tool recommendations on this site, you need to try it out if it works for your case, we don't know that. 1) Only if step 2 tells you H2 is not good enough for your situation. – Doc Brown Aug 18 '17 at 16:23
  • It's not a tool choice, but a different point of view: since H2 is a database that can "eat" different dialect, but it's not MySQL itself. Isn't this a different IT? Since this environment is quite different from our CI one. – abierto Aug 21 '17 at 6:21
  • Thanks for agreeing to me that you have to try it out if if works for your case, or if the differences are too big. We don't know this. – Doc Brown Aug 21 '17 at 6:58
  • 1
    Sure, that might happen - or not. Maybe once in 10 years, once per month, once per day, once per hour. Depends on your system, how your SQLs and tests are written, and a dozen factors of your environment. When you can reduce the number of bugs by a local test using H2 by a certain amount, there is some value in it. When using a local MySql instance reduces the number of bugs more significantly, you might prefer that. Maybe H2 is so much faster than MySql for your case, you decide to use both. But it always depends on your case. – Doc Brown Aug 21 '17 at 9:00
  • 1
    Thank you doc! We will then try both solution and then choice the best one for us. – abierto Aug 21 '17 at 9:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.