stats/tests.py::TestStats::test_store_daily_stats

First seen 1 year, 7 months ago in commit 1cd3a pushed by Anže Pečar

Last 100 Runs
Pass % 100.0%
p50 duration 0.0911s
p95 duration 0.0991s

28 runs 28 passed in the last 30 days

Run 1 year, 3 months ago
Status PASS
Commit

Add watchman and bump dependencies

Commit d373d pushed by Anže Pečar
Run 1 year, 3 months ago
Status PASS
Commit

Mention contributiors

Commit 7ae67 pushed by Anže Pečar
Run 1 year, 3 months ago
Status PASS
Commit

Add a bit of a background to image when they don't load

Commit 36659 pushed by Anže Pečar
Run 1 year, 3 months ago
Status PASS
Commit

Merge pull request #25 from anze3db/masonry-layout

Commit 1fbde pushed by Anže Pečar
Run 1 year, 3 months ago
Status PASS
Commit

Clarify README about initial database load #26

Commit e705b pushed by Anže Pečar
Run 1 year, 3 months ago
Status PASS
Commit

Add migrations for Julia

Commit 05692 pushed by Anže Pečar
Run 1 year, 3 months ago
Status PASS
Commit

Merge 249b120eb9eff71db090b258532030f3d6a067ca into 967f85d97cc04b32e4031bf74e7ba8334c2e070f

Commit 5679e pushed by Anže Pečar
Run 1 year, 3 months ago
Status PASS
Commit

Merge 606453d4b7d102c11a22b152a154c230a6d559af into 967f85d97cc04b32e4031bf74e7ba8334c2e070f

Commit 3bdbf pushed by Anže Pečar
Run 1 year, 3 months ago
Status PASS
Commit

Merge c25a95fcbd7084438c6b3fae22f3d5a54ff59b89 into 967f85d97cc04b32e4031bf74e7ba8334c2e070f

Commit 83608 pushed by Anže Pečar
Run 1 year, 3 months ago
Status PASS
Commit

Merge pull request #23 from levlaz/patch-1

Commit 967f8 pushed by Anže Pečar
Run 1 year, 3 months ago
Status PASS
Commit

Index discuss.systems

Commit 43e9e pushed by Anže Pečar
Run 1 year, 3 months ago
Status PASS
Commit

Don't index account that haven't posted in a while

Commit 9a7e5 pushed by Anže Pečar
Run 1 year, 3 months ago
Status PASS
Commit

Add typescript and kubernetes stats columns

Commit 25782 pushed by Anže Pečar
Run 1 year, 3 months ago
Status FAIL
Commit

Add kubernetes

Commit dc0a9 pushed by Anže Pečar
Repr
self = <QuerySet []>
defaults = {'angular_accounts': 0, 'angular_posts': 0, 'bootstrap_accounts': 0, 'bootstrap_posts': 0, ...}
kwargs = {'date': datetime.datetime(2024, 3, 22, 0, 0, tzinfo=datetime.timezone.utc)}

    def get_or_create(self, defaults=None, **kwargs):
        """
        Look up an object with the given kwargs, creating one if necessary.
        Return a tuple of (object, created), where created is a boolean
        specifying whether an object was created.
        """
        # The get() needs to be targeted at the write database in order
        # to avoid potential transaction consistency problems.
        self._for_write = True
        try:
>           return self.get(**kwargs), False

/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/django/db/models/query.py:948: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <QuerySet []>, args = ()
kwargs = {'date': datetime.datetime(2024, 3, 22, 0, 0, tzinfo=datetime.timezone.utc)}
clone = <QuerySet []>, limit = 21, num = 0

    def get(self, *args, **kwargs):
        """
        Perform the query and return a single object matching the given
        keyword arguments.
        """
        if self.query.combinator and (args or kwargs):
            raise NotSupportedError(
                "Calling QuerySet.get(...) with filters after %s() is not "
                "supported." % self.query.combinator
            )
        clone = self._chain() if self.query.combinator else self.filter(*args, **kwargs)
        if self.query.can_filter() and not self.query.distinct_fields:
            clone = clone.order_by()
        limit = None
        if (
            not clone.query.select_for_update
            or connections[clone.db].features.supports_select_for_update_with_limit
        ):
            limit = MAX_GET_RESULTS
            clone.query.set_limits(high=limit)
        num = len(clone)
        if num == 1:
            return clone._result_cache[0]
        if not num:
>           raise self.model.DoesNotExist(
                "%s matching query does not exist." % self.model._meta.object_name
            )
E           stats.models.Daily.DoesNotExist: Daily matching query does not exist.

/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/django/db/models/query.py:649: DoesNotExist

During handling of the above exception, another exception occurred:

self = <stats.tests.TestStats testMethod=test_store_daily_stats>

    def test_store_daily_stats(self):
>       store_daily_stats()

stats/tests.py:21: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
stats/models.py:25: in store_daily_stats
    Daily.objects.update_or_create(date=today, defaults=account_defaults | post_defaults)
/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/django/db/models/manager.py:87: in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/django/db/models/query.py:986: in update_or_create
    obj, created = self.select_for_update().get_or_create(
/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/django/db/models/query.py:950: in get_or_create
    params = self._extract_model_params(defaults, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <QuerySet []>
defaults = {'angular_accounts': 0, 'angular_posts': 0, 'bootstrap_accounts': 0, 'bootstrap_posts': 0, ...}
kwargs = {'date': datetime.datetime(2024, 3, 22, 0, 0, tzinfo=datetime.timezone.utc)}
params = {'angular_accounts': 0, 'angular_posts': 0, 'bootstrap_accounts': 0, 'bootstrap_posts': 0, ...}
property_names = frozenset({'pk'})
invalid_params = ['typescript_accounts', 'kubernetes_accounts', 'typescript_posts', 'kubernetes_posts']
param = 'total_posts'

    def _extract_model_params(self, defaults, **kwargs):
        """
        Prepare `params` for creating a model instance based on the given
        kwargs; for use by get_or_create().
        """
        defaults = defaults or {}
        params = {k: v for k, v in kwargs.items() if LOOKUP_SEP not in k}
        params.update(defaults)
        property_names = self.model._meta._property_names
        invalid_params = []
        for param in params:
            try:
                self.model._meta.get_field(param)
            except exceptions.FieldDoesNotExist:
                # It's okay to use a model's property if it has a setter.
                if not (param in property_names and getattr(self.model, param).fset):
                    invalid_params.append(param)
        if invalid_params:
>           raise exceptions.FieldError(
                "Invalid field name(s) for model %s: '%s'."
                % (
                    self.model._meta.object_name,
                    "', '".join(sorted(invalid_params)),
                )
            )
E           django.core.exceptions.FieldError: Invalid field name(s) for model Daily: 'kubernetes_accounts', 'kubernetes_posts', 'typescript_accounts', 'typescript_posts'.

/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/django/db/models/query.py:1039: FieldError
Run 1 year, 3 months ago
Status PASS
Commit

Add puet instance

Commit b2bb7 pushed by Anže Pečar
Run 1 year, 3 months ago
Status PASS
Commit

Fix sentry issue

Commit 19536 pushed by Anže Pečar
Run 1 year, 3 months ago
Status PASS
Commit

Fix case where display_name is not set

Commit fc792 pushed by Anže Pečar
Run 1 year, 3 months ago
Status PASS
Commit

Merge pull request #19 from anze3db/pre-commit-ci-update-config

Commit 215e3 pushed by Anže Pečar
Run 1 year, 3 months ago
Status PASS
Commit

Merge pull request #20 from anze3db/setup_pip_install

Commit cf326 pushed by Anže Pečar
Run 1 year, 3 months ago
Status PASS
Commit

Merge 954e76dc7f40772ff1769878eb87d84814719f3c into 22dbcd4ee6eba670f3b9717d72100798f1bab5e1

Commit 4ac21 pushed by Gašper Martič
Run 1 year, 3 months ago
Status PASS
Commit

Merge e00b6da96e75287c580cef1a212fc29410d5392f into 22dbcd4ee6eba670f3b9717d72100798f1bab5e1

Commit 93288 pushed by pre-commit-ci[bot]
Run 1 year, 3 months ago
Status PASS
Commit

Add instructions for dev env

Commit 22dbc pushed by Anže Pečar
Run 1 year, 3 months ago
Status PASS
Commit

Merge pull request #15 from anze3db/pre-commit-ci-update-config

Commit 6561b pushed by Anže Pečar
Run 1 year, 3 months ago
Status PASS
Commit

Merge 300f5da759c271084daa8005ced3342b487e564f into 8e2605c36f42cef43e1ae6d69c5bcc77aea848c0

Commit 84328 pushed by pre-commit-ci[bot]
Run 1 year, 3 months ago
Status PASS
Commit

Merge 41f3e88687737313c442a06fd0b50683c272ad18 into 8e2605c36f42cef43e1ae6d69c5bcc77aea848c0

Commit 707c5 pushed by pre-commit-ci[bot]