-
-
Notifications
You must be signed in to change notification settings - Fork 730
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GH2400: Add globber pattern support to the #load directive #2405
Conversation
94877b6
to
a8eba21
Compare
@devlead @patriksvensson I had some time to dig into this; found and fixed the issue with the globber not working as expected with unix root paths. Also fixed some Windows tests. I force pushed the changes, however the Azure Pipelines builds seem to be failing with an unrelated error in the integration tests:
... and I have the same issue when running the integration tests locally. 🤔 |
@gitfool The T4 issue have been resolved, but I need to investigate the failing tests a bit. I will try to investigate this as soon as I have some spare time. |
@patriksvensson re the unit tests that are now failing on *nix, I changed them from I could change the attribute back but I'm still curious why they wouldn't work as the file system should be virtualized for the test. |
I would guess the problem is coming from:
if (_isWindows)
{
// Windows drive?
if (length >= 2 && path[1] == ':')
{
return true;
}
}
i.e. |
@patriksvensson I'm keen to get this PR into the next release, and since the issue with the tests is due to a pre-existing deficiency in the fake test environment, I simply reverted the Windows tests to use |
Rebased and squashed the last revert commit for a cleaner merge. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 👍 Just about to board a plan so will take this for a spin later.
Could you add a integration test for this ( https://github.com/cake-build/cake/blob/develop/tests/integration/Cake.Core/Scripting/LoadDirective.cake ), preferably with an throw in a file that shouldn't be loaded by globber.
@devlead I added an integration test that adds a task dependency if loaded. One of the tasks throws an exception, but this does not happen since the globber pattern excludes it, while still loading the other task. Note: I also tweaked the check for |
@gitfool your changes have been merged, thanks for your contribution 👍 |
Fixes #2400. @patriksvensson almost there; a couple of the existing unit tests are failing though:
In both cases the globber is processing absolute paths that don't have any globber patterns in them and returning no files. Any ideas how to handle that?