These tests run automatically once you have set up a working instance of Emblem.
Content API unit tests run automatically on pull requests to main
.
The website component is covered by automatic end-to-end (E2E) Tests.
These tests run the website using Playwright in a Docker container, and check that the website's routes load without any errors.
Note: this Docker container is rebuilt nightly.
We keep nightly container builds and test runs separate so that E2E tests run even if the container build fails.
These tests run automatically on pull requests to main
.
This guide assumes you have a working instance of Emblem.
See Content API: Running Local Tests.
To run the tests remotely via the Cloud Build configuration:
# Navigate to the repository root.
# Create a service account. This operates as a mock API user.
test_service_account="test-identity@$GOOGLE_CLOUD_PROJECT.iam.gserviceaccount.com"
gcloud builds submit \
--config ops/unit-tests.cloudbuild.yaml \
--substitutions "_DIR=content-api,_SERVICE_ACCOUNT=$test_service_account"
To run the tests remotely via the Cloud Build configuration:
# Navigate to the repository root.
# Create a service account. This operates as a mock site user.
test_service_account="test-identity@$GOOGLE_CLOUD_PROJECT.iam.gserviceaccount.com"
gcloud builds submit \
--config ops/unit-tests.cloudbuild.yaml \
--substitutions "_DIR=website,_SERVICE_ACCOUNT=$test_service_account"
If you have a running instance of Emblem, you can trigger deployment by building a container image and pushing to the Artifact Registry instance for the service.
When Artifact Registry receives the container image, it will publish a Pub/Sub message that will start a series of Cloud Build operations that will deploy the container via a canary rollout process.
Triggering a Content API deployment:
cd content-api
REGION=us-central1
PROJECT_ID=example-emblem-ops
gcloud builds submit --tag \
${_REGION}-docker.pkg.dev/${PROJECT_ID}/content-api/content-api:manual
Triggering a Web deployment:
cd website
REGION=us-central1
PROJECT_ID=example-emblem-ops
cp -R client-libs client-libs
gcloud builds submit --tag \
${_REGION}-docker.pkg.dev/${PROJECT_ID}/website/website:manual