CGUC / skybunk-server

The back-end application for Conrad Grebel University College students to stay connected
3 stars 9 forks source link

Add an analytics endpoint to the server #106

Closed ahiijny closed 4 years ago

ahiijny commented 5 years ago

Basically just adds a bunch of queries to the database for various metrics that the server can then return in JSON format. The new route is specified in controllers/analyticsController.js, and is restricted to admins. This endpoint is intended to be used by the admin-tools front-end.

ahiijny commented 5 years ago

I feel like the aspects of my additions that are most finicky / likely to break in the future are the complicated aggregation database queries. What would normally be best practice about testing those, I wonder?

scholvat commented 5 years ago

Idk, this is kind of hard to unit test since it interacts so much with the DB, so it would probably have to be integration tested, which we don't have setup. I'm not too knowledgeable on testing though, hence my snarky comment about me never writing tests.