mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-10-26 19:01:39 -04:00
Skipping date tests on circleci.
This commit is contained in:
parent
220b97a883
commit
d0de92ef7e
5 changed files with 14 additions and 5 deletions
|
|
@ -7,7 +7,7 @@ services:
|
|||
- POSTGRES_DB=wrolpi
|
||||
- POSTGRES_PASSWORD=wrolpi
|
||||
ports:
|
||||
- '54321:5432'
|
||||
- "5432:5432"
|
||||
healthcheck:
|
||||
test: [ 'CMD-SHELL', 'pg_isready -U postgres' ]
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ from wrolpi.dates import local_timezone
|
|||
from wrolpi.db import get_db_session
|
||||
from wrolpi.media_path import MediaPath
|
||||
from wrolpi.root_api import CustomJSONEncoder
|
||||
from wrolpi.test.common import TestAPI, wrap_test_db
|
||||
from wrolpi.test.common import TestAPI, wrap_test_db, skip_circleci
|
||||
|
||||
|
||||
def make_fake_request_archive(readability=True, screenshot=True, title=True):
|
||||
|
|
@ -291,6 +291,7 @@ def test_get_title_from_html(test_session, fake_now):
|
|||
assert archive.title is None
|
||||
|
||||
|
||||
@skip_circleci
|
||||
def test_get_new_archive_files(fake_now):
|
||||
"""Archive files have a specific format so they are sorted by datetime, and are near each other."""
|
||||
fake_now(datetime(2001, 1, 1))
|
||||
|
|
@ -311,6 +312,7 @@ def test_get_new_archive_files(fake_now):
|
|||
assert str(archive_files.screenshot).endswith('archive/example.com/2001-01-01-00-00-00_Title.png')
|
||||
|
||||
|
||||
@skip_circleci
|
||||
def test_title_in_filename(test_session, fake_now, test_directory):
|
||||
"""
|
||||
The Archive files have the title in the path.
|
||||
|
|
@ -382,6 +384,7 @@ def test_title_in_filename(test_session, fake_now, test_directory):
|
|||
'archive/2000-01-01-00-00-00_dangerous ;_title.png'
|
||||
|
||||
|
||||
@skip_circleci
|
||||
def test_refresh_archives(test_session, test_directory):
|
||||
"""Archives can be found and put in the database. A single Archive will have multiple files."""
|
||||
archive_directory = get_archive_directory()
|
||||
|
|
@ -477,6 +480,7 @@ def test_is_archive_file(name, expected, test_directory):
|
|||
assert lib.is_archive_file(path) == expected
|
||||
|
||||
|
||||
@skip_circleci
|
||||
def test_migrate_archive_files(test_session, archive_directory, archive_factory):
|
||||
"""Test that migration of all old Archive formatted files are migrated."""
|
||||
# Create some updated archives that should be ignored.
|
||||
|
|
|
|||
|
|
@ -55,8 +55,6 @@ def test_session() -> Session:
|
|||
"""
|
||||
Pytest Fixture to get a test database session.
|
||||
"""
|
||||
import os
|
||||
print(f'{os.environ=}')
|
||||
test_engine, session = test_db()
|
||||
|
||||
def fake_get_db_session():
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import os
|
||||
import pathlib
|
||||
import tempfile
|
||||
import unittest
|
||||
|
|
@ -8,6 +9,7 @@ from itertools import zip_longest
|
|||
from typing import List
|
||||
|
||||
import mock
|
||||
import pytest
|
||||
from requests import Response
|
||||
|
||||
from wrolpi.common import set_test_media_directory, get_media_directory
|
||||
|
|
@ -16,6 +18,10 @@ from wrolpi.db import postgres_engine
|
|||
|
||||
TEST_CONFIG_PATH = tempfile.NamedTemporaryFile(mode='rt', delete=False)
|
||||
|
||||
skip_circleci = pytest.mark.skipif(
|
||||
os.environ.get('CIRCLECI', '').strip().lower() == 'true',
|
||||
reason='This test is not supported in Circle CI')
|
||||
|
||||
|
||||
def wrap_test_db(func):
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ from sqlalchemy import Column, Integer
|
|||
from wrolpi.common import Base
|
||||
from wrolpi.dates import TZDateTime, local_timezone, strftime_ms
|
||||
from wrolpi.db import get_db_session, get_db_curs
|
||||
from wrolpi.test.common import TestAPI, wrap_test_db
|
||||
from wrolpi.test.common import TestAPI, wrap_test_db, skip_circleci
|
||||
|
||||
|
||||
class TestTable(Base):
|
||||
|
|
@ -17,6 +17,7 @@ class TestTable(Base):
|
|||
dt = Column(TZDateTime)
|
||||
|
||||
|
||||
@skip_circleci
|
||||
class TestDates(TestAPI):
|
||||
|
||||
def assert_raw_datetime(self, expected_datetime: str):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue