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
| Suite | Location | Focus |
|---|---|---|
| Entity CRUDL | wspace/modules/headshotmarketing/scripts/test-headshotmarketing.sh | campaign, contact, audience, pipeline (+stage), deal, lead, socialaccount |
| Paid-ad story | wspace/modules/headshotmarketing/scripts/test-headshotmarketing-paid-ad-story.sh | campaign → 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:
This provides
source /home/ubuntu/products/workspaces/workspaces-doctor/core/env/e2e-env.shAUTH_TOKEN/E2E_AUTH_TOKEN,WORKSPACE_ID/E2E_WORKSPACE_ID, andWORKSPACE_TOKEN/E2E_WORKSPACE_TOKENfor local runs. - For alpha or prod runs, tokens can be supplied directly via environment variables:
AUTH_TOKENorE2E_AUTH_TOKENWORKSPACE_TOKENorE2E_WORKSPACE_TOKENWORKSPACE_IDorE2E_WORKSPACE_IDUSER_IDorE2E_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.
| Variable | Default | Description |
|---|---|---|
HEADSHOTMARKETING_TARGET | prod | Selects 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:
| Target | Endpoint |
|---|---|
local | http://localhost:4003/workspaces/graphql |
alpha | https://alphagraphqlworkspaces.burdenoff.com/workspaces/graphql |
prod | https://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.shat runtime for local token refresh, but all values can be overridden from the environment for alpha/prod runs. - When
CF_ACCESS_CLIENT_IDandCF_ACCESS_CLIENT_SECRETare set, they are injected on every GraphQL request. Provide them for alpha runs; prod and local runs do not require them.