The cluster-tests validate integration and end-to-end functionality of the Helium Edu APIs and UI.
- Python (>= 3.12)
Cluster tests are developed using Python and Tavern and Selenium.
The following environment variables must be set for the tests to run:
ENVIRONMENT(optional; if notprod, same as allowed in platform)AWS_REGION(optional; if notprod, set to AWS S3 region)PROJECT_APP_HOST(optional; if notprod, same as chosen in platform for afrontendenvironment)PROJECT_API_HOST(optional; if notprod, same as chosen in platform for aplatformAPI environment)PLATFORM_TWILIO_ACCOUNT_SID(same as used in platform worker to send texts)PLATFORM_TWILIO_AUTH_TOKEN(same as used in platform worker to send texts)CI_TWILIO_RECIPIENT_PHONE_NUMBER(a Twilio phone number to which test texts will be sent)CI_AWS_S3_ACCESS_KEY_ID(credentials with access to the inbound email S3 bucket)CI_AWS_S3_SECRET_ACCESS_KEY(credentials with access to the inbound email S3 bucket)
These cluster tests require AWS SES inbound ruleset for heliumedu-cluster@heliumedu.dev to be provisioned
to store inbound emails in an S3 bucket, as documented here.
The Terraform for prod can be
applied to configure this (or dev-local to run fully contained within Docker, as described below).
Once prod is provisioned, all cluster test suites can be run with:
make testThe cluster tests are broken in to two suites: make test-smoke and make test-selenium. The smoke tests are
written using Tavern and intended to quickly provide a high-level assurance of basic end-to-end functionality,
primarily around the APIs and responses (as well as external dependencies)—these should catch significant regressions
in the cluster. The selenium suite is intended to be more thorough, with a particular focus on validating
interactions between the UI and the backend.
These cluster tests can be run locally against Docker to make development easier. The easiest way to achieve this is
to use the deploy project to setup the
entire Helium stack locally. An Internet connection is still necessary to validate all end-to-end functionality
(emails use AWS SES, text messages use Twilio). The minimal Terraform for dev-local
can be applied to configure these services automatically.
Once the above is done, the cluster tests can be run locally with:
make test-localDue to the nature of its dependencies, this project will only build an linux/amd64 image, even when Docker is running
on another architecture.
