testing.md
June 20, 2023 ยท View on GitHub
Testing
The application currently uses one framework for frontend testing: Jest. There are plans to implement back-end tests in the future.
Jest Testing
Frontend tests leverage the Jest framework.
To run the Jest test suite, execute the command docker exec -it webpack_watcher npm test.
To update snapshots, execute docker exec -it webpack_watcher npm run-script update-snapshot.
Data Validation Testing
Data validation scripts are in scripts/data_validation folder.
To run the data validation scripts, follow the steps below:
-
Copy
env_validation.hjsonfile fromenv_sample.hjsonfilecp scripts/data_validation/env_sample.hjson scripts/data_validation/env_validation.hjson -
Update the configuration values. Note the hard-coded Michigan specific filters in various query strings. Please adjust those values based on your institution's needs.
-
Run the data validation script within the Docker container:
- Validate queries using UDP BigQuery Expanded Table:
This script will validate queries against the UDP BigQuery
expandedtable, and compare whether the data results are identical with those returned from theeventstable queries.docker exec -it student_dashboard /bin/bash -c \ "python scripts/data_validation/validate_udp_events_vs_expanded.py"
- Validate queries using UDP BigQuery Expanded Table:
This script will validate queries against the UDP BigQuery