Skip to content

Conversation

UlrichB22
Copy link
Collaborator

Fixes #1869.

files = [f for f in proc.open_files() if "wiki" in f.path]
for file in files:
print(f"open wiki {file}")
files = [f for f in proc.open_files() if re.search("/cli/wiki/", f.path)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about passing in the wiki instance path from the configuration and perform a prefix test?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to keep the test very simple. The main idea is just to distinguish the wiki data from the logs like “_test_artifacts/server-crawl.log”.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wondered about re.search("/cli/wiki/", f.path). I mean is "/cli/wiki/" really correct? To me it is kind of unclear, which open files the function is looking for (data, index, all)?
And if testing for substring containment, I suggest avoiding re.search here und go with "/cli/wiki/" in f.path.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One part of the path is build here:

def artifact_dir():
"""create and cd to and yield directory for wiki which persists thru all tests
directory is deleted at end of all tests"""
_, artifact_dir = get_dirs("cli")

giving some path ending with "_test_artifacts/cli/". Inside this dir the wiki is created with subdirectories "wiki/data/" and "wiki/index". But there is another directory called "_test_artifacts/cli2/", so I changed the pattern now.

@UlrichB22 UlrichB22 merged commit 1480269 into moinwiki:master Mar 19, 2025
8 checks passed
@UlrichB22 UlrichB22 deleted the test_scrapy branch March 19, 2025 22:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pytest test_scrapy_crawl.py fails if repo path contains "wiki"
2 participants