StatEngine / stat-engine

A Real-Time Open Source Data Analytics and Visualization Platform for Public Safety
https://statengine.io
GNU General Public License v3.0
8 stars 5 forks source link

Revamped server test foundation. #510

Closed larskendall closed 1 month ago

larskendall commented 3 years ago

Overview

Added support for functional testing against a live database, cleaned up existing tests, and added some additional user controller tests to serve as examples for testing the API.

I decided not to make any differentiation in file names for unit tests and integration/functional tests, since I don't think there's any particular use for us to break them up (we'll always want to run them all together as far as I can tell). We can always break them up later if we decide we'd like to run them separately.

This iteration of the server tests requires PostgreSQL to be running. In the future I think we'll also want to test against a live instance of Elasticsearch, but I put it off for now until we start diving into writing more comprehensive API tests. It should be pretty easy though to create a test index and use that for functional tests.

Note: I temporarily disabled client tests in the gulp 'test' task, so that npm test will work properly. I was getting a missing package error when trying to run gulp test:client, so it seems like it will require some extra effort to get client tests working.

GitHub Issues

Changes

Steps to Test