'E2E tests with multiple repositories in CircleCI

I have a project in which the backend is a Rails app (API-only mode) while the frontend is a React app. They are in different Github repositories but I'd like to run end-to-end (e2e) tests against them.

I have thought about some possibilities but the one I prefer the most isn't widespread across the internet (at least, I haven't found people suggesting what I'm about to do).

At first, I thought it'd be enough to create a logic in my CI to do the following:

  • if the backend pipeline is triggered, then try to run the e2e tests against a frontend branch with the same name (and vice-versa). If there is no branch with the same name, then runs against master.

The above approach has some flaws:

  1. if I change both projects, the first time I push changes to Github (and thus trigger the CI build), tests will run against the master for the other project because it won't have the branch with the same name yet.
  2. sometimes (for convenience) a complex project can have multiple PRs/branches - which would break the parity. So (for instance) imagine 2 PRs created for frontend and 1 PR created for backed (obviously, each of these PRs is based on a different branch). In this case, one of the frontend PRs would have tests running against the backend's master branch (which is wrong).

That said, I'm planning to put both projects in the same git repo.

So my question is: am I missing something in terms of drawbacks? Why people aren't going with this path in their projects more often?

Thanks in advance 🙇🏻‍♂️

Extra info:

  • my projects are deployed using AWS CodePipeline
  • my CI is CircleCI


Solution 1:[1]

I've found very little in the way of useful resources about E2E testing of multiple repos at all. We have a very similar situation -- an RoR application functioning as the API and a VueJS app that consumes it. We have written a series of RSpec integration tests that we can execute locally, but incorporating it into a CI setup is ... not easy.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Ben Walsh