Skip to content

Documentation / Running Odoo

Preview Deployments

Automatically create preview Odoo environments for GitHub pull requests.

Preview deployments create a temporary, neutralized copy of your Odoo service whenever a pull request is opened on a connected GitHub repository. This lets your team review addon changes on a live Odoo instance before merging.

How it works #

  1. A pull request is opened on a connected repository
  2. calmo.cloud automatically creates a neutralized copy of your service
  3. The PR's branch addons are deployed to the copy
  4. A preview URL is posted back to the pull request via GitHub Deployments
  5. When the PR is closed or merged, the preview is automatically destroyed

Previews are created on the service's server for copies when one is set (see Creating Copies), so they can run on a test server instead of next to your production system.

Setting up preview deployments #

1. Connect a repository #

Make sure the repository containing your Odoo addons is connected to your service.

2. Enable previews for the repository #

Open your service, go to the Repositories tab, and click the Enable Previews action on the repository you want to enable previews for. The "Previews" column will show an eye icon when enabled.

3. Open a pull request #

Create a pull request on the connected repository. calmo.cloud will automatically create a preview deployment and post the status to the PR via the GitHub App.

Your preview deployment is now set up. Every new PR will get its own isolated Odoo environment.

4. Run the tests on every pull request (optional) #

On the same Repositories tab, click Enable Tests on the repository. From then on, calmo.cloud runs the Odoo tests of the repository's addons on every preview — when the preview is created and again after every push — and reports the result back to the pull request.

The result appears as a check on the pull request's commit, named after your service (for example calmo.cloud tests: Production). If the GitHub App may not create checks, calmo.cloud posts the result as a comment on the pull request instead. Add the Checks: Read and write permission to your GitHub App to get checks, which a branch protection rule can then require before merging.

You can also start a run by hand: open the Preview Deployments tab and click Run tests on a preview.

Managing previews #

Viewing active previews #

Open your service and go to the Preview Deployments tab. You'll see all previews with their:

  • PR number (linked to GitHub)
  • Branch name
  • Status (Creating, Active, Updating, Failed, Destroyed)
  • Tests (the outcome of the latest test run, with how many tests ran and failed)
  • Preview URL
  • Associated service

Creating a preview manually #

You can also create previews manually from the Preview Deployments tab by clicking Create Preview. Select the repository, enter the PR number and branch name, and calmo.cloud will create the preview.

Destroying a preview #

Previews are automatically destroyed when the PR is closed or merged. You can also destroy a preview manually by clicking the Destroy action on the preview deployment.

What happens during preview creation #

When a preview is created, calmo.cloud:

  1. Creates a full copy of your service (database + files)
  2. Neutralizes the copy to disable crons and external connections
  3. Overrides the branch for addons from the PR's repository to use the PR branch
  4. Posts a GitHub Deployment status with the preview URL
  5. Deploys the PR branch's version of the repository's addons and upgrades them, so the preview runs the pull request's code
  6. Runs the tests, when they are enabled for the repository

What happens during a test run #

A test run takes every addon of the pull request's repository that is deployed on the preview and runs one odoo --test-enable for all of them: addons that are installed on the preview are upgraded, addons that are not are installed, and the standard tests of exactly those modules run. The preview is stopped for the duration of the run and started again afterwards, whatever the outcome.

The result on the pull request tells you how many tests ran and which ones failed. The full Odoo log is on the preview service's Actions tab, which the report links to.

Tests run against the preview's database, a neutralized copy of your service. A run can take a while on large modules; it is limited to 50 minutes.

Preview copies are always neutralized. Crons and external connections are disabled to prevent unintended side effects.

Lifecycle #

PR Event Action
Opened / Reopened Creates a new preview deployment, then runs the tests when enabled
New commits pushed Re-syncs and redeploys changed addons, then runs the tests when enabled
Closed / Merged Destroys the preview and cleans up resources

Important notes #

  • Each PR gets its own isolated preview — multiple PRs can have active previews simultaneously
  • Previews are always neutralized to disable crons and external connections
  • Preview services appear as type Preview in your service list
  • Destroying a preview soft-deletes the service — it won't appear in your active services but can be found in the trash filter
  • Previews can only be enabled on services that are not themselves copies or previews