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

add leaderboards v1 #761

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

add leaderboards v1 #761

wants to merge 4 commits into from

Conversation

JerrySentry
Copy link
Contributor

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. In 2022 this entity acquired Codecov and as result Sentry is going to need some rights from me in order to utilize my contributions in this PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

@codecov-notifications
Copy link

codecov-notifications bot commented Aug 19, 2024

Codecov Report

Attention: Patch coverage is 59.84252% with 51 lines in your changes missing coverage. Please review.

✅ All tests successful. No failed tests found.

Files Patch % Lines
graphql_api/types/gamification/gamification.py 54.00% 46 Missing ⚠️
graphql_api/types/owner/owner.py 55.55% 4 Missing ⚠️
graphql_api/types/repository/repository.py 83.33% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copy link

codecov bot commented Aug 19, 2024

Codecov Report

Attention: Patch coverage is 59.84252% with 51 lines in your changes missing coverage. Please review.

Project coverage is 95.91%. Comparing base (9aa6458) to head (6c00947).

✅ All tests successful. No failed tests found.

Files Patch % Lines
graphql_api/types/gamification/gamification.py 54.00% 46 Missing ⚠️
graphql_api/types/owner/owner.py 55.55% 4 Missing ⚠️
graphql_api/types/repository/repository.py 83.33% 1 Missing ⚠️
Additional details and impacted files
@@               Coverage Diff                @@
##               main       #761        +/-   ##
================================================
- Coverage   96.16000   95.91000   -0.25000     
================================================
  Files           814        816         +2     
  Lines         18423      18549       +126     
================================================
+ Hits          17716      17791        +75     
- Misses          707        758        +51     
Flag Coverage Δ
unit 91.67% <59.84%> (-0.24%) ⬇️
unit-latest-uploader 91.67% <59.84%> (-0.24%) ⬇️

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

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

Copy link

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

❌ Failed Test Results:

Completed 2258 tests with 1 failed, 2251 passed and 6 skipped.

View the full list of failed tests

pytest

  • 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 0x7f3d8464ec00>
    sql = 'INSERT INTO "reports_test" ("id", "external_id", "created_at", "updated_at", "repoid", "name", "testsuite", "flags_hash", "failure_rate", "commits_where_fail") VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s::text[])'
    params = ('budget', UUID('935d0449-fa44-491b-8549-2bab95d28da7'), datetime.datetime(2024, 8, 20, 14, 38, 16, 543903, tzinfo=datetime.timezone.utc), datetime.datetime(2024, 8, 20, 14, 38, 16, 543909, tzinfo=datetime.timezone.utc), 1803, 'mouth', ...)
    ignored_wrapper_args = (False, {'connection': <DatabaseWrapper vendor='postgresql' alias='default'>, 'cursor': <django.db.backends.utils.CursorWrapper object at 0x7f3d8464ec00>})

    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.UniqueViolation: duplicate key value violates unique constraint "reports_test_repoid_name_testsuite_flags_hash"
    E DETAIL: Key (repoid, name, testsuite, flags_hash)=(1803, mouth, , ) already exists.

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

    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)
    _test_instance_1 = TestInstanceFactory(
    test=test,
    created_at=datetime.datetime.now(),
    repoid=repo.repoid,
    outcome="pass",
    )
    _test_instance_2 = TestInstanceFactory(
    test=test,
    created_at=datetime.datetime.now(),
    repoid=repo.repoid,
    outcome="failure",
    )
    > test_2 = TestFactory(repository=repo)

    graphql_api/tests/test_repository.py:1072:
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    .../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.../integrations/django/__init__.py:641: 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 0x7f3d8464ec00>
    sql = 'INSERT INTO "reports_test" ("id", "external_id", "created_at", "updated_at", "repoid", "name", "testsuite", "flags_hash", "failure_rate", "commits_where_fail") VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s::text[])'
    params = ('budget', UUID('935d0449-fa44-491b-8549-2bab95d28da7'), datetime.datetime(2024, 8, 20, 14, 38, 16, 543903, tzinfo=datetime.timezone.utc), datetime.datetime(2024, 8, 20, 14, 38, 16, 543909, tzinfo=datetime.timezone.utc), 1803, 'mouth', ...)
    ignored_wrapper_args = (False, {'connection': <DatabaseWrapper vendor='postgresql' alias='default'>, 'cursor': <django.db.backends.utils.CursorWrapper object at 0x7f3d8464ec00>})

    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: duplicate key value violates unique constraint "reports_test_repoid_name_testsuite_flags_hash"
    E DETAIL: Key (repoid, name, testsuite, flags_hash)=(1803, mouth, , ) already exists.

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

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