This repository has been archived by the owner on Jul 25, 2024. It is now read-only.
Design: figure out nightly testing plans #536
Labels
component: delivery
Related to automation, testing, deployment of the application.
ignore-for-release
priority: p2
Moderately-important priority. Fix may not be included in next release.
type: feature request
‘Nice-to-have’ improvement, new feature or different behavior or design.
Problem Statement
To execute on Emblem's testing plans, we will need to create nightly tests of some kind. There are two key questions we need to answer:
Proposal: Design
What to test
We will need to figure out how to test the Website, Content API, and Delivery components.
How to test
We propose a three-step process for our nightly testing:
website
andcontent API
components) as aDelivery
test.website
's "end-to-end" (E2E) tests against the deployed applicationProposal: Implementation
We should implement this using three scheduled builds on three (separate) Cloud Pub/Sub topics:
nightly-builds
will trigger container builds + pushesnightly-deploys
will trigger deployments to Cloud Runnightly-tests
will trigger end-to-end tests of the deployed Emblem applicationAvoiding race conditions
To avoid race conditions (and ensure we always test the latest working version of Emblem), we should create a 1-hour delay between the topics being triggered:
Deployments as tests
We plan to use the
website/content API
's deployment process as a (smoke) test of ourdelivery
component.✅ We'll run our deployment 'tests' automatically
✅ Testing our 'actual' deployment workflow (as opposed to one with mocked dependencies) gives us high-fidelity deployment tests
❌ Can be slow to return results
❌ May not always test the latest versions of dependencies. (For example, failures in
docker push
may result in the Website or Content API tests using an old container version.)Other options
Testing components in isolation
One alternative would be to test each component in question (
website
,content API
, anddelivery
) independently from each other.Tradeoffs relative to our proposal:
✅ Reduces test flakiness
✅ Potentially faster test runs
❌ Doesn't test cross-component integration
Sequential testing ("one big test")
Another alternative would be to test each component sequentially (for example, as part of a single Cloud Build process).
Tradeoffs relative to our proposal:
✅ Faster overall build times
❌ Upstream failures would prevent us from testing downstream dependencies
Use unit tests only
Our existing unit tests currently run on a presubmit basis. Theoretically, we could run them on a nightly basis too.
Tradeoffs relative to our proposal:
✅ Faster test runs
✅ Reduces test flakiness
❌ Not very informative (vs. presubmit unit tests)
❌ Doesn't test cross-component integration
Next steps
The text was updated successfully, but these errors were encountered: