ministryofjustice / operations-engineering

This repository is home to the Operations Engineering's tools and utilities for managing, monitoring, and optimising software development processes at the Ministry of Justice. • This repository is defined and managed in Terraform
https://user-guide.operations-engineering.service.justice.gov.uk/
MIT License
12 stars 5 forks source link

Support stats script - Unit Tests #4486

Open andyrogers1973 opened 3 months ago

andyrogers1973 commented 3 months ago

Currently the support stats script is not being unit tested. This means it's not conforming to coding standards and could be introducing bugs/issues.

This ticket is to create the necessary tests in the operations engineering repo:

Considered done when:

andyrogers1973 commented 1 month ago

4628

andyrogers1973 commented 1 month ago

Added test_data.csv - a small csv file of test data to be used for testing.

Updated the support_stats_reporting.py script to use defaults for date/filepath in production

andyrogers1973 commented 1 month ago

Fixed test file path being overridden (removed unnecessary variable from 'main') Updated 'expected message' and now works correctly Tidied up formatting and removed comments/commented out code

andyrogers1973 commented 1 month ago

Removed unnecessary import and fixed pipfile.lock being out of synch, ready for review.

andyrogers1973 commented 1 month ago

From PR review I have removed tests that were not needed or duplicating others. Also added tests for hash, create_dataframe_from_csv and get_previous_days_requests Removed an unneeded import (SlackService) and removed pytest + freezegun from Pipfile(hangover from testing, not being used now), re-ran pipenv lock to resync Pipfile.lock

andyrogers1973 commented 1 month ago

Comments from Tamsin - made the following changes: