Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"command": "uv run python -m tests.e2e.bench_suite --pairs 3 --out /tmp/bench-1504 -k \"glob_speed_symlink or glob_speed_dotfiles or glob_speed_recursive\"",
"ran_at": 1791770495,
"exit_code": 0,
"commit": "cce3e83ece8026cc8feedbb1cd64f73242f1d230",
"branch": "bot/1504-bench-names-1011"
}
18 changes: 8 additions & 10 deletions packages/python/tests/e2e/glob_speed_dotfiles_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@
fd("--glob '*.md' .cache"),
rg("-g '*.md' -g '!.*' .cache"),
]
CASES = [
("./**/*.md (dotfiles)", "./**/*.md", MARKDOWN),
("./**/.*", "./**/.*", DOTFILES),
("./.cache/**/*.md", "./.cache/**/*.md", UNDER_CACHE),
]
FANOUT = 8


Expand Down Expand Up @@ -120,15 +125,8 @@ def tree(tmp_path_factory):
finally:
shutil.rmtree(root, ignore_errors=True)

@pytest.mark.parametrize(
("glob", "specs"),
[
("./**/*.md", MARKDOWN),
("./**/.*", DOTFILES),
("./.cache/**/*.md", UNDER_CACHE),
],
)
def it_matches_native_files_within_the_bar(tree, glob, specs):
@pytest.mark.parametrize(("name", "glob", "specs"), CASES)
def it_matches_native_files_within_the_bar(tree, name, glob, specs):
root, n, startup = tree

def dirsql(timeout):
Expand All @@ -144,4 +142,4 @@ def dirsql(timeout):
assert len(expected) == matched(n, glob)

assert actual == expected
assert_speed_of_light(glob, result, startup)
assert_speed_of_light(name, result, startup)
13 changes: 7 additions & 6 deletions packages/python/tests/e2e/glob_speed_recursive_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@
rg("-g '*.md' -g '!.*' a/b"),
*suite_only(globstar("./a/b/**/*.md")),
]
CASES = [
("./**/*.md", "./**/*.md", ALL_NATIVE, ""),
("./a/b/**/*.md", "./a/b/**/*.md", PREFIX_NATIVE, "a/b"),
]
FANOUT = 8


Expand Down Expand Up @@ -109,11 +113,8 @@ def tree(tmp_path_factory):
finally:
shutil.rmtree(root, ignore_errors=True)

@pytest.mark.parametrize(
("glob", "specs", "prefix"),
[("./**/*.md", ALL_NATIVE, ""), ("./a/b/**/*.md", PREFIX_NATIVE, "a/b")],
)
def it_matches_native_files_within_the_bar(tree, glob, specs, prefix):
@pytest.mark.parametrize(("name", "glob", "specs", "prefix"), CASES)
def it_matches_native_files_within_the_bar(tree, name, glob, specs, prefix):
root, n, startup = tree

def dirsql(timeout):
Expand All @@ -129,4 +130,4 @@ def dirsql(timeout):
assert len(expected) == matched(n, prefix)

assert actual == expected
assert_speed_of_light(glob, result, startup)
assert_speed_of_light(name, result, startup)
13 changes: 7 additions & 6 deletions packages/python/tests/e2e/glob_speed_symlink_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@
'{bin} -c \'for f in docs/*; do if [ -f "$f" ]; then printf "%s\\n" "$f"; fi; done\'',
),
]
CASES = [
("./**/*.md (symlinks)", "./**/*.md", LINKED),
("./docs/", "./docs/", DOCS),
]
FANOUT = 8


Expand Down Expand Up @@ -109,11 +113,8 @@ def tree(tmp_path_factory):
finally:
shutil.rmtree(root.parent, ignore_errors=True)

@pytest.mark.parametrize(
("glob", "specs"),
[("./**/*.md", LINKED), ("./docs/", DOCS)],
)
def it_matches_native_files_within_the_bar(tree, glob, specs):
@pytest.mark.parametrize(("name", "glob", "specs"), CASES)
def it_matches_native_files_within_the_bar(tree, name, glob, specs):
root, n, startup = tree

def dirsql(timeout):
Expand All @@ -129,4 +130,4 @@ def dirsql(timeout):
assert len(expected) == matched(n, glob)

assert actual == expected
assert_speed_of_light(glob, result, startup)
assert_speed_of_light(name, result, startup)
24 changes: 24 additions & 0 deletions packages/python/tests/integration/hermetic/glob_case_names_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"""Hermetic test that the suite's glob cases carry distinct names."""

from collections import Counter

from tests.e2e import (
glob_speed_dotfiles_test,
glob_speed_recursive_test,
glob_speed_symlink_test,
)


def case_names():
modules = (
glob_speed_recursive_test,
glob_speed_symlink_test,
glob_speed_dotfiles_test,
)
return [case[0] for module in modules for case in module.CASES]


def describe_glob_case_names():
def it_gives_every_case_its_own_name():
repeated = [n for n, count in Counter(case_names()).items() if count > 1]
assert repeated == []
Loading