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 pytest tests/e2e/glob_speed_symlink_test.py -x -q -s",
"ran_at": 1793672360,
"exit_code": 0,
"commit": "be03752309ec91f1e05891e53b9cb96872b7afec",
"branch": "bot/1482-docs-fastest-bar-1102"
}
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 @@ -7,7 +7,7 @@
Native for the first is bash globstar alone, the reference for which links it
takes: `find`, `fd` and `rg` either skip the link or descend through it.
Natives for the second are `find` bounded at one level, `fd`, `rg --files`
and a bash glob. No mocks: real console
and a bash glob, and its bar is the fastest of them. No mocks: real console
script, real process, real filesystem.
"""

Expand All @@ -18,6 +18,7 @@
import pytest

from .speed_of_light import (
FASTEST,
Native,
agreed_rows,
assert_speed_of_light,
Expand Down Expand Up @@ -50,8 +51,8 @@
),
]
CASES = [
("./**/*.md (symlinks)", "./**/*.md", LINKED),
("./docs/", "./docs/", DOCS),
("./**/*.md (symlinks)", "./**/*.md", LINKED, ""),
("./docs/", "./docs/", DOCS, FASTEST),
]
FANOUT = 8

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

@pytest.mark.parametrize(("name", "glob", "specs"), CASES)
def it_matches_native_files_within_the_bar(tree, name, glob, specs):
@pytest.mark.parametrize(("name", "glob", "specs", "bar"), CASES)
def it_matches_native_files_within_the_bar(tree, name, glob, specs, bar):
root, n, startup = tree

def dirsql(timeout):
Expand All @@ -125,7 +126,7 @@ def dirsql(timeout):
)
return sorted(row for (row,) in dirsql_rows(proc, ("path",))), seconds

result = paired(shell_natives(root, specs), dirsql, startup)
result = paired(shell_natives(root, specs, bar=bar), dirsql, startup)
expected, actual = agreed_rows(result), result.dirsql_rows
assert len(expected) == matched(n, glob)

Expand Down
Loading