Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: fix query measurements after 30 days test #442

Merged
merged 2 commits into from
Mar 11, 2024

Conversation

joseph-sentry
Copy link
Contributor

Purpose/Motivation

This test started failing ater 2024-03-10 because
the time at the query was not frozen to a specific date so it was using the system's actual time and
the measurements were not a part of the last 30 days.

What does this PR do?

Freezes time around monthly coverage measurements query in test

This test started failing ater 2024-03-10 because
the time at the query was not frozen to a specific
date so it was using the system's actual time and
the measurements were not a part of the last 30 days.

Signed-off-by: joseph-sentry <joseph.sawaya@sentry.io>
@codecov-staging
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

@codecov-qa
Copy link

codecov-qa bot commented Mar 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.06%. Comparing base (80d01d2) to head (2d7ed1d).

❗ Current head 2d7ed1d differs from pull request most recent head 3ec5012. Consider uploading reports for the commit 3ec5012 to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #442   +/-   ##
=======================================
  Coverage   96.06%   96.06%           
=======================================
  Files         643      643           
  Lines       17093    17093           
=======================================
  Hits        16420    16420           
  Misses        673      673           
Flag Coverage Δ
unit 96.06% <ø> (ø)
unit-latest-uploader 96.06% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

codecov-public-qa bot commented Mar 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (80d01d2) 96.06% compared to head (3ec5012) 96.06%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #442   +/-   ##
=======================================
  Coverage   96.06%   96.06%           
=======================================
  Files         643      643           
  Lines       17093    17093           
=======================================
  Hits        16420    16420           
  Misses        673      673           
Flag Coverage Δ
unit 96.06% <ø> (ø)
unit-latest-uploader 96.06% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted file tree graph

@@ -94,9 +94,12 @@ def test_query_monthly_coverage_measurements_after_30_days(self):
assert len(all_measurements) == 8

plan_service = PlanService(current_org=owner)
freezer = freeze_time("2024-03-05T00:00:00")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: could you add a comment here for what this time signifies? similar to what we have on 81 and 87

Copy link

codecov bot commented Mar 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.77%. Comparing base (80d01d2) to head (3ec5012).

Additional details and impacted files
@@          Coverage Diff          @@
##            main    #442   +/-   ##
=====================================
  Coverage   95.77   95.77           
=====================================
  Files        765     765           
  Lines      17679   17679           
=====================================
  Hits       16932   16932           
  Misses       747     747           
Flag Coverage Δ
unit ?
unit-latest-uploader ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@joseph-sentry joseph-sentry merged commit 99afe14 into main Mar 11, 2024
20 checks passed
@joseph-sentry joseph-sentry deleted the joseph/fix-failing-test branch March 11, 2024 16:09
RulaKhaled pushed a commit that referenced this pull request Mar 13, 2024
* test: fix query measurements after 30 days test

This test started failing ater 2024-03-10 because
the time at the query was not frozen to a specific
date so it was using the system's actual time and
the measurements were not a part of the last 30 days.

* fix: add comments to clarify test fix

Signed-off-by: joseph-sentry <joseph.sawaya@sentry.io>
RulaKhaled added a commit that referenced this pull request Mar 13, 2024
* Test with states

* second round

* Okta stuff

* quick fix for test

* fixing tests

* more tests

* test: fix query measurements after 30 days test (#442)

* test: fix query measurements after 30 days test

This test started failing ater 2024-03-10 because
the time at the query was not frozen to a specific
date so it was using the system's actual time and
the measurements were not a part of the last 30 days.

* fix: add comments to clarify test fix

Signed-off-by: joseph-sentry <joseph.sawaya@sentry.io>

* [admin] allow trial extension for orgs currently on trial (#438)

Currently the admin app can extend a org trial, but only after they have expired and turned back to basic plan.
This change allows the orgs' trials to be extended while they're still trialing.

* Bundle Analysis: delete old code (#444)

These fields are being deprecated by bundleData and bundleChange. The app is no longer calling these fields anymore, it is safe to remove now.

* fix: use get_or_create in CommitSerializer.create (#437)

* fix: use get_or_create in CommitSerializer.create

there is a possibility of creating commits concurrently
if that happens there is a possibility of getting an
IntegrityError when trying to create the Commit object

this commit solves this problem by using get_or_create to
create the Commit object in the serializer

* test: add test to make sure CommitSerializer create only creates one object in the db

---------

Signed-off-by: joseph-sentry <joseph.sawaya@sentry.io>

* Revert "Bundle Analysis: delete old code (#444)" (#445)

This reverts commit 7932e93.

* Remove state after login

---------

Signed-off-by: joseph-sentry <joseph.sawaya@sentry.io>
Co-authored-by: joseph-sentry <136376984+joseph-sentry@users.noreply.github.com>
Co-authored-by: JerrySentry <142266253+JerrySentry@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants