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

Improve aggregate test results function #813

Merged
merged 3 commits into from
Oct 2, 2024

Conversation

joseph-sentry
Copy link
Contributor

@joseph-sentry joseph-sentry commented Sep 10, 2024

This PR does 2 things:

  • add the lastDuration field to the TestResult GQL model
  • use the DailyTestRollup object to query for aggregates, this is being done for perf reasons

depends on: codecov/worker#699

Copy link
Contributor

This PR includes changes to shared. Please review them here: codecov/shared@d4ceb0e...5cc5f48

@codecov-notifications
Copy link

codecov-notifications bot commented Sep 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

Copy link

codecov bot commented Sep 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.26%. Comparing base (a4d04bc) to head (953dc14).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #813   +/-   ##
=======================================
  Coverage   96.25%   96.26%           
=======================================
  Files         814      814           
  Lines       18659    18689   +30     
=======================================
+ Hits        17961    17991   +30     
  Misses        698      698           
Flag Coverage Δ
unit 92.52% <100.00%> (+0.01%) ⬆️
unit-latest-uploader 92.52% <100.00%> (+0.01%) ⬆️

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.

@@ -893,14 +892,15 @@ def test_test_results_no_tests(self) -> None:
def test_branch_filter_on_test_results(self) -> None:
Copy link
Contributor

Choose a reason for hiding this comment

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

am I missing something or are there no assertions on this test and the next two?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i think the github file viewer is just not showing them, they are there

Copy link
Contributor

Choose a reason for hiding this comment

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

oh weird, yeah I see them now

requirements.in Outdated
@@ -45,7 +45,7 @@ pytz
redis
regex
requests
sentry-sdk>=2.13.0
sentry-sdk>=1.40.0
Copy link
Contributor

Choose a reason for hiding this comment

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

is this intended? :O

class Array(Aggregate):
function = "array"


def aggregate_test_results(
Copy link
Contributor

Choose a reason for hiding this comment

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

Reminder to update the doc for this fn

When(outcome__in=["failure", "error"], then=Value(1.0)),
totals = DailyTestRollup.objects.filter(repoid=repoid, date__gt=time_ago)

print([(t.pass_count, t.fail_count) for t in totals], branch)
Copy link
Contributor

Choose a reason for hiding this comment

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

still want this? :P

)

return failure_rates_queryset
print(aggregation_of_test_results.query)
Copy link
Contributor

Choose a reason for hiding this comment

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

still need this? :P


aggregation_of_test_results = totals.values("test").annotate(
failure_rate=(
Cast(Sum(F("fail_count")), output_field=FloatField())
Copy link
Contributor

Choose a reason for hiding this comment

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

Does the Cast(Sum(F("fail_count"))) get cached when we do this calc twice? I don't have an idea of how we'd simplify, mostly curious if you knew

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i would expect postgres to take care of this in a performant way

Copy link
Contributor

Choose a reason for hiding this comment

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

Fair enough

Copy link
Contributor

@ajay-sentry ajay-sentry left a comment

Choose a reason for hiding this comment

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

lgtm

@joseph-sentry joseph-sentry added this pull request to the merge queue Oct 2, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 2, 2024
this commit also adds the LastDuration field to the TestResult
GQL model. The reason we're using latest_run and not the updated_at
field of the object is because in the future we want to parse the
timestamp from the JUnit XML file so latest_run will be tied to that
and not the time at which we process the test results.
@codecov-qa
Copy link

codecov-qa bot commented Oct 2, 2024

❌ 16 Tests Failed:

Tests completed Failed Passed Skipped
2323 16 2307 6
View the top 3 failed tests by shortest run time
graphql_api.tests.test_repository.TestFetchRepository test_desc_failure_rate_ordering_on_test_results
Stack Traces | 0.327s run time
self = &lt;django.db.backends.utils.CursorWrapper object at 0x7f7c9ad140b0&gt;
sql = 'INSERT INTO "reports_dailytestrollups" ("created_at", "updated_at", "test_id", "date", "repoid", "branch", "fail_coun...il") VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s::text[]) RETURNING "reports_dailytestrollups"."id"'
params = (datetime.datetime(2024, 10, 2, 19, 28, 13, 436082, tzinfo=datetime.timezone.utc), datetime.datetime(2024, 10, 2, 19, 28, 13, 436093, tzinfo=datetime.timezone.utc), '21', datetime.date(2024, 10, 1), 1861, 'main', ...)
ignored_wrapper_args = (False, {'connection': &lt;DatabaseWrapper vendor='postgresql' alias='default'&gt;, 'cursor': &lt;django.db.backends.utils.CursorWrapper object at 0x7f7c9ad140b0&gt;})

    def _execute(self, sql, params, *ignored_wrapper_args):
        self.db.validate_no_broken_transaction()
        with self.db.wrap_database_errors:
            if params is None:
                # params default might be backend specific.
                return self.cursor.execute(sql)
            else:
&gt;               return self.cursor.execute(sql, params)
E               psycopg2.errors.NotNullViolation: null value in column "flaky_fail_count" of relation "reports_dailytestrollups_default" violates not-null constraint
E               DETAIL:  Failing row contains (6, 2024-10-02 19:28:13.436082+00, 2024-10-02 19:28:13.436093+00, 2024-10-01, 1861, main, 1, 2, 1, 1, 0.5, 2024-10-02 19:21:57.732232+00, {123,456,789}, 21, null).

.../local/lib/python3.12.../db/backends/utils.py:89: NotNullViolation

The above exception was the direct cause of the following exception:

self = &lt;graphql_api.tests.test_repository.TestFetchRepository testMethod=test_desc_failure_rate_ordering_on_test_results&gt;

    def test_desc_failure_rate_ordering_on_test_results(self) -&gt; None:
        repo = RepositoryFactory(author=self.owner, active=True, private=True)
        test = TestFactory(repository=repo)
&gt;       _ = DailyTestRollupFactory(
            test=test,
            date=datetime.date.today() - datetime.timedelta(days=1),
            repoid=repo.repoid,
            pass_count=1,
            fail_count=1,
        )

graphql_api/tests/test_repository.py:1164: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
.../local/lib/python3.12............/site-packages/factory/base.py:40: in __call__
    return cls.create(**kwargs)
.../local/lib/python3.12............/site-packages/factory/base.py:528: in create
    return cls._generate(enums.CREATE_STRATEGY, kwargs)
.../local/lib/python3.12....../site-packages/factory/django.py:117: in _generate
    return super()._generate(strategy, params)
.../local/lib/python3.12............/site-packages/factory/base.py:465: in _generate
    return step.build()
.../local/lib/python3.12.../site-packages/factory/builder.py:262: in build
    instance = self.factory_meta.instantiate(
.../local/lib/python3.12............/site-packages/factory/base.py:317: in instantiate
    return self.factory._create(model, *args, **kwargs)
.../local/lib/python3.12....../site-packages/factory/django.py:166: in _create
    return manager.create(*args, **kwargs)
.../local/lib/python3.12.../db/models/manager.py:87: in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
.../local/lib/python3.12.../db/models/query.py:658: in create
    obj.save(force_insert=True, using=self.db)
.../local/lib/python3.12.../db/models/base.py:814: in save
    self.save_base(
.../local/lib/python3.12.../db/models/base.py:877: in save_base
    updated = self._save_table(
.../local/lib/python3.12.../db/models/base.py:1020: in _save_table
    results = self._do_insert(
.../local/lib/python3.12.../db/models/base.py:1061: in _do_insert
    return manager._insert(
.../local/lib/python3.12.../db/models/manager.py:87: in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
.../local/lib/python3.12.../db/models/query.py:1805: in _insert
    return query.get_compiler(using=using).execute_sql(returning_fields)
.../local/lib/python3.12.../models/sql/compiler.py:1822: in execute_sql
    cursor.execute(sql, params)
.../local/lib/python3.12.../site-packages/sentry_sdk/utils.py:1730: in runner
    return sentry_patched_function(*args, **kwargs)
.../local/lib/python3.12.../integrations/django/__init__.py:651: in execute
    result = real_execute(self, sql, params)
.../local/lib/python3.12.../db/backends/utils.py:67: in execute
    return self._execute_with_wrappers(
.../local/lib/python3.12.../db/backends/utils.py:80: in _execute_with_wrappers
    return executor(sql, params, many, context)
.../local/lib/python3.12.../db/backends/utils.py:84: in _execute
    with self.db.wrap_database_errors:
.../local/lib/python3.12.../django/db/utils.py:91: in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = &lt;django.db.backends.utils.CursorWrapper object at 0x7f7c9ad140b0&gt;
sql = 'INSERT INTO "reports_dailytestrollups" ("created_at", "updated_at", "test_id", "date", "repoid", "branch", "fail_coun...il") VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s::text[]) RETURNING "reports_dailytestrollups"."id"'
params = (datetime.datetime(2024, 10, 2, 19, 28, 13, 436082, tzinfo=datetime.timezone.utc), datetime.datetime(2024, 10, 2, 19, 28, 13, 436093, tzinfo=datetime.timezone.utc), '21', datetime.date(2024, 10, 1), 1861, 'main', ...)
ignored_wrapper_args = (False, {'connection': &lt;DatabaseWrapper vendor='postgresql' alias='default'&gt;, 'cursor': &lt;django.db.backends.utils.CursorWrapper object at 0x7f7c9ad140b0&gt;})

    def _execute(self, sql, params, *ignored_wrapper_args):
        self.db.validate_no_broken_transaction()
        with self.db.wrap_database_errors:
            if params is None:
                # params default might be backend specific.
                return self.cursor.execute(sql)
            else:
&gt;               return self.cursor.execute(sql, params)
E               django.db.utils.IntegrityError: null value in column "flaky_fail_count" of relation "reports_dailytestrollups_default" violates not-null constraint
E               DETAIL:  Failing row contains (6, 2024-10-02 19:28:13.436082+00, 2024-10-02 19:28:13.436093+00, 2024-10-01, 1861, main, 1, 2, 1, 1, 0.5, 2024-10-02 19:21:57.732232+00, {123,456,789}, 21, null).

.../local/lib/python3.12.../db/backends/utils.py:89: IntegrityError
graphql_api.tests.test_repository.TestFetchRepository test_test_results
Stack Traces | 0.329s run time
self = &lt;django.db.backends.utils.CursorWrapper object at 0x7f7c8cbd5880&gt;
sql = 'INSERT INTO "reports_dailytestrollups" ("created_at", "updated_at", "test_id", "date", "repoid", "branch", "fail_coun...il") VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s::text[]) RETURNING "reports_dailytestrollups"."id"'
params = (datetime.datetime(2024, 10, 2, 19, 28, 31, 990247, tzinfo=datetime.timezone.utc), datetime.datetime(2024, 10, 2, 19, 28, 31, 990256, tzinfo=datetime.timezone.utc), '25', datetime.date(2024, 10, 2), 1903, 'main', ...)
ignored_wrapper_args = (False, {'connection': &lt;DatabaseWrapper vendor='postgresql' alias='default'&gt;, 'cursor': &lt;django.db.backends.utils.CursorWrapper object at 0x7f7c8cbd5880&gt;})

    def _execute(self, sql, params, *ignored_wrapper_args):
        self.db.validate_no_broken_transaction()
        with self.db.wrap_database_errors:
            if params is None:
                # params default might be backend specific.
                return self.cursor.execute(sql)
            else:
&gt;               return self.cursor.execute(sql, params)
E               psycopg2.errors.NotNullViolation: null value in column "flaky_fail_count" of relation "reports_dailytestrollups_default" violates not-null constraint
E               DETAIL:  Failing row contains (10, 2024-10-02 19:28:31.990247+00, 2024-10-02 19:28:31.990256+00, 2024-10-02, 1903, main, 3, 2, 1, 1, 0.5, 2024-10-02 19:21:57.732232+00, {123,456,789}, 25, null).

.../local/lib/python3.12.../db/backends/utils.py:89: NotNullViolation

The above exception was the direct cause of the following exception:

self = &lt;graphql_api.tests.test_repository.TestFetchRepository testMethod=test_test_results&gt;

    def test_test_results(self) -&gt; None:
        repo = RepositoryFactory(author=self.owner, active=True, private=True)
        test = TestFactory(repository=repo)
    
&gt;       _ = DailyTestRollupFactory(test=test)

graphql_api/tests/test_repository.py:886: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
.../local/lib/python3.12............/site-packages/factory/base.py:40: in __call__
    return cls.create(**kwargs)
.../local/lib/python3.12............/site-packages/factory/base.py:528: in create
    return cls._generate(enums.CREATE_STRATEGY, kwargs)
.../local/lib/python3.12....../site-packages/factory/django.py:117: in _generate
    return super()._generate(strategy, params)
.../local/lib/python3.12............/site-packages/factory/base.py:465: in _generate
    return step.build()
.../local/lib/python3.12.../site-packages/factory/builder.py:262: in build
    instance = self.factory_meta.instantiate(
.../local/lib/python3.12............/site-packages/factory/base.py:317: in instantiate
    return self.factory._create(model, *args, **kwargs)
.../local/lib/python3.12....../site-packages/factory/django.py:166: in _create
    return manager.create(*args, **kwargs)
.../local/lib/python3.12.../db/models/manager.py:87: in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
.../local/lib/python3.12.../db/models/query.py:658: in create
    obj.save(force_insert=True, using=self.db)
.../local/lib/python3.12.../db/models/base.py:814: in save
    self.save_base(
.../local/lib/python3.12.../db/models/base.py:877: in save_base
    updated = self._save_table(
.../local/lib/python3.12.../db/models/base.py:1020: in _save_table
    results = self._do_insert(
.../local/lib/python3.12.../db/models/base.py:1061: in _do_insert
    return manager._insert(
.../local/lib/python3.12.../db/models/manager.py:87: in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
.../local/lib/python3.12.../db/models/query.py:1805: in _insert
    return query.get_compiler(using=using).execute_sql(returning_fields)
.../local/lib/python3.12.../models/sql/compiler.py:1822: in execute_sql
    cursor.execute(sql, params)
.../local/lib/python3.12.../site-packages/sentry_sdk/utils.py:1730: in runner
    return sentry_patched_function(*args, **kwargs)
.../local/lib/python3.12.../integrations/django/__init__.py:651: in execute
    result = real_execute(self, sql, params)
.../local/lib/python3.12.../db/backends/utils.py:67: in execute
    return self._execute_with_wrappers(
.../local/lib/python3.12.../db/backends/utils.py:80: in _execute_with_wrappers
    return executor(sql, params, many, context)
.../local/lib/python3.12.../db/backends/utils.py:84: in _execute
    with self.db.wrap_database_errors:
.../local/lib/python3.12.../django/db/utils.py:91: in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = &lt;django.db.backends.utils.CursorWrapper object at 0x7f7c8cbd5880&gt;
sql = 'INSERT INTO "reports_dailytestrollups" ("created_at", "updated_at", "test_id", "date", "repoid", "branch", "fail_coun...il") VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s::text[]) RETURNING "reports_dailytestrollups"."id"'
params = (datetime.datetime(2024, 10, 2, 19, 28, 31, 990247, tzinfo=datetime.timezone.utc), datetime.datetime(2024, 10, 2, 19, 28, 31, 990256, tzinfo=datetime.timezone.utc), '25', datetime.date(2024, 10, 2), 1903, 'main', ...)
ignored_wrapper_args = (False, {'connection': &lt;DatabaseWrapper vendor='postgresql' alias='default'&gt;, 'cursor': &lt;django.db.backends.utils.CursorWrapper object at 0x7f7c8cbd5880&gt;})

    def _execute(self, sql, params, *ignored_wrapper_args):
        self.db.validate_no_broken_transaction()
        with self.db.wrap_database_errors:
            if params is None:
                # params default might be backend specific.
                return self.cursor.execute(sql)
            else:
&gt;               return self.cursor.execute(sql, params)
E               django.db.utils.IntegrityError: null value in column "flaky_fail_count" of relation "reports_dailytestrollups_default" violates not-null constraint
E               DETAIL:  Failing row contains (10, 2024-10-02 19:28:31.990247+00, 2024-10-02 19:28:31.990256+00, 2024-10-02, 1903, main, 3, 2, 1, 1, 0.5, 2024-10-02 19:21:57.732232+00, {123,456,789}, 25, null).

.../local/lib/python3.12.../db/backends/utils.py:89: IntegrityError
graphql_api.tests.test_repository.TestFetchRepository test_desc_last_duration_ordering_on_test_results
Stack Traces | 0.33s run time
self = &lt;django.db.backends.utils.CursorWrapper object at 0x7f7cb1ca6f00&gt;
sql = 'INSERT INTO "reports_dailytestrollups" ("created_at", "updated_at", "test_id", "date", "repoid", "branch", "fail_coun...il") VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s::text[]) RETURNING "reports_dailytestrollups"."id"'
params = (datetime.datetime(2024, 10, 2, 19, 28, 13, 984949, tzinfo=datetime.timezone.utc), datetime.datetime(2024, 10, 2, 19, 28, 13, 984957, tzinfo=datetime.timezone.utc), '22', datetime.date(2024, 10, 1), 1862, 'main', ...)
ignored_wrapper_args = (False, {'connection': &lt;DatabaseWrapper vendor='postgresql' alias='default'&gt;, 'cursor': &lt;django.db.backends.utils.CursorWrapper object at 0x7f7cb1ca6f00&gt;})

    def _execute(self, sql, params, *ignored_wrapper_args):
        self.db.validate_no_broken_transaction()
        with self.db.wrap_database_errors:
            if params is None:
                # params default might be backend specific.
                return self.cursor.execute(sql)
            else:
&gt;               return self.cursor.execute(sql, params)
E               psycopg2.errors.NotNullViolation: null value in column "flaky_fail_count" of relation "reports_dailytestrollups_default" violates not-null constraint
E               DETAIL:  Failing row contains (7, 2024-10-02 19:28:13.984949+00, 2024-10-02 19:28:13.984957+00, 2024-10-01, 1862, main, 3, 2, 1, 1, 0.5, 2024-10-01 19:28:13.9847+00, {123,456,789}, 22, null).

.../local/lib/python3.12.../db/backends/utils.py:89: NotNullViolation

The above exception was the direct cause of the following exception:

self = &lt;graphql_api.tests.test_repository.TestFetchRepository testMethod=test_desc_last_duration_ordering_on_test_results&gt;

    def test_desc_last_duration_ordering_on_test_results(self) -&gt; None:
        repo = RepositoryFactory(author=self.owner, active=True, private=True)
        test = TestFactory(repository=repo)
&gt;       _ = DailyTestRollupFactory(
            test=test,
            date=datetime.date.today() - datetime.timedelta(days=1),
            repoid=repo.repoid,
            last_duration_seconds=1,
            latest_run=datetime.datetime.now() - datetime.timedelta(days=1),
        )

graphql_api/tests/test_repository.py:1025: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
.../local/lib/python3.12............/site-packages/factory/base.py:40: in __call__
    return cls.create(**kwargs)
.../local/lib/python3.12............/site-packages/factory/base.py:528: in create
    return cls._generate(enums.CREATE_STRATEGY, kwargs)
.../local/lib/python3.12....../site-packages/factory/django.py:117: in _generate
    return super()._generate(strategy, params)
.../local/lib/python3.12............/site-packages/factory/base.py:465: in _generate
    return step.build()
.../local/lib/python3.12.../site-packages/factory/builder.py:262: in build
    instance = self.factory_meta.instantiate(
.../local/lib/python3.12............/site-packages/factory/base.py:317: in instantiate
    return self.factory._create(model, *args, **kwargs)
.../local/lib/python3.12....../site-packages/factory/django.py:166: in _create
    return manager.create(*args, **kwargs)
.../local/lib/python3.12.../db/models/manager.py:87: in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
.../local/lib/python3.12.../db/models/query.py:658: in create
    obj.save(force_insert=True, using=self.db)
.../local/lib/python3.12.../db/models/base.py:814: in save
    self.save_base(
.../local/lib/python3.12.../db/models/base.py:877: in save_base
    updated = self._save_table(
.../local/lib/python3.12.../db/models/base.py:1020: in _save_table
    results = self._do_insert(
.../local/lib/python3.12.../db/models/base.py:1061: in _do_insert
    return manager._insert(
.../local/lib/python3.12.../db/models/manager.py:87: in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
.../local/lib/python3.12.../db/models/query.py:1805: in _insert
    return query.get_compiler(using=using).execute_sql(returning_fields)
.../local/lib/python3.12.../models/sql/compiler.py:1822: in execute_sql
    cursor.execute(sql, params)
.../local/lib/python3.12.../site-packages/sentry_sdk/utils.py:1730: in runner
    return sentry_patched_function(*args, **kwargs)
.../local/lib/python3.12.../integrations/django/__init__.py:651: in execute
    result = real_execute(self, sql, params)
.../local/lib/python3.12.../db/backends/utils.py:67: in execute
    return self._execute_with_wrappers(
.../local/lib/python3.12.../db/backends/utils.py:80: in _execute_with_wrappers
    return executor(sql, params, many, context)
.../local/lib/python3.12.../db/backends/utils.py:84: in _execute
    with self.db.wrap_database_errors:
.../local/lib/python3.12.../django/db/utils.py:91: in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = &lt;django.db.backends.utils.CursorWrapper object at 0x7f7cb1ca6f00&gt;
sql = 'INSERT INTO "reports_dailytestrollups" ("created_at", "updated_at", "test_id", "date", "repoid", "branch", "fail_coun...il") VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s::text[]) RETURNING "reports_dailytestrollups"."id"'
params = (datetime.datetime(2024, 10, 2, 19, 28, 13, 984949, tzinfo=datetime.timezone.utc), datetime.datetime(2024, 10, 2, 19, 28, 13, 984957, tzinfo=datetime.timezone.utc), '22', datetime.date(2024, 10, 1), 1862, 'main', ...)
ignored_wrapper_args = (False, {'connection': &lt;DatabaseWrapper vendor='postgresql' alias='default'&gt;, 'cursor': &lt;django.db.backends.utils.CursorWrapper object at 0x7f7cb1ca6f00&gt;})

    def _execute(self, sql, params, *ignored_wrapper_args):
        self.db.validate_no_broken_transaction()
        with self.db.wrap_database_errors:
            if params is None:
                # params default might be backend specific.
                return self.cursor.execute(sql)
            else:
&gt;               return self.cursor.execute(sql, params)
E               django.db.utils.IntegrityError: null value in column "flaky_fail_count" of relation "reports_dailytestrollups_default" violates not-null constraint
E               DETAIL:  Failing row contains (7, 2024-10-02 19:28:13.984949+00, 2024-10-02 19:28:13.984957+00, 2024-10-01, 1862, main, 3, 2, 1, 1, 0.5, 2024-10-01 19:28:13.9847+00, {123,456,789}, 22, null).

.../local/lib/python3.12.../db/backends/utils.py:89: IntegrityError

To view individual test run time comparison to the main branch, go to the Test Analytics Dashboard

Copy link

Test Failures Detected: Due to failing tests, we cannot provide coverage reports at this time.

❌ Failed Test Results:

Completed 2329 tests with 16 failed, 2307 passed and 6 skipped.

View the full list of failed tests

pytest

  • Class name: graphql_api.tests.test_repository.TestFetchRepository
    Test name: test_avg_duration_ordering_on_test_results

    self = <django.db.backends.utils.CursorWrapper object at 0x7f7cb14d4620>
    sql = 'INSERT INTO "reports_dailytestrollups" ("created_at", "updated_at", "test_id", "date", "repoid", "branch", "fail_coun...il") VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s::text[]) RETURNING "reports_dailytestrollups"."id"'
    params = (datetime.datetime(2024, 10, 2, 19, 28, 10, 161344, tzinfo=datetime.timezone.utc), datetime.datetime(2024, 10, 2, 19, 28, 10, 161352, tzinfo=datetime.timezone.utc), '15', datetime.date(2024, 10, 1), 1856, 'main', ...)
    ignored_wrapper_args = (False, {'connection': <DatabaseWrapper vendor='postgresql' alias='default'>, 'cursor': <django.db.backends.utils.CursorWrapper object at 0x7f7cb14d4620>})

    def _execute(self, sql, params, *ignored_wrapper_args):
    self.db.validate_no_broken_transaction()
    with self.db.wrap_database_errors:
    if params is None:
    # params default might be backend specific.
    return self.cursor.execute(sql)
    else:
    > return self.cursor.execute(sql, params)
    E psycopg2.errors.NotNullViolation: null value in column "flaky_fail_count" of relation "reports_dailytestrollups_default" violates not-null constraint
    E DETAIL: Failing row contains (1, 2024-10-02 19:28:10.161344+00, 2024-10-02 19:28:10.161352+00, 2024-10-01, 1856, main, 3, 2, 1, 1, 1, 2024-10-02 19:21:57.732232+00, {123,456,789}, 15, null).

    .../local/lib/python3.12.../db/backends/utils.py:89: NotNullViolation

    The above exception was the direct cause of the following exception:

    self = <graphql_api.tests.test_repository.TestFetchRepository testMethod=test_avg_duration_ordering_on_test_results>

    def test_avg_duration_ordering_on_test_results(self) -> None:
    repo = RepositoryFactory(author=self.owner, active=True, private=True)
    test = TestFactory(repository=repo)
    test = TestFactory(repository=repo)
    > _ = DailyTestRollupFactory(
    test=test,
    date=datetime.date.today() - datetime.timedelta(days=1),
    repoid=repo.repoid,
    avg_duration_seconds=1,
    )

    graphql_api/tests/test_repository.py:1061:
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    .../local/lib/python3.12............/site-packages/factory/base.py:40: in __call__
    return cls.create(**kwargs)
    .../local/lib/python3.12............/site-packages/factory/base.py:528: in create
    return cls._generate(enums.CREATE_STRATEGY, kwargs)
    .../local/lib/python3.12....../site-packages/factory/django.py:117: in _generate
    return super()._generate(strategy, params)
    .../local/lib/python3.12............/site-packages/factory/base.py:465: in _generate
    return step.build()
    .../local/lib/python3.12.../site-packages/factory/builder.py:262: in build
    instance = self.factory_meta.instantiate(
    .../local/lib/python3.12............/site-packages/factory/base.py:317: in instantiate
    return self.factory._create(model, *args, **kwargs)
    .../local/lib/python3.12....../site-packages/factory/django.py:166: in _create
    return manager.create(*args, **kwargs)
    .../local/lib/python3.12.../db/models/manager.py:87: in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
    .../local/lib/python3.12.../db/models/query.py:658: in create
    obj.save(force_insert=True, using=self.db)
    .../local/lib/python3.12.../db/models/base.py:814: in save
    self.save_base(
    .../local/lib/python3.12.../db/models/base.py:877: in save_base
    updated = self._save_table(
    .../local/lib/python3.12.../db/models/base.py:1020: in _save_table
    results = self._do_insert(
    .../local/lib/python3.12.../db/models/base.py:1061: in _do_insert
    return manager._insert(
    .../local/lib/python3.12.../db/models/manager.py:87: in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
    .../local/lib/python3.12.../db/models/query.py:1805: in _insert
    return query.get_compiler(using=using).execute_sql(returning_fields)
    .../local/lib/python3.12.../models/sql/compiler.py:1822: in execute_sql
    cursor.execute(sql, params)
    .../local/lib/python3.12.../site-packages/sentry_sdk/utils.py:1730: in runner
    return sentry_patched_function(*args, **kwargs)
    .../local/lib/python3.12.../integrations/django/__init__.py:651: in execute
    result = real_execute(self, sql, params)
    .../local/lib/python3.12.../db/backends/utils.py:67: in execute
    return self._execute_with_wrappers(
    .../local/lib/python3.12.../db/backends/utils.py:80: in _execute_with_wrappers
    return executor(sql, params, many, context)
    .../local/lib/python3.12.../db/backends/utils.py:84: in _execute
    with self.db.wrap_database_errors:
    .../local/lib/python3.12.../django/db/utils.py:91: in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    self = <django.db.backends.utils.CursorWrapper object at 0x7f7cb14d4620>
    sql = 'INSERT INTO "reports_dailytestrollups" ("created_at", "updated_at", "test_id", "date", "repoid", "branch", "fail_coun...il") VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s::text[]) RETURNING "reports_dailytestrollups"."id"'
    params = (datetime.datetime(2024, 10, 2, 19, 28, 10, 161344, tzinfo=datetime.timezone.utc), datetime.datetime(2024, 10, 2, 19, 28, 10, 161352, tzinfo=datetime.timezone.utc), '15', datetime.date(2024, 10, 1), 1856, 'main', ...)
    ignored_wrapper_args = (False, {'connection': <DatabaseWrapper vendor='postgresql' alias='default'>, 'cursor': <django.db.backends.utils.CursorWrapper object at 0x7f7cb14d4620>})

    def _execute(self, sql, params, *ignored_wrapper_args):
    self.db.validate_no_broken_transaction()
    with self.db.wrap_database_errors:
    if params is None:
    # params default might be backend specific.
    return self.cursor.execute(sql)
    else:
    > return self.cursor.execute(sql, params)
    E django.db.utils.IntegrityError: null value in column "flaky_fail_count" of relation "reports_dailytestrollups_default" violates not-null constraint
    E DETAIL: Failing row contains (1, 2024-10-02 19:28:10.161344+00, 2024-10-02 19:28:10.161352+00, 2024-10-01, 1856, main, 3, 2, 1, 1, 1, 2024-10-02 19:21:57.732232+00, {123,456,789}, 15, null).

    .../local/lib/python3.12.../db/backends/utils.py:89: IntegrityError
  • Class name: graphql_api.tests.test_repository.TestFetchRepository
    Test name: test_branch_filter_on_test_results

    self = <django.db.backends.utils.CursorWrapper object at 0x7f7cacc48800>
    sql = 'INSERT INTO "reports_dailytestrollups" ("created_at", "updated_at", "test_id", "date", "repoid", "branch", "fail_coun...il") VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s::text[]) RETURNING "reports_dailytestrollups"."id"'
    params = (datetime.datetime(2024, 10, 2, 19, 28, 10, 737662, tzinfo=datetime.timezone.utc), datetime.datetime(2024, 10, 2, 19, 28, 10, 737670, tzinfo=datetime.timezone.utc), '16', datetime.date(2024, 10, 2), 1857, 'main', ...)
    ignored_wrapper_args = (False, {'connection': <DatabaseWrapper vendor='postgresql' alias='default'>, 'cursor': <django.db.backends.utils.CursorWrapper object at 0x7f7cacc48800>})

    def _execute(self, sql, params, *ignored_wrapper_args):
    self.db.validate_no_broken_transaction()
    with self.db.wrap_database_errors:
    if params is None:
    # params default might be backend specific.
    return self.cursor.execute(sql)
    else:
    > return self.cursor.execute(sql, params)
    E psycopg2.errors.NotNullViolation: null value in column "flaky_fail_count" of relation "reports_dailytestrollups_default" violates not-null constraint
    E DETAIL: Failing row contains (2, 2024-10-02 19:28:10.737662+00, 2024-10-02 19:28:10.73767+00, 2024-10-02, 1857, main, 3, 2, 1, 1, 0.5, 2024-10-02 19:21:57.732232+00, {123,456,789}, 16, null).

    .../local/lib/python3.12.../db/backends/utils.py:89: NotNullViolation

    The above exception was the direct cause of the following exception:

    self = <graphql_api.tests.test_repository.TestFetchRepository testMethod=test_branch_filter_on_test_results>

    def test_branch_filter_on_test_results(self) -> None:
    repo = RepositoryFactory(author=self.owner, active=True, private=True)
    test = TestFactory(repository=repo)
    test2 = TestFactory(repository=repo)
    > _ = DailyTestRollupFactory(
    test=test,
    created_at=datetime.datetime.now(),
    repoid=repo.repoid,
    branch="main",
    )

    graphql_api/tests/test_repository.py:903:
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    .../local/lib/python3.12............/site-packages/factory/base.py:40: in __call__
    return cls.create(**kwargs)
    .../local/lib/python3.12............/site-packages/factory/base.py:528: in create
    return cls._generate(enums.CREATE_STRATEGY, kwargs)
    .../local/lib/python3.12....../site-packages/factory/django.py:117: in _generate
    return super()._generate(strategy, params)
    .../local/lib/python3.12............/site-packages/factory/base.py:465: in _generate
    return step.build()
    .../local/lib/python3.12.../site-packages/factory/builder.py:262: in build
    instance = self.factory_meta.instantiate(
    .../local/lib/python3.12............/site-packages/factory/base.py:317: in instantiate
    return self.factory._create(model, *args, **kwargs)
    .../local/lib/python3.12....../site-packages/factory/django.py:166: in _create
    return manager.create(*args, **kwargs)
    .../local/lib/python3.12.../db/models/manager.py:87: in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
    .../local/lib/python3.12.../db/models/query.py:658: in create
    obj.save(force_insert=True, using=self.db)
    .../local/lib/python3.12.../db/models/base.py:814: in save
    self.save_base(
    .../local/lib/python3.12.../db/models/base.py:877: in save_base
    updated = self._save_table(
    .../local/lib/python3.12.../db/models/base.py:1020: in _save_table
    results = self._do_insert(
    .../local/lib/python3.12.../db/models/base.py:1061: in _do_insert
    return manager._insert(
    .../local/lib/python3.12.../db/models/manager.py:87: in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
    .../local/lib/python3.12.../db/models/query.py:1805: in _insert
    return query.get_compiler(using=using).execute_sql(returning_fields)
    .../local/lib/python3.12.../models/sql/compiler.py:1822: in execute_sql
    cursor.execute(sql, params)
    .../local/lib/python3.12.../site-packages/sentry_sdk/utils.py:1730: in runner
    return sentry_patched_function(*args, **kwargs)
    .../local/lib/python3.12.../integrations/django/__init__.py:651: in execute
    result = real_execute(self, sql, params)
    .../local/lib/python3.12.../db/backends/utils.py:67: in execute
    return self._execute_with_wrappers(
    .../local/lib/python3.12.../db/backends/utils.py:80: in _execute_with_wrappers
    return executor(sql, params, many, context)
    .../local/lib/python3.12.../db/backends/utils.py:84: in _execute
    with self.db.wrap_database_errors:
    .../local/lib/python3.12.../django/db/utils.py:91: in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    self = <django.db.backends.utils.CursorWrapper object at 0x7f7cacc48800>
    sql = 'INSERT INTO "reports_dailytestrollups" ("created_at", "updated_at", "test_id", "date", "repoid", "branch", "fail_coun...il") VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s::text[]) RETURNING "reports_dailytestrollups"."id"'
    params = (datetime.datetime(2024, 10, 2, 19, 28, 10, 737662, tzinfo=datetime.timezone.utc), datetime.datetime(2024, 10, 2, 19, 28, 10, 737670, tzinfo=datetime.timezone.utc), '16', datetime.date(2024, 10, 2), 1857, 'main', ...)
    ignored_wrapper_args = (False, {'connection': <DatabaseWrapper vendor='postgresql' alias='default'>, 'cursor': <django.db.backends.utils.CursorWrapper object at 0x7f7cacc48800>})

    def _execute(self, sql, params, *ignored_wrapper_args):
    self.db.validate_no_broken_transaction()
    with self.db.wrap_database_errors:
    if params is None:
    # params default might be backend specific.
    return self.cursor.execute(sql)
    else:
    > return self.cursor.execute(sql, params)
    E django.db.utils.IntegrityError: null value in column "flaky_fail_count" of relation "reports_dailytestrollups_default" violates not-null constraint
    E DETAIL: Failing row contains (2, 2024-10-02 19:28:10.737662+00, 2024-10-02 19:28:10.73767+00, 2024-10-02, 1857, main, 3, 2, 1, 1, 0.5, 2024-10-02 19:21:57.732232+00, {123,456,789}, 16, null).

    .../local/lib/python3.12.../db/backends/utils.py:89: IntegrityError
  • Class name: graphql_api.tests.test_repository.TestFetchRepository
    Test name: test_commits_failed_ordering_on_test_results

    self = <django.db.backends.utils.CursorWrapper object at 0x7f7c8ff9efc0>
    sql = 'INSERT INTO "reports_dailytestrollups" ("created_at", "updated_at", "test_id", "date", "repoid", "branch", "fail_coun...il") VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s::text[]) RETURNING "reports_dailytestrollups"."id"'
    params = (datetime.datetime(2024, 10, 2, 19, 28, 11, 717866, tzinfo=datetime.timezone.utc), datetime.datetime(2024, 10, 2, 19, 28, 11, 717876, tzinfo=datetime.timezone.utc), '18', datetime.date(2024, 10, 1), 1858, 'main', ...)
    ignored_wrapper_args = (False, {'connection': <DatabaseWrapper vendor='postgresql' alias='default'>, 'cursor': <django.db.backends.utils.CursorWrapper object at 0x7f7c8ff9efc0>})

    def _execute(self, sql, params, *ignored_wrapper_args):
    self.db.validate_no_broken_transaction()
    with self.db.wrap_database_errors:
    if params is None:
    # params default might be backend specific.
    return self.cursor.execute(sql)
    else:
    > return self.cursor.execute(sql, params)
    E psycopg2.errors.NotNullViolation: null value in column "flaky_fail_count" of relation "reports_dailytestrollups_default" violates not-null constraint
    E DETAIL: Failing row contains (3, 2024-10-02 19:28:11.717866+00, 2024-10-02 19:28:11.717876+00, 2024-10-01, 1858, main, 3, 2, 1, 1, 0.5, 2024-10-02 19:21:57.732232+00, {1}, 18, null).

    .../local/lib/python3.12.../db/backends/utils.py:89: NotNullViolation

    The above exception was the direct cause of the following exception:

    self = <graphql_api.tests.test_repository.TestFetchRepository testMethod=test_commits_failed_ordering_on_test_results>

    def test_commits_failed_ordering_on_test_results(self) -> None:
    repo = RepositoryFactory(author=self.owner, active=True, private=True)
    test = TestFactory(repository=repo)
    > _ = DailyTestRollupFactory(
    test=test,
    date=datetime.date.today() - datetime.timedelta(days=1),
    repoid=repo.repoid,
    commits_where_fail=["1"],
    )

    graphql_api/tests/test_repository.py:924:
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    .../local/lib/python3.12............/site-packages/factory/base.py:40: in __call__
    return cls.create(**kwargs)
    .../local/lib/python3.12............/site-packages/factory/base.py:528: in create
    return cls._generate(enums.CREATE_STRATEGY, kwargs)
    .../local/lib/python3.12....../site-packages/factory/django.py:117: in _generate
    return super()._generate(strategy, params)
    .../local/lib/python3.12............/site-packages/factory/base.py:465: in _generate
    return step.build()
    .../local/lib/python3.12.../site-packages/factory/builder.py:262: in build
    instance = self.factory_meta.instantiate(
    .../local/lib/python3.12............/site-packages/factory/base.py:317: in instantiate
    return self.factory._create(model, *args, **kwargs)
    .../local/lib/python3.12....../site-packages/factory/django.py:166: in _create
    return manager.create(*args, **kwargs)
    .../local/lib/python3.12.../db/models/manager.py:87: in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
    .../local/lib/python3.12.../db/models/query.py:658: in create
    obj.save(force_insert=True, using=self.db)
    .../local/lib/python3.12.../db/models/base.py:814: in save
    self.save_base(
    .../local/lib/python3.12.../db/models/base.py:877: in save_base
    updated = self._save_table(
    .../local/lib/python3.12.../db/models/base.py:1020: in _save_table
    results = self._do_insert(
    .../local/lib/python3.12.../db/models/base.py:1061: in _do_insert
    return manager._insert(
    .../local/lib/python3.12.../db/models/manager.py:87: in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
    .../local/lib/python3.12.../db/models/query.py:1805: in _insert
    return query.get_compiler(using=using).execute_sql(returning_fields)
    .../local/lib/python3.12.../models/sql/compiler.py:1822: in execute_sql
    cursor.execute(sql, params)
    .../local/lib/python3.12.../site-packages/sentry_sdk/utils.py:1730: in runner
    return sentry_patched_function(*args, **kwargs)
    .../local/lib/python3.12.../integrations/django/__init__.py:651: in execute
    result = real_execute(self, sql, params)
    .../local/lib/python3.12.../db/backends/utils.py:67: in execute
    return self._execute_with_wrappers(
    .../local/lib/python3.12.../db/backends/utils.py:80: in _execute_with_wrappers
    return executor(sql, params, many, context)
    .../local/lib/python3.12.../db/backends/utils.py:84: in _execute
    with self.db.wrap_database_errors:
    .../local/lib/python3.12.../django/db/utils.py:91: in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    self = <django.db.backends.utils.CursorWrapper object at 0x7f7c8ff9efc0>
    sql = 'INSERT INTO "reports_dailytestrollups" ("created_at", "updated_at", "test_id", "date", "repoid", "branch", "fail_coun...il") VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s::text[]) RETURNING "reports_dailytestrollups"."id"'
    params = (datetime.datetime(2024, 10, 2, 19, 28, 11, 717866, tzinfo=datetime.timezone.utc), datetime.datetime(2024, 10, 2, 19, 28, 11, 717876, tzinfo=datetime.timezone.utc), '18', datetime.date(2024, 10, 1), 1858, 'main', ...)
    ignored_wrapper_args = (False, {'connection': <DatabaseWrapper vendor='postgresql' alias='default'>, 'cursor': <django.db.backends.utils.CursorWrapper object at 0x7f7c8ff9efc0>})

    def _execute(self, sql, params, *ignored_wrapper_args):
    self.db.validate_no_broken_transaction()
    with self.db.wrap_database_errors:
    if params is None:
    # params default might be backend specific.
    return self.cursor.execute(sql)
    else:
    > return self.cursor.execute(sql, params)
    E django.db.utils.IntegrityError: null value in column "flaky_fail_count" of relation "reports_dailytestrollups_default" violates not-null constraint
    E DETAIL: Failing row contains (3, 2024-10-02 19:28:11.717866+00, 2024-10-02 19:28:11.717876+00, 2024-10-01, 1858, main, 3, 2, 1, 1, 0.5, 2024-10-02 19:21:57.732232+00, {1}, 18, null).

    .../local/lib/python3.12.../db/backends/utils.py:89: IntegrityError
  • Class name: graphql_api.tests.test_repository.TestFetchRepository
    Test name: test_desc_avg_duration_ordering_on_test_results

    self = <django.db.backends.utils.CursorWrapper object at 0x7f7ca41ff080>
    sql = 'INSERT INTO "reports_dailytestrollups" ("created_at", "updated_at", "test_id", "date", "repoid", "branch", "fail_coun...il") VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s::text[]) RETURNING "reports_dailytestrollups"."id"'
    params = (datetime.datetime(2024, 10, 2, 19, 28, 12, 275803, tzinfo=datetime.timezone.utc), datetime.datetime(2024, 10, 2, 19, 28, 12, 275814, tzinfo=datetime.timezone.utc), '19', datetime.date(2024, 10, 1), 1859, 'main', ...)
    ignored_wrapper_args = (False, {'connection': <DatabaseWrapper vendor='postgresql' alias='default'>, 'cursor': <django.db.backends.utils.CursorWrapper object at 0x7f7ca41ff080>})

    def _execute(self, sql, params, *ignored_wrapper_args):
    self.db.validate_no_broken_transaction()
    with self.db.wrap_database_errors:
    if params is None:
    # params default might be backend specific.
    return self.cursor.execute(sql)
    else:
    > return self.cursor.execute(sql, params)
    E psycopg2.errors.NotNullViolation: null value in column "flaky_fail_count" of relation "reports_dailytestrollups_default" violates not-null constraint
    E DETAIL: Failing row contains (4, 2024-10-02 19:28:12.275803+00, 2024-10-02 19:28:12.275814+00, 2024-10-01, 1859, main, 3, 2, 1, 1, 1, 2024-10-02 19:21:57.732232+00, {123,456,789}, 19, null).

    .../local/lib/python3.12.../db/backends/utils.py:89: NotNullViolation

    The above exception was the direct cause of the following exception:

    self = <graphql_api.tests.test_repository.TestFetchRepository testMethod=test_desc_avg_duration_ordering_on_test_results>

    def test_desc_avg_duration_ordering_on_test_results(self) -> None:
    repo = RepositoryFactory(author=self.owner, active=True, private=True)
    test = TestFactory(repository=repo)
    > _ = DailyTestRollupFactory(
    test=test,
    date=datetime.date.today() - datetime.timedelta(days=1),
    repoid=repo.repoid,
    avg_duration_seconds=1,
    )

    graphql_api/tests/test_repository.py:1094:
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    .../local/lib/python3.12............/site-packages/factory/base.py:40: in __call__
    return cls.create(**kwargs)
    .../local/lib/python3.12............/site-packages/factory/base.py:528: in create
    return cls._generate(enums.CREATE_STRATEGY, kwargs)
    .../local/lib/python3.12....../site-packages/factory/django.py:117: in _generate
    return super()._generate(strategy, params)
    .../local/lib/python3.12............/site-packages/factory/base.py:465: in _generate
    return step.build()
    .../local/lib/python3.12.../site-packages/factory/builder.py:262: in build
    instance = self.factory_meta.instantiate(
    .../local/lib/python3.12............/site-packages/factory/base.py:317: in instantiate
    return self.factory._create(model, *args, **kwargs)
    .../local/lib/python3.12....../site-packages/factory/django.py:166: in _create
    return manager.create(*args, **kwargs)
    .../local/lib/python3.12.../db/models/manager.py:87: in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
    .../local/lib/python3.12.../db/models/query.py:658: in create
    obj.save(force_insert=True, using=self.db)
    .../local/lib/python3.12.../db/models/base.py:814: in save
    self.save_base(
    .../local/lib/python3.12.../db/models/base.py:877: in save_base
    updated = self._save_table(
    .../local/lib/python3.12.../db/models/base.py:1020: in _save_table
    results = self._do_insert(
    .../local/lib/python3.12.../db/models/base.py:1061: in _do_insert
    return manager._insert(
    .../local/lib/python3.12.../db/models/manager.py:87: in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
    .../local/lib/python3.12.../db/models/query.py:1805: in _insert
    return query.get_compiler(using=using).execute_sql(returning_fields)
    .../local/lib/python3.12.../models/sql/compiler.py:1822: in execute_sql
    cursor.execute(sql, params)
    .../local/lib/python3.12.../site-packages/sentry_sdk/utils.py:1730: in runner
    return sentry_patched_function(*args, **kwargs)
    .../local/lib/python3.12.../integrations/django/__init__.py:651: in execute
    result = real_execute(self, sql, params)
    .../local/lib/python3.12.../db/backends/utils.py:67: in execute
    return self._execute_with_wrappers(
    .../local/lib/python3.12.../db/backends/utils.py:80: in _execute_with_wrappers
    return executor(sql, params, many, context)
    .../local/lib/python3.12.../db/backends/utils.py:84: in _execute
    with self.db.wrap_database_errors:
    .../local/lib/python3.12.../django/db/utils.py:91: in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    self = <django.db.backends.utils.CursorWrapper object at 0x7f7ca41ff080>
    sql = 'INSERT INTO "reports_dailytestrollups" ("created_at", "updated_at", "test_id", "date", "repoid", "branch", "fail_coun...il") VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s::text[]) RETURNING "reports_dailytestrollups"."id"'
    params = (datetime.datetime(2024, 10, 2, 19, 28, 12, 275803, tzinfo=datetime.timezone.utc), datetime.datetime(2024, 10, 2, 19, 28, 12, 275814, tzinfo=datetime.timezone.utc), '19', datetime.date(2024, 10, 1), 1859, 'main', ...)
    ignored_wrapper_args = (False, {'connection': <DatabaseWrapper vendor='postgresql' alias='default'>, 'cursor': <django.db.backends.utils.CursorWrapper object at 0x7f7ca41ff080>})

    def _execute(self, sql, params, *ignored_wrapper_args):
    self.db.validate_no_broken_transaction()
    with self.db.wrap_database_errors:
    if params is None:
    # params default might be backend specific.
    return self.cursor.execute(sql)
    else:
    > return self.cursor.execute(sql, params)
    E django.db.utils.IntegrityError: null value in column "flaky_fail_count" of relation "reports_dailytestrollups_default" violates not-null constraint
    E DETAIL: Failing row contains (4, 2024-10-02 19:28:12.275803+00, 2024-10-02 19:28:12.275814+00, 2024-10-01, 1859, main, 3, 2, 1, 1, 1, 2024-10-02 19:21:57.732232+00, {123,456,789}, 19, null).

    .../local/lib/python3.12.../db/backends/utils.py:89: IntegrityError
  • Class name: graphql_api.tests.test_repository.TestFetchRepository
    Test name: test_desc_commits_failed_ordering_on_test_results

    self = <django.db.backends.utils.CursorWrapper object at 0x7f7ca41ff7d0>
    sql = 'INSERT INTO "reports_dailytestrollups" ("created_at", "updated_at", "test_id", "date", "repoid", "branch", "fail_coun...il") VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s::text[]) RETURNING "reports_dailytestrollups"."id"'
    params = (datetime.datetime(2024, 10, 2, 19, 28, 12, 846099, tzinfo=datetime.timezone.utc), datetime.datetime(2024, 10, 2, 19, 28, 12, 846109, tzinfo=datetime.timezone.utc), '20', datetime.date(2024, 10, 1), 1860, 'main', ...)
    ignored_wrapper_args = (False, {'connection': <DatabaseWrapper vendor='postgresql' alias='default'>, 'cursor': <django.db.backends.utils.CursorWrapper object at 0x7f7ca41ff7d0>})

    def _execute(self, sql, params, *ignored_wrapper_args):
    self.db.validate_no_broken_transaction()
    with self.db.wrap_database_errors:
    if params is None:
    # params default might be backend specific.
    return self.cursor.execute(sql)
    else:
    > return self.cursor.execute(sql, params)
    E psycopg2.errors.NotNullViolation: null value in column "flaky_fail_count" of relation "reports_dailytestrollups_default" violates not-null constraint
    E DETAIL: Failing row contains (5, 2024-10-02 19:28:12.846099+00, 2024-10-02 19:28:12.846109+00, 2024-10-01, 1860, main, 3, 2, 1, 1, 0.5, 2024-10-02 19:21:57.732232+00, {1}, 20, null).

    .../local/lib/python3.12.../db/backends/utils.py:89: NotNullViolation

    The above exception was the direct cause of the following exception:

    self = <graphql_api.tests.test_repository.TestFetchRepository testMethod=test_desc_commits_failed_ordering_on_test_results>

    def test_desc_commits_failed_ordering_on_test_results(self) -> None:
    repo = RepositoryFactory(author=self.owner, active=True, private=True)
    test = TestFactory(repository=repo)
    > _ = DailyTestRollupFactory(
    test=test,
    date=datetime.date.today() - datetime.timedelta(days=1),
    repoid=repo.repoid,
    commits_where_fail=["1"],
    )

    graphql_api/tests/test_repository.py:957:
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    .../local/lib/python3.12............/site-packages/factory/base.py:40: in __call__
    return cls.create(**kwargs)
    .../local/lib/python3.12............/site-packages/factory/base.py:528: in create
    return cls._generate(enums.CREATE_STRATEGY, kwargs)
    .../local/lib/python3.12....../site-packages/factory/django.py:117: in _generate
    return super()._generate(strategy, params)
    .../local/lib/python3.12............/site-packages/factory/base.py:465: in _generate
    return step.build()
    .../local/lib/python3.12.../site-packages/factory/builder.py:262: in build
    instance = self.factory_meta.instantiate(
    .../local/lib/python3.12............/site-packages/factory/base.py:317: in instantiate
    return self.factory._create(model, *args, **kwargs)
    .../local/lib/python3.12....../site-packages/factory/django.py:166: in _create
    return manager.create(*args, **kwargs)
    .../local/lib/python3.12.../db/models/manager.py:87: in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
    .../local/lib/python3.12.../db/models/query.py:658: in create
    obj.save(force_insert=True, using=self.db)
    .../local/lib/python3.12.../db/models/base.py:814: in save
    self.save_base(
    .../local/lib/python3.12.../db/models/base.py:877: in save_base
    updated = self._save_table(
    .../local/lib/python3.12.../db/models/base.py:1020: in _save_table
    results = self._do_insert(
    .../local/lib/python3.12.../db/models/base.py:1061: in _do_insert
    return manager._insert(
    .../local/lib/python3.12.../db/models/manager.py:87: in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
    .../local/lib/python3.12.../db/models/query.py:1805: in _insert
    return query.get_compiler(using=using).execute_sql(returning_fields)
    .../local/lib/python3.12.../models/sql/compiler.py:1822: in execute_sql
    cursor.execute(sql, params)
    .../local/lib/python3.12.../site-packages/sentry_sdk/utils.py:1730: in runner
    return sentry_patched_function(*args, **kwargs)
    .../local/lib/python3.12.../integrations/django/__init__.py:651: in execute
    result = real_execute(self, sql, params)
    .../local/lib/python3.12.../db/backends/utils.py:67: in execute
    return self._execute_with_wrappers(
    .../local/lib/python3.12.../db/backends/utils.py:80: in _execute_with_wrappers
    return executor(sql, params, many, context)
    .../local/lib/python3.12.../db/backends/utils.py:84: in _execute
    with self.db.wrap_database_errors:
    .../local/lib/python3.12.../django/db/utils.py:91: in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    self = <django.db.backends.utils.CursorWrapper object at 0x7f7ca41ff7d0>
    sql = 'INSERT INTO "reports_dailytestrollups" ("created_at", "updated_at", "test_id", "date", "repoid", "branch", "fail_coun...il") VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s::text[]) RETURNING "reports_dailytestrollups"."id"'
    params = (datetime.datetime(2024, 10, 2, 19, 28, 12, 846099, tzinfo=datetime.timezone.utc), datetime.datetime(2024, 10, 2, 19, 28, 12, 846109, tzinfo=datetime.timezone.utc), '20', datetime.date(2024, 10, 1), 1860, 'main', ...)
    ignored_wrapper_args = (False, {'connection': <DatabaseWrapper vendor='postgresql' alias='default'>, 'cursor': <django.db.backends.utils.CursorWrapper object at 0x7f7ca41ff7d0>})

    def _execute(self, sql, params, *ignored_wrapper_args):
    self.db.validate_no_broken_transaction()
    with self.db.wrap_database_errors:
    if params is None:
    # params default might be backend specific.
    return self.cursor.execute(sql)
    else:
    > return self.cursor.execute(sql, params)
    E django.db.utils.IntegrityError: null value in column "flaky_fail_count" of relation "reports_dailytestrollups_default" violates not-null constraint
    E DETAIL: Failing row contains (5, 2024-10-02 19:28:12.846099+00, 2024-10-02 19:28:12.846109+00, 2024-10-01, 1860, main, 3, 2, 1, 1, 0.5, 2024-10-02 19:21:57.732232+00, {1}, 20, null).

    .../local/lib/python3.12.../db/backends/utils.py:89: IntegrityError
  • Class name: graphql_api.tests.test_repository.TestFetchRepository
    Test name: test_desc_failure_rate_ordering_on_test_results

    self = <django.db.backends.utils.CursorWrapper object at 0x7f7c9ad140b0>
    sql = 'INSERT INTO "reports_dailytestrollups" ("created_at", "updated_at", "test_id", "date", "repoid", "branch", "fail_coun...il") VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s::text[]) RETURNING "reports_dailytestrollups"."id"'
    params = (datetime.datetime(2024, 10, 2, 19, 28, 13, 436082, tzinfo=datetime.timezone.utc), datetime.datetime(2024, 10, 2, 19, 28, 13, 436093, tzinfo=datetime.timezone.utc), '21', datetime.date(2024, 10, 1), 1861, 'main', ...)
    ignored_wrapper_args = (False, {'connection': <DatabaseWrapper vendor='postgresql' alias='default'>, 'cursor': <django.db.backends.utils.CursorWrapper object at 0x7f7c9ad140b0>})

    def _execute(self, sql, params, *ignored_wrapper_args):
    self.db.validate_no_broken_transaction()
    with self.db.wrap_database_errors:
    if params is None:
    # params default might be backend specific.
    return self.cursor.execute(sql)
    else:
    > return self.cursor.execute(sql, params)
    E psycopg2.errors.NotNullViolation: null value in column "flaky_fail_count" of relation "reports_dailytestrollups_default" violates not-null constraint
    E DETAIL: Failing row contains (6, 2024-10-02 19:28:13.436082+00, 2024-10-02 19:28:13.436093+00, 2024-10-01, 1861, main, 1, 2, 1, 1, 0.5, 2024-10-02 19:21:57.732232+00, {123,456,789}, 21, null).

    .../local/lib/python3.12.../db/backends/utils.py:89: NotNullViolation

    The above exception was the direct cause of the following exception:

    self = <graphql_api.tests.test_repository.TestFetchRepository testMethod=test_desc_failure_rate_ordering_on_test_results>

    def test_desc_failure_rate_ordering_on_test_results(self) -> None:
    repo = RepositoryFactory(author=self.owner, active=True, private=True)
    test = TestFactory(repository=repo)
    > _ = DailyTestRollupFactory(
    test=test,
    date=datetime.date.today() - datetime.timedelta(days=1),
    repoid=repo.repoid,
    pass_count=1,
    fail_count=1,
    )

    graphql_api/tests/test_repository.py:1164:
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    .../local/lib/python3.12............/site-packages/factory/base.py:40: in __call__
    return cls.create(**kwargs)
    .../local/lib/python3.12............/site-packages/factory/base.py:528: in create
    return cls._generate(enums.CREATE_STRATEGY, kwargs)
    .../local/lib/python3.12....../site-packages/factory/django.py:117: in _generate
    return super()._generate(strategy, params)
    .../local/lib/python3.12............/site-packages/factory/base.py:465: in _generate
    return step.build()
    .../local/lib/python3.12.../site-packages/factory/builder.py:262: in build
    instance = self.factory_meta.instantiate(
    .../local/lib/python3.12............/site-packages/factory/base.py:317: in instantiate
    return self.factory._create(model, *args, **kwargs)
    .../local/lib/python3.12....../site-packages/factory/django.py:166: in _create
    return manager.create(*args, **kwargs)
    .../local/lib/python3.12.../db/models/manager.py:87: in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
    .../local/lib/python3.12.../db/models/query.py:658: in create
    obj.save(force_insert=True, using=self.db)
    .../local/lib/python3.12.../db/models/base.py:814: in save
    self.save_base(
    .../local/lib/python3.12.../db/models/base.py:877: in save_base
    updated = self._save_table(
    .../local/lib/python3.12.../db/models/base.py:1020: in _save_table
    results = self._do_insert(
    .../local/lib/python3.12.../db/models/base.py:1061: in _do_insert
    return manager._insert(
    .../local/lib/python3.12.../db/models/manager.py:87: in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
    .../local/lib/python3.12.../db/models/query.py:1805: in _insert
    return query.get_compiler(using=using).execute_sql(returning_fields)
    .../local/lib/python3.12.../models/sql/compiler.py:1822: in execute_sql
    cursor.execute(sql, params)
    .../local/lib/python3.12.../site-packages/sentry_sdk/utils.py:1730: in runner
    return sentry_patched_function(*args, **kwargs)
    .../local/lib/python3.12.../integrations/django/__init__.py:651: in execute
    result = real_execute(self, sql, params)
    .../local/lib/python3.12.../db/backends/utils.py:67: in execute
    return self._execute_with_wrappers(
    .../local/lib/python3.12.../db/backends/utils.py:80: in _execute_with_wrappers
    return executor(sql, params, many, context)
    .../local/lib/python3.12.../db/backends/utils.py:84: in _execute
    with self.db.wrap_database_errors:
    .../local/lib/python3.12.../django/db/utils.py:91: in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    self = <django.db.backends.utils.CursorWrapper object at 0x7f7c9ad140b0>
    sql = 'INSERT INTO "reports_dailytestrollups" ("created_at", "updated_at", "test_id", "date", "repoid", "branch", "fail_coun...il") VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s::text[]) RETURNING "reports_dailytestrollups"."id"'
    params = (datetime.datetime(2024, 10, 2, 19, 28, 13, 436082, tzinfo=datetime.timezone.utc), datetime.datetime(2024, 10, 2, 19, 28, 13, 436093, tzinfo=datetime.timezone.utc), '21', datetime.date(2024, 10, 1), 1861, 'main', ...)
    ignored_wrapper_args = (False, {'connection': <DatabaseWrapper vendor='postgresql' alias='default'>, 'cursor': <django.db.backends.utils.CursorWrapper object at 0x7f7c9ad140b0>})

    def _execute(self, sql, params, *ignored_wrapper_args):
    self.db.validate_no_broken_transaction()
    with self.db.wrap_database_errors:
    if params is None:
    # params default might be backend specific.
    return self.cursor.execute(sql)
    else:
    > return self.cursor.execute(sql, params)
    E django.db.utils.IntegrityError: null value in column "flaky_fail_count" of relation "reports_dailytestrollups_default" violates not-null constraint
    E DETAIL: Failing row contains (6, 2024-10-02 19:28:13.436082+00, 2024-10-02 19:28:13.436093+00, 2024-10-01, 1861, main, 1, 2, 1, 1, 0.5, 2024-10-02 19:21:57.732232+00, {123,456,789}, 21, null).

    .../local/lib/python3.12.../db/backends/utils.py:89: IntegrityError
  • Class name: graphql_api.tests.test_repository.TestFetchRepository
    Test name: test_desc_last_duration_ordering_on_test_results

    self = <django.db.backends.utils.CursorWrapper object at 0x7f7cb1ca6f00>
    sql = 'INSERT INTO "reports_dailytestrollups" ("created_at", "updated_at", "test_id", "date", "repoid", "branch", "fail_coun...il") VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s::text[]) RETURNING "reports_dailytestrollups"."id"'
    params = (datetime.datetime(2024, 10, 2, 19, 28, 13, 984949, tzinfo=datetime.timezone.utc), datetime.datetime(2024, 10, 2, 19, 28, 13, 984957, tzinfo=datetime.timezone.utc), '22', datetime.date(2024, 10, 1), 1862, 'main', ...)
    ignored_wrapper_args = (False, {'connection': <DatabaseWrapper vendor='postgresql' alias='default'>, 'cursor': <django.db.backends.utils.CursorWrapper object at 0x7f7cb1ca6f00>})

    def _execute(self, sql, params, *ignored_wrapper_args):
    self.db.validate_no_broken_transaction()
    with self.db.wrap_database_errors:
    if params is None:
    # params default might be backend specific.
    return self.cursor.execute(sql)
    else:
    > return self.cursor.execute(sql, params)
    E psycopg2.errors.NotNullViolation: null value in column "flaky_fail_count" of relation "reports_dailytestrollups_default" violates not-null constraint
    E DETAIL: Failing row contains (7, 2024-10-02 19:28:13.984949+00, 2024-10-02 19:28:13.984957+00, 2024-10-01, 1862, main, 3, 2, 1, 1, 0.5, 2024-10-01 19:28:13.9847+00, {123,456,789}, 22, null).

    .../local/lib/python3.12.../db/backends/utils.py:89: NotNullViolation

    The above exception was the direct cause of the following exception:

    self = <graphql_api.tests.test_repository.TestFetchRepository testMethod=test_desc_last_duration_ordering_on_test_results>

    def test_desc_last_duration_ordering_on_test_results(self) -> None:
    repo = RepositoryFactory(author=self.owner, active=True, private=True)
    test = TestFactory(repository=repo)
    > _ = DailyTestRollupFactory(
    test=test,
    date=datetime.date.today() - datetime.timedelta(days=1),
    repoid=repo.repoid,
    last_duration_seconds=1,
    latest_run=datetime.datetime.now() - datetime.timedelta(days=1),
    )

    graphql_api/tests/test_repository.py:1025:
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    .../local/lib/python3.12............/site-packages/factory/base.py:40: in __call__
    return cls.create(**kwargs)
    .../local/lib/python3.12............/site-packages/factory/base.py:528: in create
    return cls._generate(enums.CREATE_STRATEGY, kwargs)
    .../local/lib/python3.12....../site-packages/factory/django.py:117: in _generate
    return super()._generate(strategy, params)
    .../local/lib/python3.12............/site-packages/factory/base.py:465: in _generate
    return step.build()
    .../local/lib/python3.12.../site-packages/factory/builder.py:262: in build
    instance = self.factory_meta.instantiate(
    .../local/lib/python3.12............/site-packages/factory/base.py:317: in instantiate
    return self.factory._create(model, *args, **kwargs)
    .../local/lib/python3.12....../site-packages/factory/django.py:166: in _create
    return manager.create(*args, **kwargs)
    .../local/lib/python3.12.../db/models/manager.py:87: in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
    .../local/lib/python3.12.../db/models/query.py:658: in create
    obj.save(force_insert=True, using=self.db)
    .../local/lib/python3.12.../db/models/base.py:814: in save
    self.save_base(
    .../local/lib/python3.12.../db/models/base.py:877: in save_base
    updated = self._save_table(
    .../local/lib/python3.12.../db/models/base.py:1020: in _save_table
    results = self._do_insert(
    .../local/lib/python3.12.../db/models/base.py:1061: in _do_insert
    return manager._insert(
    .../local/lib/python3.12.../db/models/manager.py:87: in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
    .../local/lib/python3.12.../db/models/query.py:1805: in _insert
    return query.get_compiler(using=using).execute_sql(returning_fields)
    .../local/lib/python3.12.../models/sql/compiler.py:1822: in execute_sql
    cursor.execute(sql, params)
    .../local/lib/python3.12.../site-packages/sentry_sdk/utils.py:1730: in runner
    return sentry_patched_function(*args, **kwargs)
    .../local/lib/python3.12.../integrations/django/__init__.py:651: in execute
    result = real_execute(self, sql, params)
    .../local/lib/python3.12.../db/backends/utils.py:67: in execute
    return self._execute_with_wrappers(
    .../local/lib/python3.12.../db/backends/utils.py:80: in _execute_with_wrappers
    return executor(sql, params, many, context)
    .../local/lib/python3.12.../db/backends/utils.py:84: in _execute
    with self.db.wrap_database_errors:
    .../local/lib/python3.12.../django/db/utils.py:91: in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    self = <django.db.backends.utils.CursorWrapper object at 0x7f7cb1ca6f00>
    sql = 'INSERT INTO "reports_dailytestrollups" ("created_at", "updated_at", "test_id", "date", "repoid", "branch", "fail_coun...il") VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s::text[]) RETURNING "reports_dailytestrollups"."id"'
    params = (datetime.datetime(2024, 10, 2, 19, 28, 13, 984949, tzinfo=datetime.timezone.utc), datetime.datetime(2024, 10, 2, 19, 28, 13, 984957, tzinfo=datetime.timezone.utc), '22', datetime.date(2024, 10, 1), 1862, 'main', ...)
    ignored_wrapper_args = (False, {'connection': <DatabaseWrapper vendor='postgresql' alias='default'>, 'cursor': <django.db.backends.utils.CursorWrapper object at 0x7f7cb1ca6f00>})

    def _execute(self, sql, params, *ignored_wrapper_args):
    self.db.validate_no_broken_transaction()
    with self.db.wrap_database_errors:
    if params is None:
    # params default might be backend specific.
    return self.cursor.execute(sql)
    else:
    > return self.cursor.execute(sql, params)
    E django.db.utils.IntegrityError: null value in column "flaky_fail_count" of relation "reports_dailytestrollups_default" violates not-null constraint
    E DETAIL: Failing row contains (7, 2024-10-02 19:28:13.984949+00, 2024-10-02 19:28:13.984957+00, 2024-10-01, 1862, main, 3, 2, 1, 1, 0.5, 2024-10-01 19:28:13.9847+00, {123,456,789}, 22, null).

    .../local/lib/python3.12.../db/backends/utils.py:89: IntegrityError
  • Class name: graphql_api.tests.test_repository.TestFetchRepository
    Test name: test_failure_rate_ordering_on_test_results

    self = <django.db.backends.utils.CursorWrapper object at 0x7f7cb1d36e40>
    sql = 'INSERT INTO "reports_dailytestrollups" ("created_at", "updated_at", "test_id", "date", "repoid", "branch", "fail_coun...il") VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s::text[]) RETURNING "reports_dailytestrollups"."id"'
    params = (datetime.datetime(2024, 10, 2, 19, 28, 14, 537438, tzinfo=datetime.timezone.utc), datetime.datetime(2024, 10, 2, 19, 28, 14, 537446, tzinfo=datetime.timezone.utc), '23', datetime.date(2024, 10, 1), 1863, 'main', ...)
    ignored_wrapper_args = (False, {'connection': <DatabaseWrapper vendor='postgresql' alias='default'>, 'cursor': <django.db.backends.utils.CursorWrapper object at 0x7f7cb1d36e40>})

    def _execute(self, sql, params, *ignored_wrapper_args):
    self.db.validate_no_broken_transaction()
    with self.db.wrap_database_errors:
    if params is None:
    # params default might be backend specific.
    return self.cursor.execute(sql)
    else:
    > return self.cursor.execute(sql, params)
    E psycopg2.errors.NotNullViolation: null value in column "flaky_fail_count" of relation "reports_dailytestrollups_default" violates not-null constraint
    E DETAIL: Failing row contains (8, 2024-10-02 19:28:14.537438+00, 2024-10-02 19:28:14.537446+00, 2024-10-01, 1863, main, 1, 2, 1, 1, 0.5, 2024-10-02 19:21:57.732232+00, {123,456,789}, 23, null).

    .../local/lib/python3.12.../db/backends/utils.py:89: NotNullViolation

    The above exception was the direct cause of the following exception:

    self = <graphql_api.tests.test_repository.TestFetchRepository testMethod=test_failure_rate_ordering_on_test_results>

    def test_failure_rate_ordering_on_test_results(self) -> None:
    repo = RepositoryFactory(author=self.owner, active=True, private=True)
    test = TestFactory(repository=repo)
    > _ = DailyTestRollupFactory(
    test=test,
    date=datetime.date.today() - datetime.timedelta(days=1),
    repoid=repo.repoid,
    pass_count=1,
    fail_count=1,
    )

    graphql_api/tests/test_repository.py:1127:
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    .../local/lib/python3.12............/site-packages/factory/base.py:40: in __call__
    return cls.create(**kwargs)
    .../local/lib/python3.12............/site-packages/factory/base.py:528: in create
    return cls._generate(enums.CREATE_STRATEGY, kwargs)
    .../local/lib/python3.12....../site-packages/factory/django.py:117: in _generate
    return super()._generate(strategy, params)
    .../local/lib/python3.12............/site-packages/factory/base.py:465: in _generate
    return step.build()
    .../local/lib/python3.12.../site-packages/factory/builder.py:262: in build
    instance = self.factory_meta.instantiate(
    .../local/lib/python3.12............/site-packages/factory/base.py:317: in instantiate
    return self.factory._create(model, *args, **kwargs)
    .../local/lib/python3.12....../site-packages/factory/django.py:166: in _create
    return manager.create(*args, **kwargs)
    .../local/lib/python3.12.../db/models/manager.py:87: in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
    .../local/lib/python3.12.../db/models/query.py:658: in create
    obj.save(force_insert=True, using=self.db)
    .../local/lib/python3.12.../db/models/base.py:814: in save
    self.save_base(
    .../local/lib/python3.12.../db/models/base.py:877: in save_base
    updated = self._save_table(
    .../local/lib/python3.12.../db/models/base.py:1020: in _save_table
    results = self._do_insert(
    .../local/lib/python3.12.../db/models/base.py:1061: in _do_insert
    return manager._insert(
    .../local/lib/python3.12.../db/models/manager.py:87: in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
    .../local/lib/python3.12.../db/models/query.py:1805: in _insert
    return query.get_compiler(using=using).execute_sql(returning_fields)
    .../local/lib/python3.12.../models/sql/compiler.py:1822: in execute_sql
    cursor.execute(sql, params)
    .../local/lib/python3.12.../site-packages/sentry_sdk/utils.py:1730: in runner
    return sentry_patched_function(*args, **kwargs)
    .../local/lib/python3.12.../integrations/django/__init__.py:651: in execute
    result = real_execute(self, sql, params)
    .../local/lib/python3.12.../db/backends/utils.py:67: in execute
    return self._execute_with_wrappers(
    .../local/lib/python3.12.../db/backends/utils.py:80: in _execute_with_wrappers
    return executor(sql, params, many, context)
    .../local/lib/python3.12.../db/backends/utils.py:84: in _execute
    with self.db.wrap_database_errors:
    .../local/lib/python3.12.../django/db/utils.py:91: in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    self = <django.db.backends.utils.CursorWrapper object at 0x7f7cb1d36e40>
    sql = 'INSERT INTO "reports_dailytestrollups" ("created_at", "updated_at", "test_id", "date", "repoid", "branch", "fail_coun...il") VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s::text[]) RETURNING "reports_dailytestrollups"."id"'
    params = (datetime.datetime(2024, 10, 2, 19, 28, 14, 537438, tzinfo=datetime.timezone.utc), datetime.datetime(2024, 10, 2, 19, 28, 14, 537446, tzinfo=datetime.timezone.utc), '23', datetime.date(2024, 10, 1), 1863, 'main', ...)
    ignored_wrapper_args = (False, {'connection': <DatabaseWrapper vendor='postgresql' alias='default'>, 'cursor': <django.db.backends.utils.CursorWrapper object at 0x7f7cb1d36e40>})

    def _execute(self, sql, params, *ignored_wrapper_args):
    self.db.validate_no_broken_transaction()
    with self.db.wrap_database_errors:
    if params is None:
    # params default might be backend specific.
    return self.cursor.execute(sql)
    else:
    > return self.cursor.execute(sql, params)
    E django.db.utils.IntegrityError: null value in column "flaky_fail_count" of relation "reports_dailytestrollups_default" violates not-null constraint
    E DETAIL: Failing row contains (8, 2024-10-02 19:28:14.537438+00, 2024-10-02 19:28:14.537446+00, 2024-10-01, 1863, main, 1, 2, 1, 1, 0.5, 2024-10-02 19:21:57.732232+00, {123,456,789}, 23, null).

    .../local/lib/python3.12.../db/backends/utils.py:89: IntegrityError
  • Class name: graphql_api.tests.test_repository.TestFetchRepository
    Test name: test_last_duration_ordering_on_test_results

    self = <django.db.backends.utils.CursorWrapper object at 0x7f7ca42ce6c0>
    sql = 'INSERT INTO "reports_dailytestrollups" ("created_at", "updated_at", "test_id", "date", "repoid", "branch", "fail_coun...il") VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s::text[]) RETURNING "reports_dailytestrollups"."id"'
    params = (datetime.datetime(2024, 10, 2, 19, 28, 16, 327170, tzinfo=datetime.timezone.utc), datetime.datetime(2024, 10, 2, 19, 28, 16, 327178, tzinfo=datetime.timezone.utc), '24', datetime.date(2024, 10, 1), 1867, 'main', ...)
    ignored_wrapper_args = (False, {'connection': <DatabaseWrapper vendor='postgresql' alias='default'>, 'cursor': <django.db.backends.utils.CursorWrapper object at 0x7f7ca42ce6c0>})

    def _execute(self, sql, params, *ignored_wrapper_args):
    self.db.validate_no_broken_transaction()
    with self.db.wrap_database_errors:
    if params is None:
    # params default might be backend specific.
    return self.cursor.execute(sql)
    else:
    > return self.cursor.execute(sql, params)
    E psycopg2.errors.NotNullViolation: null value in column "flaky_fail_count" of relation "reports_dailytestrollups_default" violates not-null constraint
    E DETAIL: Failing row contains (9, 2024-10-02 19:28:16.32717+00, 2024-10-02 19:28:16.327178+00, 2024-10-01, 1867, main, 3, 2, 1, 1, 0.5, 2024-10-01 19:28:16.326926+00, {123,456,789}, 24, null).

    .../local/lib/python3.12.../db/backends/utils.py:89: NotNullViolation

    The above exception was the direct cause of the following exception:

    self = <graphql_api.tests.test_repository.TestFetchRepository testMethod=test_last_duration_ordering_on_test_results>

    def test_last_duration_ordering_on_test_results(self) -> None:
    repo = RepositoryFactory(author=self.owner, active=True, private=True)
    test = TestFactory(repository=repo)
    > _ = DailyTestRollupFactory(
    test=test,
    date=datetime.date.today() - datetime.timedelta(days=1),
    repoid=repo.repoid,
    last_duration_seconds=1,
    latest_run=datetime.datetime.now() - datetime.timedelta(days=1),
    )

    graphql_api/tests/test_repository.py:990:
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    .../local/lib/python3.12............/site-packages/factory/base.py:40: in __call__
    return cls.create(**kwargs)
    .../local/lib/python3.12............/site-packages/factory/base.py:528: in create
    return cls._generate(enums.CREATE_STRATEGY, kwargs)
    .../local/lib/python3.12....../site-packages/factory/django.py:117: in _generate
    return super()._generate(strategy, params)
    .../local/lib/python3.12............/site-packages/factory/base.py:465: in _generate
    return step.build()
    .../local/lib/python3.12.../site-packages/factory/builder.py:262: in build
    instance = self.factory_meta.instantiate(
    .../local/lib/python3.12............/site-packages/factory/base.py:317: in instantiate
    return self.factory._create(model, *args, **kwargs)
    .../local/lib/python3.12....../site-packages/factory/django.py:166: in _create
    return manager.create(*args, **kwargs)
    .../local/lib/python3.12.../db/models/manager.py:87: in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
    .../local/lib/python3.12.../db/models/query.py:658: in create
    obj.save(force_insert=True, using=self.db)
    .../local/lib/python3.12.../db/models/base.py:814: in save
    self.save_base(
    .../local/lib/python3.12.../db/models/base.py:877: in save_base
    updated = self._save_table(
    .../local/lib/python3.12.../db/models/base.py:1020: in _save_table
    results = self._do_insert(
    .../local/lib/python3.12.../db/models/base.py:1061: in _do_insert
    return manager._insert(
    .../local/lib/python3.12.../db/models/manager.py:87: in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
    .../local/lib/python3.12.../db/models/query.py:1805: in _insert
    return query.get_compiler(using=using).execute_sql(returning_fields)
    .../local/lib/python3.12.../models/sql/compiler.py:1822: in execute_sql
    cursor.execute(sql, params)
    .../local/lib/python3.12.../site-packages/sentry_sdk/utils.py:1730: in runner
    return sentry_patched_function(*args, **kwargs)
    .../local/lib/python3.12.../integrations/django/__init__.py:651: in execute
    result = real_execute(self, sql, params)
    .../local/lib/python3.12.../db/backends/utils.py:67: in execute
    return self._execute_with_wrappers(
    .../local/lib/python3.12.../db/backends/utils.py:80: in _execute_with_wrappers
    return executor(sql, params, many, context)
    .../local/lib/python3.12.../db/backends/utils.py:84: in _execute
    with self.db.wrap_database_errors:
    .../local/lib/python3.12.../django/db/utils.py:91: in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    self = <django.db.backends.utils.CursorWrapper object at 0x7f7ca42ce6c0>
    sql = 'INSERT INTO "reports_dailytestrollups" ("created_at", "updated_at", "test_id", "date", "repoid", "branch", "fail_coun...il") VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s::text[]) RETURNING "reports_dailytestrollups"."id"'
    params = (datetime.datetime(2024, 10, 2, 19, 28, 16, 327170, tzinfo=datetime.timezone.utc), datetime.datetime(2024, 10, 2, 19, 28, 16, 327178, tzinfo=datetime.timezone.utc), '24', datetime.date(2024, 10, 1), 1867, 'main', ...)
    ignored_wrapper_args = (False, {'connection': <DatabaseWrapper vendor='postgresql' alias='default'>, 'cursor': <django.db.backends.utils.CursorWrapper object at 0x7f7ca42ce6c0>})

    def _execute(self, sql, params, *ignored_wrapper_args):
    self.db.validate_no_broken_transaction()
    with self.db.wrap_database_errors:
    if params is None:
    # params default might be backend specific.
    return self.cursor.execute(sql)
    else:
    > return self.cursor.execute(sql, params)
    E django.db.utils.IntegrityError: null value in column "flaky_fail_count" of relation "reports_dailytestrollups_default" violates not-null constraint
    E DETAIL: Failing row contains (9, 2024-10-02 19:28:16.32717+00, 2024-10-02 19:28:16.327178+00, 2024-10-01, 1867, main, 3, 2, 1, 1, 0.5, 2024-10-01 19:28:16.326926+00, {123,456,789}, 24, null).

    .../local/lib/python3.12.../db/backends/utils.py:89: IntegrityError
  • Class name: graphql_api.tests.test_repository.TestFetchRepository
    Test name: test_test_results

    self = <django.db.backends.utils.CursorWrapper object at 0x7f7c8cbd5880>
    sql = 'INSERT INTO "reports_dailytestrollups" ("created_at", "updated_at", "test_id", "date", "repoid", "branch", "fail_coun...il") VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s::text[]) RETURNING "reports_dailytestrollups"."id"'
    params = (datetime.datetime(2024, 10, 2, 19, 28, 31, 990247, tzinfo=datetime.timezone.utc), datetime.datetime(2024, 10, 2, 19, 28, 31, 990256, tzinfo=datetime.timezone.utc), '25', datetime.date(2024, 10, 2), 1903, 'main', ...)
    ignored_wrapper_args = (False, {'connection': <DatabaseWrapper vendor='postgresql' alias='default'>, 'cursor': <django.db.backends.utils.CursorWrapper object at 0x7f7c8cbd5880>})

    def _execute(self, sql, params, *ignored_wrapper_args):
    self.db.validate_no_broken_transaction()
    with self.db.wrap_database_errors:
    if params is None:
    # params default might be backend specific.
    return self.cursor.execute(sql)
    else:
    > return self.cursor.execute(sql, params)
    E psycopg2.errors.NotNullViolation: null value in column "flaky_fail_count" of relation "reports_dailytestrollups_default" violates not-null constraint
    E DETAIL: Failing row contains (10, 2024-10-02 19:28:31.990247+00, 2024-10-02 19:28:31.990256+00, 2024-10-02, 1903, main, 3, 2, 1, 1, 0.5, 2024-10-02 19:21:57.732232+00, {123,456,789}, 25, null).

    .../local/lib/python3.12.../db/backends/utils.py:89: NotNullViolation

    The above exception was the direct cause of the following exception:

    self = <graphql_api.tests.test_repository.TestFetchRepository testMethod=test_test_results>

    def test_test_results(self) -> None:
    repo = RepositoryFactory(author=self.owner, active=True, private=True)
    test = TestFactory(repository=repo)

    > _ = DailyTestRollupFactory(test=test)

    graphql_api/tests/test_repository.py:886:
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    .../local/lib/python3.12............/site-packages/factory/base.py:40: in __call__
    return cls.create(**kwargs)
    .../local/lib/python3.12............/site-packages/factory/base.py:528: in create
    return cls._generate(enums.CREATE_STRATEGY, kwargs)
    .../local/lib/python3.12....../site-packages/factory/django.py:117: in _generate
    return super()._generate(strategy, params)
    .../local/lib/python3.12............/site-packages/factory/base.py:465: in _generate
    return step.build()
    .../local/lib/python3.12.../site-packages/factory/builder.py:262: in build
    instance = self.factory_meta.instantiate(
    .../local/lib/python3.12............/site-packages/factory/base.py:317: in instantiate
    return self.factory._create(model, *args, **kwargs)
    .../local/lib/python3.12....../site-packages/factory/django.py:166: in _create
    return manager.create(*args, **kwargs)
    .../local/lib/python3.12.../db/models/manager.py:87: in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
    .../local/lib/python3.12.../db/models/query.py:658: in create
    obj.save(force_insert=True, using=self.db)
    .../local/lib/python3.12.../db/models/base.py:814: in save
    self.save_base(
    .../local/lib/python3.12.../db/models/base.py:877: in save_base
    updated = self._save_table(
    .../local/lib/python3.12.../db/models/base.py:1020: in _save_table
    results = self._do_insert(
    .../local/lib/python3.12.../db/models/base.py:1061: in _do_insert
    return manager._insert(
    .../local/lib/python3.12.../db/models/manager.py:87: in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
    .../local/lib/python3.12.../db/models/query.py:1805: in _insert
    return query.get_compiler(using=using).execute_sql(returning_fields)
    .../local/lib/python3.12.../models/sql/compiler.py:1822: in execute_sql
    cursor.execute(sql, params)
    .../local/lib/python3.12.../site-packages/sentry_sdk/utils.py:1730: in runner
    return sentry_patched_function(*args, **kwargs)
    .../local/lib/python3.12.../integrations/django/__init__.py:651: in execute
    result = real_execute(self, sql, params)
    .../local/lib/python3.12.../db/backends/utils.py:67: in execute
    return self._execute_with_wrappers(
    .../local/lib/python3.12.../db/backends/utils.py:80: in _execute_with_wrappers
    return executor(sql, params, many, context)
    .../local/lib/python3.12.../db/backends/utils.py:84: in _execute
    with self.db.wrap_database_errors:
    .../local/lib/python3.12.../django/db/utils.py:91: in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    self = <django.db.backends.utils.CursorWrapper object at 0x7f7c8cbd5880>
    sql = 'INSERT INTO "reports_dailytestrollups" ("created_at", "updated_at", "test_id", "date", "repoid", "branch", "fail_coun...il") VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s::text[]) RETURNING "reports_dailytestrollups"."id"'
    params = (datetime.datetime(2024, 10, 2, 19, 28, 31, 990247, tzinfo=datetime.timezone.utc), datetime.datetime(2024, 10, 2, 19, 28, 31, 990256, tzinfo=datetime.timezone.utc), '25', datetime.date(2024, 10, 2), 1903, 'main', ...)
    ignored_wrapper_args = (False, {'connection': <DatabaseWrapper vendor='postgresql' alias='default'>, 'cursor': <django.db.backends.utils.CursorWrapper object at 0x7f7c8cbd5880>})

    def _execute(self, sql, params, *ignored_wrapper_args):
    self.db.validate_no_broken_transaction()
    with self.db.wrap_database_errors:
    if params is None:
    # params default might be backend specific.
    return self.cursor.execute(sql)
    else:
    > return self.cursor.execute(sql, params)
    E django.db.utils.IntegrityError: null value in column "flaky_fail_count" of relation "reports_dailytestrollups_default" violates not-null constraint
    E DETAIL: Failing row contains (10, 2024-10-02 19:28:31.990247+00, 2024-10-02 19:28:31.990256+00, 2024-10-02, 1903, main, 3, 2, 1, 1, 0.5, 2024-10-02 19:21:57.732232+00, {123,456,789}, 25, null).

    .../local/lib/python3.12.../db/backends/utils.py:89: IntegrityError
  • Class name: graphql_api.tests.test_test_result.TestResultTestCase
    Test name: test_fetch_test_result_avg_duration

    self = <django.db.backends.utils.CursorWrapper object at 0x7f7c8cb4fa40>
    sql = 'INSERT INTO "reports_dailytestrollups" ("created_at", "updated_at", "test_id", "date", "repoid", "branch", "fail_coun...il") VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s::text[]) RETURNING "reports_dailytestrollups"."id"'
    params = (FakeDatetime(2024, 10, 2, 19, 22, 0, 125055, tzinfo=datetime.timezone.utc), FakeDatetime(2024, 10, 2, 19, 22, 0, 125055, tzinfo=datetime.timezone.utc), '26', FakeDate(2024, 9, 30), 1909, 'main', ...)
    ignored_wrapper_args = (False, {'connection': <DatabaseWrapper vendor='postgresql' alias='default'>, 'cursor': <django.db.backends.utils.CursorWrapper object at 0x7f7c8cb4fa40>})

    def _execute(self, sql, params, *ignored_wrapper_args):
    self.db.validate_no_broken_transaction()
    with self.db.wrap_database_errors:
    if params is None:
    # params default might be backend specific.
    return self.cursor.execute(sql)
    else:
    > return self.cursor.execute(sql, params)
    E psycopg2.errors.NotNullViolation: null value in column "flaky_fail_count" of relation "reports_dailytestrollups_default" violates not-null constraint
    E DETAIL: Failing row contains (11, 2024-10-02 19:22:00.125055+00, 2024-10-02 19:22:00.125055+00, 2024-09-30, 1909, main, 3, 2, 1, 1, 0.6, 2024-09-30 19:22:00.125055+00, {123}, 26, null).

    .../local/lib/python3.12.../db/backends/utils.py:89: NotNullViolation

    The above exception was the direct cause of the following exception:

    self = <graphql_api.tests.test_test_result.TestResultTestCase testMethod=test_fetch_test_result_avg_duration>

    def setUp(self):
    self.owner = OwnerFactory(username="randomOwner")
    self.repository = RepositoryFactory(
    author=self.owner,
    )
    self.test = TestFactory(
    name="Test\x1fName",
    repository=self.repository,
    )

    > _ = DailyTestRollupFactory(
    test=self.test,
    commits_where_fail=["123"],
    date=date.today() - timedelta(days=2),
    avg_duration_seconds=0.6,
    latest_run=datetime.now() - timedelta(days=2),
    )

    graphql_api/tests/test_test_result.py:25:
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    .../local/lib/python3.12............/site-packages/factory/base.py:40: in __call__
    return cls.create(**kwargs)
    .../local/lib/python3.12............/site-packages/factory/base.py:528: in create
    return cls._generate(enums.CREATE_STRATEGY, kwargs)
    .../local/lib/python3.12....../site-packages/factory/django.py:117: in _generate
    return super()._generate(strategy, params)
    .../local/lib/python3.12............/site-packages/factory/base.py:465: in _generate
    return step.build()
    .../local/lib/python3.12.../site-packages/factory/builder.py:262: in build
    instance = self.factory_meta.instantiate(
    .../local/lib/python3.12............/site-packages/factory/base.py:317: in instantiate
    return self.factory._create(model, *args, **kwargs)
    .../local/lib/python3.12....../site-packages/factory/django.py:166: in _create
    return manager.create(*args, **kwargs)
    .../local/lib/python3.12.../db/models/manager.py:87: in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
    .../local/lib/python3.12.../db/models/query.py:658: in create
    obj.save(force_insert=True, using=self.db)
    .../local/lib/python3.12.../db/models/base.py:814: in save
    self.save_base(
    .../local/lib/python3.12.../db/models/base.py:877: in save_base
    updated = self._save_table(
    .../local/lib/python3.12.../db/models/base.py:1020: in _save_table
    results = self._do_insert(
    .../local/lib/python3.12.../db/models/base.py:1061: in _do_insert
    return manager._insert(
    .../local/lib/python3.12.../db/models/manager.py:87: in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
    .../local/lib/python3.12.../db/models/query.py:1805: in _insert
    return query.get_compiler(using=using).execute_sql(returning_fields)
    .../local/lib/python3.12.../models/sql/compiler.py:1822: in execute_sql
    cursor.execute(sql, params)
    .../local/lib/python3.12.../site-packages/sentry_sdk/utils.py:1730: in runner
    return sentry_patched_function(*args, **kwargs)
    .../local/lib/python3.12.../integrations/django/__init__.py:651: in execute
    result = real_execute(self, sql, params)
    .../local/lib/python3.12.../db/backends/utils.py:67: in execute
    return self._execute_with_wrappers(
    .../local/lib/python3.12.../db/backends/utils.py:80: in _execute_with_wrappers
    return executor(sql, params, many, context)
    .../local/lib/python3.12.../db/backends/utils.py:84: in _execute
    with self.db.wrap_database_errors:
    .../local/lib/python3.12.../django/db/utils.py:91: in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    self = <django.db.backends.utils.CursorWrapper object at 0x7f7c8cb4fa40>
    sql = 'INSERT INTO "reports_dailytestrollups" ("created_at", "updated_at", "test_id", "date", "repoid", "branch", "fail_coun...il") VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s::text[]) RETURNING "reports_dailytestrollups"."id"'
    params = (FakeDatetime(2024, 10, 2, 19, 22, 0, 125055, tzinfo=datetime.timezone.utc), FakeDatetime(2024, 10, 2, 19, 22, 0, 125055, tzinfo=datetime.timezone.utc), '26', FakeDate(2024, 9, 30), 1909, 'main', ...)
    ignored_wrapper_args = (False, {'connection': <DatabaseWrapper vendor='postgresql' alias='default'>, 'cursor': <django.db.backends.utils.CursorWrapper object at 0x7f7c8cb4fa40>})

    def _execute(self, sql, params, *ignored_wrapper_args):
    self.db.validate_no_broken_transaction()
    with self.db.wrap_database_errors:
    if params is None:
    # params default might be backend specific.
    return self.cursor.execute(sql)
    else:
    > return self.cursor.execute(sql, params)
    E django.db.utils.IntegrityError: null value in column "flaky_fail_count" of relation "reports_dailytestrollups_default" violates not-null constraint
    E DETAIL: Failing row contains (11, 2024-10-02 19:22:00.125055+00, 2024-10-02 19:22:00.125055+00, 2024-09-30, 1909, main, 3, 2, 1, 1, 0.6, 2024-09-30 19:22:00.125055+00, {123}, 26, null).

    .../local/lib/python3.12.../db/backends/utils.py:89: IntegrityError
  • Class name: graphql_api.tests.test_test_result.TestResultTestCase
    Test name: test_fetch_test_result_commits_failed

    self = <django.db.backends.utils.CursorWrapper object at 0x7f7c989e4b60>
    sql = 'INSERT INTO "reports_dailytestrollups" ("created_at", "updated_at", "test_id", "date", "repoid", "branch", "fail_coun...il") VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s::text[]) RETURNING "reports_dailytestrollups"."id"'
    params = (FakeDatetime(2024, 10, 2, 19, 22, 0, 125055, tzinfo=datetime.timezone.utc), FakeDatetime(2024, 10, 2, 19, 22, 0, 125055, tzinfo=datetime.timezone.utc), '27', FakeDate(2024, 9, 30), 1910, 'main', ...)
    ignored_wrapper_args = (False, {'connection': <DatabaseWrapper vendor='postgresql' alias='default'>, 'cursor': <django.db.backends.utils.CursorWrapper object at 0x7f7c989e4b60>})

    def _execute(self, sql, params, *ignored_wrapper_args):
    self.db.validate_no_broken_transaction()
    with self.db.wrap_database_errors:
    if params is None:
    # params default might be backend specific.
    return self.cursor.execute(sql)
    else:
    > return self.cursor.execute(sql, params)
    E psycopg2.errors.NotNullViolation: null value in column "flaky_fail_count" of relation "reports_dailytestrollups_default" violates not-null constraint
    E DETAIL: Failing row contains (12, 2024-10-02 19:22:00.125055+00, 2024-10-02 19:22:00.125055+00, 2024-09-30, 1910, main, 3, 2, 1, 1, 0.6, 2024-09-30 19:22:00.125055+00, {123}, 27, null).

    .../local/lib/python3.12.../db/backends/utils.py:89: NotNullViolation

    The above exception was the direct cause of the following exception:

    self = <graphql_api.tests.test_test_result.TestResultTestCase testMethod=test_fetch_test_result_commits_failed>

    def setUp(self):
    self.owner = OwnerFactory(username="randomOwner")
    self.repository = RepositoryFactory(
    author=self.owner,
    )
    self.test = TestFactory(
    name="Test\x1fName",
    repository=self.repository,
    )

    > _ = DailyTestRollupFactory(
    test=self.test,
    commits_where_fail=["123"],
    date=date.today() - timedelta(days=2),
    avg_duration_seconds=0.6,
    latest_run=datetime.now() - timedelta(days=2),
    )

    graphql_api/tests/test_test_result.py:25:
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    .../local/lib/python3.12............/site-packages/factory/base.py:40: in __call__
    return cls.create(**kwargs)
    .../local/lib/python3.12............/site-packages/factory/base.py:528: in create
    return cls._generate(enums.CREATE_STRATEGY, kwargs)
    .../local/lib/python3.12....../site-packages/factory/django.py:117: in _generate
    return super()._generate(strategy, params)
    .../local/lib/python3.12............/site-packages/factory/base.py:465: in _generate
    return step.build()
    .../local/lib/python3.12.../site-packages/factory/builder.py:262: in build
    instance = self.factory_meta.instantiate(
    .../local/lib/python3.12............/site-packages/factory/base.py:317: in instantiate
    return self.factory._create(model, *args, **kwargs)
    .../local/lib/python3.12....../site-packages/factory/django.py:166: in _create
    return manager.create(*args, **kwargs)
    .../local/lib/python3.12.../db/models/manager.py:87: in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
    .../local/lib/python3.12.../db/models/query.py:658: in create
    obj.save(force_insert=True, using=self.db)
    .../local/lib/python3.12.../db/models/base.py:814: in save
    self.save_base(
    .../local/lib/python3.12.../db/models/base.py:877: in save_base
    updated = self._save_table(
    .../local/lib/python3.12.../db/models/base.py:1020: in _save_table
    results = self._do_insert(
    .../local/lib/python3.12.../db/models/base.py:1061: in _do_insert
    return manager._insert(
    .../local/lib/python3.12.../db/models/manager.py:87: in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
    .../local/lib/python3.12.../db/models/query.py:1805: in _insert
    return query.get_compiler(using=using).execute_sql(returning_fields)
    .../local/lib/python3.12.../models/sql/compiler.py:1822: in execute_sql
    cursor.execute(sql, params)
    .../local/lib/python3.12.../site-packages/sentry_sdk/utils.py:1730: in runner
    return sentry_patched_function(*args, **kwargs)
    .../local/lib/python3.12.../integrations/django/__init__.py:651: in execute
    result = real_execute(self, sql, params)
    .../local/lib/python3.12.../db/backends/utils.py:67: in execute
    return self._execute_with_wrappers(
    .../local/lib/python3.12.../db/backends/utils.py:80: in _execute_with_wrappers
    return executor(sql, params, many, context)
    .../local/lib/python3.12.../db/backends/utils.py:84: in _execute
    with self.db.wrap_database_errors:
    .../local/lib/python3.12.../django/db/utils.py:91: in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    self = <django.db.backends.utils.CursorWrapper object at 0x7f7c989e4b60>
    sql = 'INSERT INTO "reports_dailytestrollups" ("created_at", "updated_at", "test_id", "date", "repoid", "branch", "fail_coun...il") VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s::text[]) RETURNING "reports_dailytestrollups"."id"'
    params = (FakeDatetime(2024, 10, 2, 19, 22, 0, 125055, tzinfo=datetime.timezone.utc), FakeDatetime(2024, 10, 2, 19, 22, 0, 125055, tzinfo=datetime.timezone.utc), '27', FakeDate(2024, 9, 30), 1910, 'main', ...)
    ignored_wrapper_args = (False, {'connection': <DatabaseWrapper vendor='postgresql' alias='default'>, 'cursor': <django.db.backends.utils.CursorWrapper object at 0x7f7c989e4b60>})

    def _execute(self, sql, params, *ignored_wrapper_args):
    self.db.validate_no_broken_transaction()
    with self.db.wrap_database_errors:
    if params is None:
    # params default might be backend specific.
    return self.cursor.execute(sql)
    else:
    > return self.cursor.execute(sql, params)
    E django.db.utils.IntegrityError: null value in column "flaky_fail_count" of relation "reports_dailytestrollups_default" violates not-null constraint
    E DETAIL: Failing row contains (12, 2024-10-02 19:22:00.125055+00, 2024-10-02 19:22:00.125055+00, 2024-09-30, 1910, main, 3, 2, 1, 1, 0.6, 2024-09-30 19:22:00.125055+00, {123}, 27, null).

    .../local/lib/python3.12.../db/backends/utils.py:89: IntegrityError
  • Class name: graphql_api.tests.test_test_result.TestResultTestCase
    Test name: test_fetch_test_result_failure_rate

    self = <django.db.backends.utils.CursorWrapper object at 0x7f7c8cb9cb60>
    sql = 'INSERT INTO "reports_dailytestrollups" ("created_at", "updated_at", "test_id", "date", "repoid", "branch", "fail_coun...il") VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s::text[]) RETURNING "reports_dailytestrollups"."id"'
    params = (FakeDatetime(2024, 10, 2, 19, 22, 0, 125055, tzinfo=datetime.timezone.utc), FakeDatetime(2024, 10, 2, 19, 22, 0, 125055, tzinfo=datetime.timezone.utc), '28', FakeDate(2024, 9, 30), 1911, 'main', ...)
    ignored_wrapper_args = (False, {'connection': <DatabaseWrapper vendor='postgresql' alias='default'>, 'cursor': <django.db.backends.utils.CursorWrapper object at 0x7f7c8cb9cb60>})

    def _execute(self, sql, params, *ignored_wrapper_args):
    self.db.validate_no_broken_transaction()
    with self.db.wrap_database_errors:
    if params is None:
    # params default might be backend specific.
    return self.cursor.execute(sql)
    else:
    > return self.cursor.execute(sql, params)
    E psycopg2.errors.NotNullViolation: null value in column "flaky_fail_count" of relation "reports_dailytestrollups_default" violates not-null constraint
    E DETAIL: Failing row contains (13, 2024-10-02 19:22:00.125055+00, 2024-10-02 19:22:00.125055+00, 2024-09-30, 1911, main, 3, 2, 1, 1, 0.6, 2024-09-30 19:22:00.125055+00, {123}, 28, null).

    .../local/lib/python3.12.../db/backends/utils.py:89: NotNullViolation

    The above exception was the direct cause of the following exception:

    self = <graphql_api.tests.test_test_result.TestResultTestCase testMethod=test_fetch_test_result_failure_rate>

    def setUp(self):
    self.owner = OwnerFactory(username="randomOwner")
    self.repository = RepositoryFactory(
    author=self.owner,
    )
    self.test = TestFactory(
    name="Test\x1fName",
    repository=self.repository,
    )

    > _ = DailyTestRollupFactory(
    test=self.test,
    commits_where_fail=["123"],
    date=date.today() - timedelta(days=2),
    avg_duration_seconds=0.6,
    latest_run=datetime.now() - timedelta(days=2),
    )

    graphql_api/tests/test_test_result.py:25:
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    .../local/lib/python3.12............/site-packages/factory/base.py:40: in __call__
    return cls.create(**kwargs)
    .../local/lib/python3.12............/site-packages/factory/base.py:528: in create
    return cls._generate(enums.CREATE_STRATEGY, kwargs)
    .../local/lib/python3.12....../site-packages/factory/django.py:117: in _generate
    return super()._generate(strategy, params)
    .../local/lib/python3.12............/site-packages/factory/base.py:465: in _generate
    return step.build()
    .../local/lib/python3.12.../site-packages/factory/builder.py:262: in build
    instance = self.factory_meta.instantiate(
    .../local/lib/python3.12............/site-packages/factory/base.py:317: in instantiate
    return self.factory._create(model, *args, **kwargs)
    .../local/lib/python3.12....../site-packages/factory/django.py:166: in _create
    return manager.create(*args, **kwargs)
    .../local/lib/python3.12.../db/models/manager.py:87: in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
    .../local/lib/python3.12.../db/models/query.py:658: in create
    obj.save(force_insert=True, using=self.db)
    .../local/lib/python3.12.../db/models/base.py:814: in save
    self.save_base(
    .../local/lib/python3.12.../db/models/base.py:877: in save_base
    updated = self._save_table(
    .../local/lib/python3.12.../db/models/base.py:1020: in _save_table
    results = self._do_insert(
    .../local/lib/python3.12.../db/models/base.py:1061: in _do_insert
    return manager._insert(
    .../local/lib/python3.12.../db/models/manager.py:87: in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
    .../local/lib/python3.12.../db/models/query.py:1805: in _insert
    return query.get_compiler(using=using).execute_sql(returning_fields)
    .../local/lib/python3.12.../models/sql/compiler.py:1822: in execute_sql
    cursor.execute(sql, params)
    .../local/lib/python3.12.../site-packages/sentry_sdk/utils.py:1730: in runner
    return sentry_patched_function(*args, **kwargs)
    .../local/lib/python3.12.../integrations/django/__init__.py:651: in execute
    result = real_execute(self, sql, params)
    .../local/lib/python3.12.../db/backends/utils.py:67: in execute
    return self._execute_with_wrappers(
    .../local/lib/python3.12.../db/backends/utils.py:80: in _execute_with_wrappers
    return executor(sql, params, many, context)
    .../local/lib/python3.12.../db/backends/utils.py:84: in _execute
    with self.db.wrap_database_errors:
    .../local/lib/python3.12.../django/db/utils.py:91: in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    self = <django.db.backends.utils.CursorWrapper object at 0x7f7c8cb9cb60>
    sql = 'INSERT INTO "reports_dailytestrollups" ("created_at", "updated_at", "test_id", "date", "repoid", "branch", "fail_coun...il") VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s::text[]) RETURNING "reports_dailytestrollups"."id"'
    params = (FakeDatetime(2024, 10, 2, 19, 22, 0, 125055, tzinfo=datetime.timezone.utc), FakeDatetime(2024, 10, 2, 19, 22, 0, 125055, tzinfo=datetime.timezone.utc), '28', FakeDate(2024, 9, 30), 1911, 'main', ...)
    ignored_wrapper_args = (False, {'connection': <DatabaseWrapper vendor='postgresql' alias='default'>, 'cursor': <django.db.backends.utils.CursorWrapper object at 0x7f7c8cb9cb60>})

    def _execute(self, sql, params, *ignored_wrapper_args):
    self.db.validate_no_broken_transaction()
    with self.db.wrap_database_errors:
    if params is None:
    # params default might be backend specific.
    return self.cursor.execute(sql)
    else:
    > return self.cursor.execute(sql, params)
    E django.db.utils.IntegrityError: null value in column "flaky_fail_count" of relation "reports_dailytestrollups_default" violates not-null constraint
    E DETAIL: Failing row contains (13, 2024-10-02 19:22:00.125055+00, 2024-10-02 19:22:00.125055+00, 2024-09-30, 1911, main, 3, 2, 1, 1, 0.6, 2024-09-30 19:22:00.125055+00, {123}, 28, null).

    .../local/lib/python3.12.../db/backends/utils.py:89: IntegrityError
  • Class name: graphql_api.tests.test_test_result.TestResultTestCase
    Test name: test_fetch_test_result_last_duration

    self = <django.db.backends.utils.CursorWrapper object at 0x7f7c8cb3a6c0>
    sql = 'INSERT INTO "reports_dailytestrollups" ("created_at", "updated_at", "test_id", "date", "repoid", "branch", "fail_coun...il") VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s::text[]) RETURNING "reports_dailytestrollups"."id"'
    params = (FakeDatetime(2024, 10, 2, 19, 22, 0, 125055, tzinfo=datetime.timezone.utc), FakeDatetime(2024, 10, 2, 19, 22, 0, 125055, tzinfo=datetime.timezone.utc), '29', FakeDate(2024, 9, 30), 1912, 'main', ...)
    ignored_wrapper_args = (False, {'connection': <DatabaseWrapper vendor='postgresql' alias='default'>, 'cursor': <django.db.backends.utils.CursorWrapper object at 0x7f7c8cb3a6c0>})

    def _execute(self, sql, params, *ignored_wrapper_args):
    self.db.validate_no_broken_transaction()
    with self.db.wrap_database_errors:
    if params is None:
    # params default might be backend specific.
    return self.cursor.execute(sql)
    else:
    > return self.cursor.execute(sql, params)
    E psycopg2.errors.NotNullViolation: null value in column "flaky_fail_count" of relation "reports_dailytestrollups_default" violates not-null constraint
    E DETAIL: Failing row contains (14, 2024-10-02 19:22:00.125055+00, 2024-10-02 19:22:00.125055+00, 2024-09-30, 1912, main, 3, 2, 1, 1, 0.6, 2024-09-30 19:22:00.125055+00, {123}, 29, null).

    .../local/lib/python3.12.../db/backends/utils.py:89: NotNullViolation

    The above exception was the direct cause of the following exception:

    self = <graphql_api.tests.test_test_result.TestResultTestCase testMethod=test_fetch_test_result_last_duration>

    def setUp(self):
    self.owner = OwnerFactory(username="randomOwner")
    self.repository = RepositoryFactory(
    author=self.owner,
    )
    self.test = TestFactory(
    name="Test\x1fName",
    repository=self.repository,
    )

    > _ = DailyTestRollupFactory(
    test=self.test,
    commits_where_fail=["123"],
    date=date.today() - timedelta(days=2),
    avg_duration_seconds=0.6,
    latest_run=datetime.now() - timedelta(days=2),
    )

    graphql_api/tests/test_test_result.py:25:
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    .../local/lib/python3.12............/site-packages/factory/base.py:40: in __call__
    return cls.create(**kwargs)
    .../local/lib/python3.12............/site-packages/factory/base.py:528: in create
    return cls._generate(enums.CREATE_STRATEGY, kwargs)
    .../local/lib/python3.12....../site-packages/factory/django.py:117: in _generate
    return super()._generate(strategy, params)
    .../local/lib/python3.12............/site-packages/factory/base.py:465: in _generate
    return step.build()
    .../local/lib/python3.12.../site-packages/factory/builder.py:262: in build
    instance = self.factory_meta.instantiate(
    .../local/lib/python3.12............/site-packages/factory/base.py:317: in instantiate
    return self.factory._create(model, *args, **kwargs)
    .../local/lib/python3.12....../site-packages/factory/django.py:166: in _create
    return manager.create(*args, **kwargs)
    .../local/lib/python3.12.../db/models/manager.py:87: in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
    .../local/lib/python3.12.../db/models/query.py:658: in create
    obj.save(force_insert=True, using=self.db)
    .../local/lib/python3.12.../db/models/base.py:814: in save
    self.save_base(
    .../local/lib/python3.12.../db/models/base.py:877: in save_base
    updated = self._save_table(
    .../local/lib/python3.12.../db/models/base.py:1020: in _save_table
    results = self._do_insert(
    .../local/lib/python3.12.../db/models/base.py:1061: in _do_insert
    return manager._insert(
    .../local/lib/python3.12.../db/models/manager.py:87: in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
    .../local/lib/python3.12.../db/models/query.py:1805: in _insert
    return query.get_compiler(using=using).execute_sql(returning_fields)
    .../local/lib/python3.12.../models/sql/compiler.py:1822: in execute_sql
    cursor.execute(sql, params)
    .../local/lib/python3.12.../site-packages/sentry_sdk/utils.py:1730: in runner
    return sentry_patched_function(*args, **kwargs)
    .../local/lib/python3.12.../integrations/django/__init__.py:651: in execute
    result = real_execute(self, sql, params)
    .../local/lib/python3.12.../db/backends/utils.py:67: in execute
    return self._execute_with_wrappers(
    .../local/lib/python3.12.../db/backends/utils.py:80: in _execute_with_wrappers
    return executor(sql, params, many, context)
    .../local/lib/python3.12.../db/backends/utils.py:84: in _execute
    with self.db.wrap_database_errors:
    .../local/lib/python3.12.../django/db/utils.py:91: in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    self = <django.db.backends.utils.CursorWrapper object at 0x7f7c8cb3a6c0>
    sql = 'INSERT INTO "reports_dailytestrollups" ("created_at", "updated_at", "test_id", "date", "repoid", "branch", "fail_coun...il") VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s::text[]) RETURNING "reports_dailytestrollups"."id"'
    params = (FakeDatetime(2024, 10, 2, 19, 22, 0, 125055, tzinfo=datetime.timezone.utc), FakeDatetime(2024, 10, 2, 19, 22, 0, 125055, tzinfo=datetime.timezone.utc), '29', FakeDate(2024, 9, 30), 1912, 'main', ...)
    ignored_wrapper_args = (False, {'connection': <DatabaseWrapper vendor='postgresql' alias='default'>, 'cursor': <django.db.backends.utils.CursorWrapper object at 0x7f7c8cb3a6c0>})

    def _execute(self, sql, params, *ignored_wrapper_args):
    self.db.validate_no_broken_transaction()
    with self.db.wrap_database_errors:
    if params is None:
    # params default might be backend specific.
    return self.cursor.execute(sql)
    else:
    > return self.cursor.execute(sql, params)
    E django.db.utils.IntegrityError: null value in column "flaky_fail_count" of relation "reports_dailytestrollups_default" violates not-null constraint
    E DETAIL: Failing row contains (14, 2024-10-02 19:22:00.125055+00, 2024-10-02 19:22:00.125055+00, 2024-09-30, 1912, main, 3, 2, 1, 1, 0.6, 2024-09-30 19:22:00.125055+00, {123}, 29, null).

    .../local/lib/python3.12.../db/backends/utils.py:89: IntegrityError
  • Class name: graphql_api.tests.test_test_result.TestResultTestCase
    Test name: test_fetch_test_result_name

    self = <django.db.backends.utils.CursorWrapper object at 0x7f7c8cbb1220>
    sql = 'INSERT INTO "reports_dailytestrollups" ("created_at", "updated_at", "test_id", "date", "repoid", "branch", "fail_coun...il") VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s::text[]) RETURNING "reports_dailytestrollups"."id"'
    params = (FakeDatetime(2024, 10, 2, 19, 22, 0, 125055, tzinfo=datetime.timezone.utc), FakeDatetime(2024, 10, 2, 19, 22, 0, 125055, tzinfo=datetime.timezone.utc), '30', FakeDate(2024, 9, 30), 1913, 'main', ...)
    ignored_wrapper_args = (False, {'connection': <DatabaseWrapper vendor='postgresql' alias='default'>, 'cursor': <django.db.backends.utils.CursorWrapper object at 0x7f7c8cbb1220>})

    def _execute(self, sql, params, *ignored_wrapper_args):
    self.db.validate_no_broken_transaction()
    with self.db.wrap_database_errors:
    if params is None:
    # params default might be backend specific.
    return self.cursor.execute(sql)
    else:
    > return self.cursor.execute(sql, params)
    E psycopg2.errors.NotNullViolation: null value in column "flaky_fail_count" of relation "reports_dailytestrollups_default" violates not-null constraint
    E DETAIL: Failing row contains (15, 2024-10-02 19:22:00.125055+00, 2024-10-02 19:22:00.125055+00, 2024-09-30, 1913, main, 3, 2, 1, 1, 0.6, 2024-09-30 19:22:00.125055+00, {123}, 30, null).

    .../local/lib/python3.12.../db/backends/utils.py:89: NotNullViolation

    The above exception was the direct cause of the following exception:

    self = <graphql_api.tests.test_test_result.TestResultTestCase testMethod=test_fetch_test_result_name>

    def setUp(self):
    self.owner = OwnerFactory(username="randomOwner")
    self.repository = RepositoryFactory(
    author=self.owner,
    )
    self.test = TestFactory(
    name="Test\x1fName",
    repository=self.repository,
    )

    > _ = DailyTestRollupFactory(
    test=self.test,
    commits_where_fail=["123"],
    date=date.today() - timedelta(days=2),
    avg_duration_seconds=0.6,
    latest_run=datetime.now() - timedelta(days=2),
    )

    graphql_api/tests/test_test_result.py:25:
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    .../local/lib/python3.12............/site-packages/factory/base.py:40: in __call__
    return cls.create(**kwargs)
    .../local/lib/python3.12............/site-packages/factory/base.py:528: in create
    return cls._generate(enums.CREATE_STRATEGY, kwargs)
    .../local/lib/python3.12....../site-packages/factory/django.py:117: in _generate
    return super()._generate(strategy, params)
    .../local/lib/python3.12............/site-packages/factory/base.py:465: in _generate
    return step.build()
    .../local/lib/python3.12.../site-packages/factory/builder.py:262: in build
    instance = self.factory_meta.instantiate(
    .../local/lib/python3.12............/site-packages/factory/base.py:317: in instantiate
    return self.factory._create(model, *args, **kwargs)
    .../local/lib/python3.12....../site-packages/factory/django.py:166: in _create
    return manager.create(*args, **kwargs)
    .../local/lib/python3.12.../db/models/manager.py:87: in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
    .../local/lib/python3.12.../db/models/query.py:658: in create
    obj.save(force_insert=True, using=self.db)
    .../local/lib/python3.12.../db/models/base.py:814: in save
    self.save_base(
    .../local/lib/python3.12.../db/models/base.py:877: in save_base
    updated = self._save_table(
    .../local/lib/python3.12.../db/models/base.py:1020: in _save_table
    results = self._do_insert(
    .../local/lib/python3.12.../db/models/base.py:1061: in _do_insert
    return manager._insert(
    .../local/lib/python3.12.../db/models/manager.py:87: in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
    .../local/lib/python3.12.../db/models/query.py:1805: in _insert
    return query.get_compiler(using=using).execute_sql(returning_fields)
    .../local/lib/python3.12.../models/sql/compiler.py:1822: in execute_sql
    cursor.execute(sql, params)
    .../local/lib/python3.12.../site-packages/sentry_sdk/utils.py:1730: in runner
    return sentry_patched_function(*args, **kwargs)
    .../local/lib/python3.12.../integrations/django/__init__.py:651: in execute
    result = real_execute(self, sql, params)
    .../local/lib/python3.12.../db/backends/utils.py:67: in execute
    return self._execute_with_wrappers(
    .../local/lib/python3.12.../db/backends/utils.py:80: in _execute_with_wrappers
    return executor(sql, params, many, context)
    .../local/lib/python3.12.../db/backends/utils.py:84: in _execute
    with self.db.wrap_database_errors:
    .../local/lib/python3.12.../django/db/utils.py:91: in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    self = <django.db.backends.utils.CursorWrapper object at 0x7f7c8cbb1220>
    sql = 'INSERT INTO "reports_dailytestrollups" ("created_at", "updated_at", "test_id", "date", "repoid", "branch", "fail_coun...il") VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s::text[]) RETURNING "reports_dailytestrollups"."id"'
    params = (FakeDatetime(2024, 10, 2, 19, 22, 0, 125055, tzinfo=datetime.timezone.utc), FakeDatetime(2024, 10, 2, 19, 22, 0, 125055, tzinfo=datetime.timezone.utc), '30', FakeDate(2024, 9, 30), 1913, 'main', ...)
    ignored_wrapper_args = (False, {'connection': <DatabaseWrapper vendor='postgresql' alias='default'>, 'cursor': <django.db.backends.utils.CursorWrapper object at 0x7f7c8cbb1220>})

    def _execute(self, sql, params, *ignored_wrapper_args):
    self.db.validate_no_broken_transaction()
    with self.db.wrap_database_errors:
    if params is None:
    # params default might be backend specific.
    return self.cursor.execute(sql)
    else:
    > return self.cursor.execute(sql, params)
    E django.db.utils.IntegrityError: null value in column "flaky_fail_count" of relation "reports_dailytestrollups_default" violates not-null constraint
    E DETAIL: Failing row contains (15, 2024-10-02 19:22:00.125055+00, 2024-10-02 19:22:00.125055+00, 2024-09-30, 1913, main, 3, 2, 1, 1, 0.6, 2024-09-30 19:22:00.125055+00, {123}, 30, null).

    .../local/lib/python3.12.../db/backends/utils.py:89: IntegrityError
  • Class name: graphql_api.tests.test_test_result.TestResultTestCase
    Test name: test_fetch_test_result_updated_at

    self = <django.db.backends.utils.CursorWrapper object at 0x7f7c8cbe4a10>
    sql = 'INSERT INTO "reports_dailytestrollups" ("created_at", "updated_at", "test_id", "date", "repoid", "branch", "fail_coun...il") VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s::text[]) RETURNING "reports_dailytestrollups"."id"'
    params = (FakeDatetime(2024, 10, 2, 19, 22, 0, 125055, tzinfo=datetime.timezone.utc), FakeDatetime(2024, 10, 2, 19, 22, 0, 125055, tzinfo=datetime.timezone.utc), '31', FakeDate(2024, 9, 30), 1914, 'main', ...)
    ignored_wrapper_args = (False, {'connection': <DatabaseWrapper vendor='postgresql' alias='default'>, 'cursor': <django.db.backends.utils.CursorWrapper object at 0x7f7c8cbe4a10>})

    def _execute(self, sql, params, *ignored_wrapper_args):
    self.db.validate_no_broken_transaction()
    with self.db.wrap_database_errors:
    if params is None:
    # params default might be backend specific.
    return self.cursor.execute(sql)
    else:
    > return self.cursor.execute(sql, params)
    E psycopg2.errors.NotNullViolation: null value in column "flaky_fail_count" of relation "reports_dailytestrollups_default" violates not-null constraint
    E DETAIL: Failing row contains (16, 2024-10-02 19:22:00.125055+00, 2024-10-02 19:22:00.125055+00, 2024-09-30, 1914, main, 3, 2, 1, 1, 0.6, 2024-09-30 19:22:00.125055+00, {123}, 31, null).

    .../local/lib/python3.12.../db/backends/utils.py:89: NotNullViolation

    The above exception was the direct cause of the following exception:

    self = <graphql_api.tests.test_test_result.TestResultTestCase testMethod=test_fetch_test_result_updated_at>

    def setUp(self):
    self.owner = OwnerFactory(username="randomOwner")
    self.repository = RepositoryFactory(
    author=self.owner,
    )
    self.test = TestFactory(
    name="Test\x1fName",
    repository=self.repository,
    )

    > _ = DailyTestRollupFactory(
    test=self.test,
    commits_where_fail=["123"],
    date=date.today() - timedelta(days=2),
    avg_duration_seconds=0.6,
    latest_run=datetime.now() - timedelta(days=2),
    )

    graphql_api/tests/test_test_result.py:25:
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    .../local/lib/python3.12............/site-packages/factory/base.py:40: in __call__
    return cls.create(**kwargs)
    .../local/lib/python3.12............/site-packages/factory/base.py:528: in create
    return cls._generate(enums.CREATE_STRATEGY, kwargs)
    .../local/lib/python3.12....../site-packages/factory/django.py:117: in _generate
    return super()._generate(strategy, params)
    .../local/lib/python3.12............/site-packages/factory/base.py:465: in _generate
    return step.build()
    .../local/lib/python3.12.../site-packages/factory/builder.py:262: in build
    instance = self.factory_meta.instantiate(
    .../local/lib/python3.12............/site-packages/factory/base.py:317: in instantiate
    return self.factory._create(model, *args, **kwargs)
    .../local/lib/python3.12....../site-packages/factory/django.py:166: in _create
    return manager.create(*args, **kwargs)
    .../local/lib/python3.12.../db/models/manager.py:87: in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
    .../local/lib/python3.12.../db/models/query.py:658: in create
    obj.save(force_insert=True, using=self.db)
    .../local/lib/python3.12.../db/models/base.py:814: in save
    self.save_base(
    .../local/lib/python3.12.../db/models/base.py:877: in save_base
    updated = self._save_table(
    .../local/lib/python3.12.../db/models/base.py:1020: in _save_table
    results = self._do_insert(
    .../local/lib/python3.12.../db/models/base.py:1061: in _do_insert
    return manager._insert(
    .../local/lib/python3.12.../db/models/manager.py:87: in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
    .../local/lib/python3.12.../db/models/query.py:1805: in _insert
    return query.get_compiler(using=using).execute_sql(returning_fields)
    .../local/lib/python3.12.../models/sql/compiler.py:1822: in execute_sql
    cursor.execute(sql, params)
    .../local/lib/python3.12.../site-packages/sentry_sdk/utils.py:1730: in runner
    return sentry_patched_function(*args, **kwargs)
    .../local/lib/python3.12.../integrations/django/__init__.py:651: in execute
    result = real_execute(self, sql, params)
    .../local/lib/python3.12.../db/backends/utils.py:67: in execute
    return self._execute_with_wrappers(
    .../local/lib/python3.12.../db/backends/utils.py:80: in _execute_with_wrappers
    return executor(sql, params, many, context)
    .../local/lib/python3.12.../db/backends/utils.py:84: in _execute
    with self.db.wrap_database_errors:
    .../local/lib/python3.12.../django/db/utils.py:91: in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    self = <django.db.backends.utils.CursorWrapper object at 0x7f7c8cbe4a10>
    sql = 'INSERT INTO "reports_dailytestrollups" ("created_at", "updated_at", "test_id", "date", "repoid", "branch", "fail_coun...il") VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s::text[]) RETURNING "reports_dailytestrollups"."id"'
    params = (FakeDatetime(2024, 10, 2, 19, 22, 0, 125055, tzinfo=datetime.timezone.utc), FakeDatetime(2024, 10, 2, 19, 22, 0, 125055, tzinfo=datetime.timezone.utc), '31', FakeDate(2024, 9, 30), 1914, 'main', ...)
    ignored_wrapper_args = (False, {'connection': <DatabaseWrapper vendor='postgresql' alias='default'>, 'cursor': <django.db.backends.utils.CursorWrapper object at 0x7f7c8cbe4a10>})

    def _execute(self, sql, params, *ignored_wrapper_args):
    self.db.validate_no_broken_transaction()
    with self.db.wrap_database_errors:
    if params is None:
    # params default might be backend specific.
    return self.cursor.execute(sql)
    else:
    > return self.cursor.execute(sql, params)
    E django.db.utils.IntegrityError: null value in column "flaky_fail_count" of relation "reports_dailytestrollups_default" violates not-null constraint
    E DETAIL: Failing row contains (16, 2024-10-02 19:22:00.125055+00, 2024-10-02 19:22:00.125055+00, 2024-09-30, 1914, main, 3, 2, 1, 1, 0.6, 2024-09-30 19:22:00.125055+00, {123}, 31, null).

    .../local/lib/python3.12.../db/backends/utils.py:89: IntegrityError

@joseph-sentry joseph-sentry added this pull request to the merge queue Oct 2, 2024
Merged via the queue into main with commit a80f519 Oct 2, 2024
18 of 19 checks passed
@joseph-sentry joseph-sentry deleted the joseph/improve-aggregate branch October 2, 2024 20:31
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