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

ci/test: speed_eval #232

Merged
merged 4 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/ci-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,10 @@ jobs:
- name: Unit tests (DB)
if: matrix.backend == 'db'
run: pytest -m "mongo"
- name: Speed eval
run: python tests/speed_eval.py

- name: "Upload coverage to Codecov"
- name: Upload coverage to Codecov
continue-on-error: true
uses: codecov/codecov-action@v4
with:
Expand Down
3 changes: 2 additions & 1 deletion tests/test_defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
import cachier
import pytest

from tests.test_mongo_core import MONGO_DELTA, _test_mongetter
from tests.test_mongo_core import _test_mongetter

MONGO_DELTA = datetime.timedelta(seconds=3)
_default_params = cachier.get_default_params().copy()


Expand Down
4 changes: 3 additions & 1 deletion tests/test_general.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Non-core-specific tests for cachier."""

import datetime
import functools
import os
import queue
Expand All @@ -20,10 +21,11 @@
)

from tests.test_mongo_core import (
MONGO_DELTA_LONG,
_test_mongetter,
)

MONGO_DELTA_LONG = datetime.timedelta(seconds=10)


def test_information():
print("\ncachier version: ", end="")
Expand Down
9 changes: 3 additions & 6 deletions tests/test_mongo_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import queue
import sys
import threading
from datetime import timedelta
from random import random
from time import sleep
from urllib.parse import quote_plus
Expand Down Expand Up @@ -146,16 +145,14 @@ def _test_mongo_caching(arg_1, arg_2):
assert val6 == val5


MONGO_DELTA = timedelta(seconds=3)
MONGO_DELTA_LONG = timedelta(seconds=10)


@pytest.mark.mongo()
def test_mongo_stale_after():
"""Testing MongoDB core stale_after functionality."""

@cachier(
mongetter=_test_mongetter, stale_after=MONGO_DELTA, next_time=False
mongetter=_test_mongetter,
stale_after=datetime.timedelta(seconds=3),
next_time=False,
)
def _stale_after_mongo(arg_1, arg_2):
"""Some function."""
Expand Down
Loading