mirror of
https://github.com/deepset-ai/haystack.git
synced 2026-01-07 12:37:27 +00:00
[CI refactoring] Categorize tests into folders (#2554)
* Categorize tests into folders * Fix linux_ci.yml and an import * Wrong path
This commit is contained in:
parent
81223f8cd1
commit
ff4303c51b
4
.github/workflows/linux_ci.yml
vendored
4
.github/workflows/linux_ci.yml
vendored
@ -357,7 +357,7 @@ jobs:
|
||||
- name: Run Milvus1 tests
|
||||
run: |
|
||||
export MILVUS1_ENABLED=1
|
||||
pytest -s test/test_document_store.py test/test_eval.py test/test_faiss_and_milvus.py test/test_pipeline.py test/test_retriever.py test/test_standard_pipelines.py --document_store_type="milvus1"
|
||||
pytest -s test/document_stores/test_document_store.py test/pipelines/test_eval.py test/document_stores/test_faiss_and_milvus.py test/pipelines/test_pipeline.py test/nodes/test_retriever.py test/pipelines/test_standard_pipelines.py --document_store_type="milvus1"
|
||||
|
||||
test-pinecone:
|
||||
needs: build-cache
|
||||
@ -404,4 +404,4 @@ jobs:
|
||||
PINECONE_API_KEY: ${{ secrets.PINECONE_API_KEY }}
|
||||
if: steps.pinecone-files.outputs.any_changed == 'true'
|
||||
run: |
|
||||
pytest -s test/test_document_store.py test/test_pipeline.py test/test_standard_pipelines.py test/test_pipeline_extractive_qa.py --document_store_type="pinecone"
|
||||
pytest -s test/document_stores/test_document_store.py test/pipelines/test_pipeline.py test/pipelines/test_standard_pipelines.py test/pipelines/test_pipeline_extractive_qa.py --document_store_type="pinecone"
|
||||
|
||||
0
test/document_stores/__init__.py
Normal file
0
test/document_stores/__init__.py
Normal file
@ -12,7 +12,7 @@ from unittest.mock import Mock
|
||||
from elasticsearch import Elasticsearch
|
||||
from elasticsearch.exceptions import RequestError
|
||||
|
||||
from .conftest import (
|
||||
from ..conftest import (
|
||||
deepset_cloud_fixture,
|
||||
get_document_store,
|
||||
MOCK_DC,
|
||||
@ -16,7 +16,7 @@ from haystack.document_stores.faiss import FAISSDocumentStore
|
||||
from haystack.pipelines import Pipeline
|
||||
from haystack.nodes.retriever.dense import EmbeddingRetriever
|
||||
|
||||
from .conftest import document_classifier, ensure_ids_are_correct_uuids, SAMPLES_PATH, MockDenseRetriever
|
||||
from ..conftest import document_classifier, ensure_ids_are_correct_uuids, SAMPLES_PATH, MockDenseRetriever
|
||||
|
||||
|
||||
DOCUMENTS = [
|
||||
@ -1,7 +1,7 @@
|
||||
import numpy as np
|
||||
import pytest
|
||||
from haystack.schema import Document
|
||||
from .conftest import get_document_store
|
||||
from ..conftest import get_document_store
|
||||
import uuid
|
||||
|
||||
embedding_dim = 768
|
||||
0
test/modeling/__init__.py
Normal file
0
test/modeling/__init__.py
Normal file
@ -3,7 +3,7 @@ from haystack.nodes import FARMReader
|
||||
from haystack.modeling.data_handler.processor import UnlabeledTextProcessor
|
||||
import torch
|
||||
|
||||
from .conftest import SAMPLES_PATH
|
||||
from ..conftest import SAMPLES_PATH
|
||||
|
||||
|
||||
def create_checkpoint(model):
|
||||
@ -6,7 +6,7 @@ from transformers import AutoTokenizer
|
||||
from haystack.modeling.data_handler.processor import SquadProcessor
|
||||
from haystack.modeling.model.tokenization import Tokenizer
|
||||
|
||||
from .conftest import SAMPLES_PATH
|
||||
from ..conftest import SAMPLES_PATH
|
||||
|
||||
|
||||
# during inference (parameter return_baskets = False) we do not convert labels
|
||||
@ -6,7 +6,7 @@ from haystack.modeling.model.tokenization import Tokenizer
|
||||
from haystack.modeling.utils import set_all_seeds
|
||||
import torch
|
||||
|
||||
from .conftest import SAMPLES_PATH
|
||||
from ..conftest import SAMPLES_PATH
|
||||
|
||||
|
||||
def test_processor_saving_loading(tmp_path, caplog):
|
||||
0
test/nodes/__init__.py
Normal file
0
test/nodes/__init__.py
Normal file
@ -13,7 +13,7 @@ from haystack.nodes import (
|
||||
ParsrConverter,
|
||||
)
|
||||
|
||||
from .conftest import SAMPLES_PATH
|
||||
from ..conftest import SAMPLES_PATH
|
||||
|
||||
|
||||
@pytest.mark.tika
|
||||
@ -6,7 +6,7 @@ import pytest
|
||||
import haystack
|
||||
from haystack.nodes.file_classifier.file_type import FileTypeClassifier, DEFAULT_TYPES
|
||||
|
||||
from .conftest import SAMPLES_PATH
|
||||
from ..conftest import SAMPLES_PATH
|
||||
|
||||
|
||||
def test_filetype_classifier_single_file(tmp_path):
|
||||
@ -9,7 +9,7 @@ from haystack.nodes.answer_generator import Seq2SeqGenerator
|
||||
from haystack.pipelines import TranslationWrapperPipeline, GenerativeQAPipeline
|
||||
|
||||
|
||||
from .conftest import DOCS_WITH_EMBEDDINGS
|
||||
from ..conftest import DOCS_WITH_EMBEDDINGS
|
||||
|
||||
|
||||
# Keeping few (retriever,document_store) combination to reduce test time
|
||||
@ -4,7 +4,7 @@ from haystack import Document
|
||||
from haystack.nodes.file_converter.pdf import PDFToTextConverter
|
||||
from haystack.nodes.preprocessor.preprocessor import PreProcessor
|
||||
|
||||
from .conftest import SAMPLES_PATH
|
||||
from ..conftest import SAMPLES_PATH
|
||||
|
||||
TEXT = """
|
||||
This is a sample sentence in paragraph_1. This is a sample sentence in paragraph_1. This is a sample sentence in
|
||||
@ -17,7 +17,7 @@ from haystack.nodes.retriever.dense import DensePassageRetriever, EmbeddingRetri
|
||||
from haystack.nodes.retriever.sparse import BM25Retriever, FilterRetriever, TfidfRetriever
|
||||
from transformers import DPRContextEncoderTokenizerFast, DPRQuestionEncoderTokenizerFast
|
||||
|
||||
from .conftest import SAMPLES_PATH
|
||||
from ..conftest import SAMPLES_PATH
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
0
test/others/__init__.py
Normal file
0
test/others/__init__.py
Normal file
@ -9,7 +9,7 @@ from haystack.utils.augment_squad import augment_squad
|
||||
from haystack.utils.squad_data import SquadData
|
||||
from haystack.utils.context_matching import calculate_context_similarity, match_context, match_contexts
|
||||
|
||||
from .conftest import SAMPLES_PATH
|
||||
from ..conftest import SAMPLES_PATH
|
||||
|
||||
TEST_CONTEXT = context = """Der Merkantilismus förderte Handel und Verkehr mit teils marktkonformen, teils dirigistischen Maßnahmen.
|
||||
An der Schwelle zum 19. Jahrhundert entstand ein neuer Typus des Nationalstaats, der die Säkularisation durchsetzte,
|
||||
0
test/pipelines/__init__.py
Normal file
0
test/pipelines/__init__.py
Normal file
@ -19,7 +19,7 @@ from haystack.pipelines.standard_pipelines import (
|
||||
from haystack.nodes.translator.transformers import TransformersTranslator
|
||||
from haystack.schema import Answer, Document, EvaluationResult, Label, MultiLabel, Span
|
||||
|
||||
from .conftest import SAMPLES_PATH
|
||||
from ..conftest import SAMPLES_PATH
|
||||
|
||||
|
||||
@pytest.mark.skipif(sys.platform in ["win32", "cygwin"], reason="Causes OOM on windows github runner")
|
||||
@ -28,7 +28,7 @@ from haystack import Document, Answer
|
||||
from haystack.nodes.other.route_documents import RouteDocuments
|
||||
from haystack.nodes.other.join_answers import JoinAnswers
|
||||
|
||||
from .conftest import (
|
||||
from ..conftest import (
|
||||
MOCK_DC,
|
||||
DC_API_ENDPOINT,
|
||||
DC_API_KEY,
|
||||
@ -6,7 +6,7 @@ import pytest
|
||||
from haystack.pipelines import Pipeline, RootNode
|
||||
from haystack.nodes import FARMReader, BM25Retriever
|
||||
|
||||
from .conftest import SAMPLES_PATH, MockRetriever as BaseMockRetriever, MockReader
|
||||
from ..conftest import SAMPLES_PATH, MockRetriever as BaseMockRetriever, MockReader
|
||||
|
||||
|
||||
class MockRetriever(BaseMockRetriever):
|
||||
@ -16,8 +16,8 @@ from haystack.nodes import FileTypeClassifier
|
||||
from haystack.errors import HaystackError, PipelineConfigError, PipelineSchemaError
|
||||
from haystack.nodes.base import BaseComponent
|
||||
|
||||
from .conftest import SAMPLES_PATH, MockNode, MockDocumentStore, MockReader, MockRetriever
|
||||
from . import conftest
|
||||
from ..conftest import SAMPLES_PATH, MockNode, MockDocumentStore, MockReader, MockRetriever
|
||||
from .. import conftest
|
||||
|
||||
|
||||
#
|
||||
@ -5,7 +5,7 @@ import ray
|
||||
|
||||
from haystack.pipelines import RayPipeline
|
||||
|
||||
from .conftest import SAMPLES_PATH
|
||||
from ..conftest import SAMPLES_PATH
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
@ -18,7 +18,7 @@ from haystack.nodes import (
|
||||
)
|
||||
from haystack.schema import Document
|
||||
|
||||
from .conftest import SAMPLES_PATH
|
||||
from ..conftest import SAMPLES_PATH
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
Loading…
x
Reference in New Issue
Block a user