<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>271186</bug_id>
          
          <creation_ts>2024-03-18 15:03:06 -0700</creation_ts>
          <short_desc>REGRESSION(276129@main): `run-webkit-tests imported/w3c/web-platform-tests/css/*/*animation*` doesn&apos;t find tests to run</short_desc>
          <delta_ts>2024-03-18 15:29:04 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Tools / Tests</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Sam Sneddon [:gsnedders]">gsnedders</reporter>
          <assigned_to name="Sam Sneddon [:gsnedders]">gsnedders</assigned_to>
          <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2021907</commentid>
    <comment_count>0</comment_count>
    <who name="Sam Sneddon [:gsnedders]">gsnedders</who>
    <bug_when>2024-03-18 15:03:06 -0700</bug_when>
    <thetext>rdar://124918090

I swear I was able to run tests using multiple `*` in the path like so:

```
rwt --debug imported/w3c/web-platform-tests/css/*/*animation*
```

Now this doesn’t work:

```
OpenSource &gt; rwt --debug imported/w3c/web-platform-tests/css/*/*animation*
Using port &apos;mac-sonoma-wk2&apos;
Test configuration: &lt;sonoma, arm64, debug&gt;
Placing test results in /Users/antoine/Builds/Debug/layout-test-results
Using Debug build
Pixel tests disabled
Regular timeout: 30000, slow test timeout: 150000
Command line: /Users/antoine/Builds/Debug/WebKitTestRunner -

Collecting tests ... 
```

Adding a `LayoutTests/` prefix makes it work though:

```
rwt --debug LayoutTests/imported/w3c/web-platform-tests/css/*/*animation*
```

This command finds 457 tests to run.

This regressed with https://commits.webkit.org/276129@main, the fix for rdar://72894403 (LayoutTestFinder should be in charge of finding expectations for each test (220421)).

---

What shell are you using? Because I’d expect it to fail with the shell being unable to expand the globs, without it even getting to run-webkit-tests:

gsnedders@gsnedders-marsha OpenSource % ./Tools/Scripts/run-webkit-tests --debug --print-expectations imported/w3c/web-platform-tests/css/*/*animation*
zsh: no matches found: imported/w3c/web-platform-tests/css/*/*animation*

With it quoted, I get:

% ./Tools/Scripts/run-webkit-tests --debug --print-expectations &apos;imported/w3c/web-platform-tests/css/*/*animation*&apos;
Collecting tests ...%

Which *is* more suspicious.

Fixing the swallowing of some exception in https://bugs.webkit.org/show_bug.cgi?id=271180, because after we fix that we see:

Traceback (most recent call last):
  File &quot;/Volumes/gsnedders/projects/Safari/OpenSource/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py&quot;, line 94, in main
    run_details = run(port, options, args, stderr)
  File &quot;/Volumes/gsnedders/projects/Safari/OpenSource/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py&quot;, line 556, in run
    run_details = manager.run(args)
  File &quot;/Volumes/gsnedders/projects/Safari/OpenSource/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py&quot;, line 328, in run
    tests_to_run_by_device, aggregate_tests_to_skip = self._collect_tests(args, device_type_list)
  File &quot;/Volumes/gsnedders/projects/Safari/OpenSource/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py&quot;, line 123, in _collect_tests
    paths, tests = self._finder.find_tests(self._options, paths, device_type=device_type)
  File &quot;/Volumes/gsnedders/projects/Safari/OpenSource/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_finder_legacy.py&quot;, line 67, in find_tests
    tests = self.find_tests_by_path(paths, device_type=device_type, with_expectations=with_expectations)
  File &quot;/Volumes/gsnedders/projects/Safari/OpenSource/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_finder_legacy.py&quot;, line 78, in find_tests_by_path
    return list(finder.get_tests(paths))
  File &quot;/Volumes/gsnedders/projects/Safari/OpenSource/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_finder.py&quot;, line 210, in get_tests
    for item in self._process_directory(
  File &quot;/Volumes/gsnedders/projects/Safari/OpenSource/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_finder.py&quot;, line 319, in _process_directory
    it = self.fs.scandir(current_layout_tests_path)
  File &quot;/Volumes/gsnedders/projects/Safari/OpenSource/Tools/Scripts/webkitpy/common/system/filesystem.py&quot;, line 195, in scandir
    return os.scandir(path)
NotADirectoryError: [Errno 20] Not a directory: &apos;/Volumes/gsnedders/projects/Safari/OpenSource/LayoutTests/imported/w3c/web-platform-tests/css/w3c-import.log&apos;

…which is an accurate observation. Pretty sure we just need to check whether the glob matches a directory (v. a file) in one place.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2021908</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2024-03-18 15:03:15 -0700</bug_when>
    <thetext>&lt;rdar://problem/124970843&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2021910</commentid>
    <comment_count>2</comment_count>
    <who name="Sam Sneddon [:gsnedders]">gsnedders</who>
    <bug_when>2024-03-18 15:05:47 -0700</bug_when>
    <thetext>rdar://124918090</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2021911</commentid>
    <comment_count>3</comment_count>
    <who name="Sam Sneddon [:gsnedders]">gsnedders</who>
    <bug_when>2024-03-18 15:06:22 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/26077</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2021922</commentid>
    <comment_count>4</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2024-03-18 15:29:02 -0700</bug_when>
    <thetext>Committed 276306@main (399ae11e2665): &lt;https://commits.webkit.org/276306@main&gt;

Reviewed commits have been landed. Closing PR #26077 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>