Skip to content

Commit

Permalink
ci/test: speed_eval (#232)
Browse files Browse the repository at this point in the history
  • Loading branch information
Borda authored Sep 19, 2024
1 parent 91a53da commit 074e5ab
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
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

0 comments on commit 074e5ab

Please sign in to comment.