Skip to content

Ghost Inspector Sync

Andy Potanin edited this page Jun 21, 2026 · 1 revision

Syncs Ghost Inspector test suites, tests, and variables from Rabbit configuration.

Use this module when a Rabbit service needs automated browser testing managed through IaC, with test definitions stored alongside infrastructure config.

Supported Features

  • Suite creation or lookup by folder and suite name.
  • Suite-level options (browser, region, timing).
  • Suite schedule configuration.
  • Suite variable management (including private variables).
  • Test import with steps on first apply.
  • Test metadata updates on subsequent applies.
  • Test defaults inherited by all tests.

Prerequisites

  • A Ghost Inspector API key stored in GCP Secret Manager.
  • GCP credentials with permission to read the API key secret.

Important Notes

  • gi_api_key is resolved by R2A from a GCP Secret Manager path before Terraform runs.
  • When suite_id is empty, the module finds or creates a folder with folder_name and a suite with suite_name inside it.
  • variables replaces the suite's entire variable set on each apply. Omit to leave variables unmanaged.
  • Test steps are only imported on the first apply. The Ghost Inspector API does not support step updates, so only metadata is updated on subsequent applies.
  • test_defaults are shallow-merged into every test definition; test-level values take precedence.

Minimal Example

services:
  - name: "Ghost Inspector Sync"
    module: "ghost-inspector-sync"
    id: "gi-sync"
    deployment_order: 160
    configurations:
      gi_api_key: "projects/123456/secrets/GHOSTINSPECTOR_API_KEY"
      folder_name: "My App"
      suite_name: "Production Tests"
      tests:
        homepage:
          name: "Homepage loads"
          startUrl: "https://example.com/"

Outputs

Output Description
synced_test_ids List of Ghost Inspector test IDs that were synced.
test_count Number of tests configured for sync.
synced_variable_names Names of suite variables managed by this module.
variable_count Number of suite variables configured for sync.

Full Configuration Schema

The fields below are public module inputs under configurations.

configurations:
  gi_api_key: ""
  suite_id: ""
  folder_name: ""
  suite_name: ""
  description: ""
  options: {}
  schedule: {}
  variables: {}
  test_defaults: {}
  tests: {}
Field Type Required Description
gi_api_key string Yes Ghost Inspector API key or GCP Secret Manager path.
suite_id string No Existing suite ID. When empty, folder_name and suite_name are used.
folder_name string Conditional Folder name to find or create. Required when suite_id is empty.
suite_name string Conditional Suite name to find or create. Required when suite_id is empty.
description string No Suite description synced on every apply.
options map No Suite-level options passed to the GI suite update API.
schedule object No Suite schedule configuration.
schedule.enabled boolean No Enables the schedule.
schedule.interval string No Schedule interval, such as daily.
schedule.time string No Schedule time, such as 08:00.
variables map No Suite variables. Values can be strings or objects with value and private: true.
test_defaults map No Default settings inherited by all tests.
tests map[test] No Map of test definitions keyed by logical slug.

Clone this wiki locally