Is CI/CD integration possible?

Curious if CI/CD integration is possible. I'd like to be able to eventually be able to run tests that may lead to deploying to a different environment.

Hi @AlexValdez, When you say “that may lead to deploying to a different environment”, do you mean that if the tests fail you want to deploy to one environment, and if they pass you want to deploy to another environment?

@KobieBotha Sort of. Environment may have been the wrong choice of words. Deployment environment may be more useful. Here’s a use case: you have your application running in the testing environment. Lets say I want to deploy to production. I would like to be able to deploy to staging first, have it run some tests and if it passes then it will auto deploy to production. If it fails, it’ll stay in staging. Something similar to that.

Preamble

While the platform does not have direct integration with CI/CD tools (yet), it is possible to integrate tools into the workflow for an app.

A prerequisite for the steps are that you need to have GitHub integration enabled for your app (you can do this by clicking on Git Integration under app settings and following the prompts).

Any CI service that works with GitHub can be used to run - for example on each commit, each pull request, or manually. At JourneyApps we recommend using GiHub Actions, but other CI services such as CircleCI could work just as well.

With CI/CD we often refer to the automated tests as either:

  • Unit tests, which test specific pieces of code directly.
  • Integration tests, which run tests against a deployed environment.

Unit Testing on CloudCode

Since CloudCode is mostly built on the standard NodeJS ecosystem, standard tools such as Mocha can be used for unit testing.

In cases where you’re working with the DB or other JourneyApps APIs, these APIs should be mocked out.

Unit Testing of App Code

We do not currently have an elegant way to run unit tests against app code. We are working on supporting standard modern JavaScript features and modules in app code, which will simplify this. Keep a look out for announcements during the year.

Integration Testing on CloudCode

  • Web tasks have a public API that can be tested directly.
  • Webhook tasks can be tested by creating the relevant objects with the backend API.

Integration Testing of Apps

We do not currently have an elegant way of running integration tests against apps.

We are planning on releasing web support soon. This will let you access your app via a URL without needing to install a container. Web support is currently in beta and can be enabled on request - simply email our support team. When support for web is released, it will be possible to use any standard web automation tools to run integration tests against deployed apps.

Automated Deployments

Deployments can be automated using the editor API: https://docs.journeyapps.com/reference/technical/editor-file-api--private-beta-

1 Like

This is great! Thanks for the help. @KobieBotha

Great, thanks for the confirmation @AlexValdez ! If you encounter anything specific that will make your life easier, please feel free to submit ideas at our product portal: https://roadmap.journeyapps.com/

@AlexValdez Here is a similar question with a walkthrough on how to set up unit tests and have them run in a CI pipeline/service: How to run unit tests?