Skip to content

Commit

Permalink
Revert "Task/fix stats (#2401)"
Browse files Browse the repository at this point in the history
This reverts commit 59edacb.
  • Loading branch information
jzbahrai authored Jan 2, 2025
1 parent 59edacb commit 424c192
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
4 changes: 2 additions & 2 deletions app/service/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -649,13 +649,13 @@ def get_monthly_notification_stats(service_id):
data = statistics.create_empty_monthly_notification_status_stats_dict(year)

stats = fetch_notification_status_for_service_by_month(start_date, end_date, service_id)
# statistics.add_monthly_notification_status_stats(data, stats)
statistics.add_monthly_notification_status_stats(data, stats)

now = datetime.utcnow()
# TODO FF_ANNUAL_LIMIT removal
if not current_app.config["FF_ANNUAL_LIMIT"] and end_date > now:
todays_deltas = fetch_notification_status_for_service_for_day(convert_utc_to_local_timezone(now), service_id=service_id)
# statistics.add_monthly_notification_status_stats(data, todays_deltas)
statistics.add_monthly_notification_status_stats(data, todays_deltas)

return jsonify(data=data)

Expand Down
8 changes: 0 additions & 8 deletions tests/app/service/test_statistics_rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ def test_get_service_notification_statistics_with_unknown_service(admin_request)
}


@pytest.mark.skip(reason="This test is failing due to an incident fix.")
@pytest.mark.parametrize(
"kwargs, expected_json",
[
Expand All @@ -147,7 +146,6 @@ def test_get_monthly_notification_stats_returns_errors(admin_request, sample_ser
assert response == expected_json


@pytest.mark.skip(reason="This test is failing due to an incident fix.")
def test_get_monthly_notification_stats_returns_404_if_no_service(admin_request):
response = admin_request.get(
"service.get_monthly_notification_stats",
Expand All @@ -157,7 +155,6 @@ def test_get_monthly_notification_stats_returns_404_if_no_service(admin_request)
assert response == {"message": "No result found", "result": "error"}


@pytest.mark.skip(reason="This test is failing due to an incident fix.")
def test_get_monthly_notification_stats_returns_empty_stats_with_correct_dates(admin_request, sample_service):
response = admin_request.get(
"service.get_monthly_notification_stats",
Expand Down Expand Up @@ -185,7 +182,6 @@ def test_get_monthly_notification_stats_returns_empty_stats_with_correct_dates(a
assert val == {"sms": {}, "email": {}, "letter": {}}


@pytest.mark.skip(reason="This test is failing due to an incident fix.")
def test_get_monthly_notification_stats_returns_stats(admin_request, sample_service):
sms_t1 = create_template(sample_service)
sms_t2 = create_template(sample_service)
Expand Down Expand Up @@ -225,7 +221,6 @@ def test_get_monthly_notification_stats_returns_stats(admin_request, sample_serv
}


@pytest.mark.skip(reason="This test is failing due to an incident fix.")
@freeze_time("2016-06-05 00:00:00")
# This test assumes the local timezone is EST
def test_get_monthly_notification_stats_combines_todays_data_and_historic_stats(admin_request, notify_api, sample_template):
Expand Down Expand Up @@ -267,7 +262,6 @@ def test_get_monthly_notification_stats_combines_todays_data_and_historic_stats(


# This test assumes the local timezone is EST
@pytest.mark.skip(reason="This test is failing due to an incident fix.")
def test_get_monthly_notification_stats_ignores_test_keys(admin_request, sample_service):
create_ft_notification_status(datetime(2016, 6, 1), service=sample_service, key_type=KEY_TYPE_NORMAL, count=1)
create_ft_notification_status(datetime(2016, 6, 1), service=sample_service, key_type=KEY_TYPE_TEAM, count=2)
Expand All @@ -283,7 +277,6 @@ def test_get_monthly_notification_stats_ignores_test_keys(admin_request, sample_


# This test assumes the local timezone is EST
@pytest.mark.skip(reason="This test is failing due to an incident fix.")
def test_get_monthly_notification_stats_checks_dates(admin_request, sample_service):
t = create_template(sample_service)
create_ft_notification_status(datetime(2016, 3, 31), template=t, notification_status="created")
Expand All @@ -303,7 +296,6 @@ def test_get_monthly_notification_stats_checks_dates(admin_request, sample_servi
assert response["data"]["2017-03"]["sms"] == {"delivered": 1}


@pytest.mark.skip(reason="This test is failing due to an incident fix.")
def test_get_monthly_notification_stats_only_gets_for_one_service(admin_request, notify_api, notify_db_session):
services = [create_service(), create_service(service_name="2")]

Expand Down

0 comments on commit 424c192

Please sign in to comment.