Skip to main content

Doctor (E2E)

Backend E2E test suite for the HeadshotMarketing product (wspace-headshotmarketing-svc).

This repository contains standalone GraphQL-driven tests that exercise the HeadshotMarketing workspace microservice through the workspace public gateway. It was bootstrapped from the HeadshotMarketing module of workspaces-doctor and extended with a product-specific story test.

What is covered​

SuiteLocationFocus
Entity CRUDLwspace/modules/headshotmarketing/scripts/test-headshotmarketing.shcampaign, contact, audience, pipeline (+stage), deal, lead, socialaccount
Paid-ad storywspace/modules/headshotmarketing/scripts/test-headshotmarketing-paid-ad-story.shcampaign → audience → ad campaign → ad creative → ad metrics (cleanup)

Prerequisites​

  • jq, curl, and a Bash shell.
  • The shared doctor environment must be sourced when running locally:
    source /home/ubuntu/products/workspaces/workspaces-doctor/core/env/e2e-env.sh
    This provides AUTH_TOKEN / E2E_AUTH_TOKEN, WORKSPACE_ID / E2E_WORKSPACE_ID, and WORKSPACE_TOKEN / E2E_WORKSPACE_TOKEN for local runs.
  • For alpha or prod runs, tokens can be supplied directly via environment variables:
    • AUTH_TOKEN or E2E_AUTH_TOKEN
    • WORKSPACE_TOKEN or E2E_WORKSPACE_TOKEN
    • WORKSPACE_ID or E2E_WORKSPACE_ID
    • USER_ID or E2E_USER_ID
  • The HeadshotMarketing backend service must be running and registered with the gateway for the GraphQL operations to succeed.

Target environment​

The suite defaults to the production workspace public gateway.

VariableDefaultDescription
HEADSHOTMARKETING_TARGETprodSelects the canonical endpoint: local, alpha, or prod
HEADSHOTMARKETING_ENDPOINT—Direct GraphQL endpoint override (highest priority)
E2E_WSPACE_PUBLIC_GATEWAY—Direct gateway override (second priority)
CF_ACCESS_CLIENT_ID—Cloudflare Access service-token ID for alpha
CF_ACCESS_CLIENT_SECRET—Cloudflare Access service-token secret for alpha

Canonical endpoint mapping:

TargetEndpoint
localhttp://localhost:4003/workspaces/graphql
alphahttps://alphagraphqlworkspaces.burdenoff.com/workspaces/graphql
prodhttps://graphqlworkspaces.burdenoff.com/workspaces/graphql

Running tests​

Local​

source /home/ubuntu/products/workspaces/workspaces-doctor/core/env/e2e-env.sh
make test

Alpha (Cloudflare Access)​

export HEADSHOTMARKETING_TARGET=alpha
export AUTH_TOKEN="..."
export WORKSPACE_TOKEN="..."
export WORKSPACE_ID="..."
export CF_ACCESS_CLIENT_ID="..."
export CF_ACCESS_CLIENT_SECRET="..."
make test-all

Production​

export HEADSHOTMARKETING_TARGET=prod
export AUTH_TOKEN="..."
export WORKSPACE_TOKEN="..."
export WORKSPACE_ID="..."
make test-all

Specific suites​

make test-campaign
make test-contact
make test-audience
make test-pipeline
make test-deal
make test-lead
make test-socialaccount
make test-story
make test-paid-ad-story

Notes​

  • This repo is intentionally backend-only. It does not start services; it expects the gateway and service to be reachable.
  • It sources /home/ubuntu/products/workspaces/workspaces-doctor/core/env/e2e-env.sh at runtime for local token refresh, but all values can be overridden from the environment for alpha/prod runs.
  • When CF_ACCESS_CLIENT_ID and CF_ACCESS_CLIENT_SECRET are set, they are injected on every GraphQL request. Provide them for alpha runs; prod and local runs do not require them.