Skip to content

Commit

Permalink
fix: make the crawler runnable and testable on Windows (deepset-ai#3830)
Browse files Browse the repository at this point in the history
* fix crawler and try to run CI

* more compact expression

* try to fix

* improve naming regex

* revert regex

* make test_url compatible wirh Windows

* better conditional expression
  • Loading branch information
anakin87 authored Jan 10, 2023
1 parent 7f89101 commit be31178
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ env:
--ignore=test/pipelines/test_ray.py
--ignore=test/document_stores/test_knowledge_graph.py
--ignore=test/nodes/test_audio.py
--ignore=test/nodes/test_connector.py
--ignore=test/nodes/test_summarizer_translation.py
--ignore=test/nodes/test_summarizer.py
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
Expand Down
4 changes: 2 additions & 2 deletions haystack/nodes/connector/crawler.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ def __init__(
super().__init__()

IN_COLAB = "google.colab" in sys.modules
IN_AZUREML = True if os.environ.get("AZUREML_ENVIRONMENT_IMAGE", None) == "True" else False
IS_ROOT = True if os.geteuid() == 0 else False
IN_AZUREML = os.environ.get("AZUREML_ENVIRONMENT_IMAGE", None) == "True"
IS_ROOT = sys.platform not in ["win32", "cygwin"] and os.geteuid() == 0

if webdriver_options is None:
webdriver_options = ["--headless", "--disable-gpu", "--disable-dev-shm-usage", "--single-process"]
Expand Down
2 changes: 1 addition & 1 deletion test/nodes/test_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

@pytest.fixture(scope="session")
def test_url():
return f"file://{SAMPLES_PATH.absolute()}/crawler"
return (SAMPLES_PATH / "crawler").absolute().as_uri()


def content_match(crawler: Crawler, url: str, crawled_page: Path):
Expand Down

0 comments on commit be31178

Please sign in to comment.