2

We are currently developping two rails apps that communicates via an API (made with Grape). This morning I worked on the 'server' app, and the changes I made results in an error 5OO on the staging of the 'client' app.

To adress that, I want to create a Jenkins job that check the synchronization between the two apps. The process could be this one:

  1. A push is detected on the app A (or B)
  2. Build both apps
  3. Run an integration test through both apps
  4. Deploy both apps

I'm looking for the best way to do that. I found that question and this one, but there wasn't that much information in the answers.

One of the main problems is the integration test itself: how can I test through two apps with capybara ?

Community
  • 1
  • 1
Ruff9
  • 1,163
  • 15
  • 34

1 Answers1

0

I would treat them as they are, independent apps. Setup a jenkins job for each app. Setup a sandbox for each app and let your integration tests use the sandbox. You can also use the sandbox for your development environment. No need to start app 2 when you are locally only working on app 1. When you push to repo 1 lets run only jenkins for app 1. If it succeeds, deploy only app 1.

If you really really need all this done in one job, then think about enginges. Create both apps as an engine and for integration tests mount them into one rails app.

FacundoJ
  • 391
  • 4
  • 11
slowjack2k
  • 2,566
  • 1
  • 15
  • 23
  • the problem I want to adress is that if I change the api shape in one app, it can result in an error 500 in the other app. I want my system to check if the two apps are synchronized. I will update the question to reflect this. – Ruff9 Aug 10 '16 at 13:35
  • In this case you have once again multiple options. For instance you can use one repo for booth apps and trigger multiple jobs. Or you can use the Pipeline Plugin to triger job 1 when job 2 is succesfull or vice versa. Or you can use conventions which API changes are allowed and which need to increment version number of the API. Furthor more I would run all jobs once or twice a day, to ensure every thing is fine. This is good idea because external API's from other vendors can change too without noticing. – slowjack2k Aug 10 '16 at 14:27