-
Notifications
You must be signed in to change notification settings - Fork 53
Running tests
This page guides you through running the various tests locally.
Run frontend unit tests:
yarn test:frontend
Run backend unit tests:
yarn test:backend
In the backend
directory, tests can be run with ./gradlew test
. Make sure you do not have SPRING_PROFILES_ACTIVE
set in your shell environment.
Running a single test with a full stacktrace can be accomplished by supping the path to ./gradlew test
with the --tests
flag. Example
./gradlew test --tests gov.cdc.usds.simplereport.api.graphql.QueueManagementTest.updateItemInQueue --stacktrace
To learn how to run E2E tests locally, see this wiki page: E2E tests.
SimpleReport leverages axe + cypress in e2e tests to test locally, see this wiki page: Accessibility Auditing
SimpleReport leverages Locust to run its load tests. Locust starts as part of the local development build and spawns three separate worker containers for inundating the system.
To compose Locust with the rest of the development stack, run yarn locust
instead of yarn start
. (NOTE: All other prerequisites listed in Running outside of Docker or Docker and docker compose development are still required for tests to function.) (EDITOR'S NOTE: check which one should be the prereq)
To access the Locust user interface, navigate to http://localhost:8089/
. Load tests will not kick off automatically; they must be manually invoked.
Tests can be configured by modifying backend/locust/locustfile.py
.
You can conduct manual tests in a deployed lower environment. Please look at Cloud Environments for more information on deploying to our lower environments. To set up your Okta permissions for testing, please look at Setting-up-okta.
- Getting Started
- [Setup] Docker and docker compose development
- [Setup] IntelliJ run configurations
- [Setup] Running DB outside of Docker (optional)
- [Setup] Running nginx locally (optional)
- [Setup] Running outside of docker
- Accessing and testing weird parts of the app on local dev
- Accessing patient experience in local dev
- API Testing with Insomnia
- Cypress
- How to run e2e locally for development
- E2E tests
- Database maintenance
- MailHog
- Running tests
- SendGrid
- Setting up okta
- Sonar
- Storybook and Chromatic
- Twilio
- User roles
- Wiremock
- CSV Uploader
- Log local DB queries
- Code review and PR conventions
- SimpleReport Style Guide
- How to Review and Test Pull Requests for Dependabot
- How to Review and Test Pull Requests with Terraform Changes
- SimpleReport Deployment Process
- Adding a Developer
- Removing a developer
- Non-deterministic test tracker
- Alert Response - When You Know What is Wrong
- What to Do When You Have No Idea What is Wrong
- Main Branch Status
- Maintenance Mode
- Swapping Slots
- Monitoring
- Container Debugging
- Debugging the ReportStream Uploader
- Renew Azure Service Principal Credentials
- Releasing Changelog Locks
- Muting Alerts
- Architectural Decision Records
- Backend Stack Overview
- Frontend Overview
- Cloud Architecture
- Cloud Environments
- Database ERD
- External IDs
- GraphQL Flow
- Hibernate Lazy fetching and nested models
- Identity Verification (Experian)
- Spring Profile Management
- SR Result bulk uploader device validation logic
- Test Metadata and how we store it
- TestOrder vs TestEvent
- ReportStream Integration
- Feature Flag Setup
- FHIR Resources
- FHIR Conversions
- Okta E2E Integration
- Deploy Application Action
- Slack notifications for support escalations
- Creating a New Environment Within a Resource Group
- How to Add and Use Environment Variables in Azure
- Web Application Firewall (WAF) Troubleshooting and Maintenance
- How to Review and Test Pull Requests with Terraform Changes