Skip to content
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

feat!: allow disposing event registration and use globbing #707

Merged
merged 7 commits into from
Jan 11, 2025

Conversation

vbreuss
Copy link
Member

@vbreuss vbreuss commented Jan 11, 2025

Change the return type for event registration to an IDisposable that allows un-registering by calling Dispose.

Also fixes #681 by replacing the two distinct parameters path and searchPattern with a globPattern (see here). If the pattern contains no directory slashes, the match will only be against the file name, otherwise it will be against the full path.

@vbreuss vbreuss added enhancement New feature or request breaking change The changes require a new major version labels Jan 11, 2025
@vbreuss vbreuss self-assigned this Jan 11, 2025
Copy link

github-actions bot commented Jan 11, 2025

👽 Mutation Results

Mutation testing badge

Testably.Abstractions.Testing

Details
File Score Killed Survived Timeout No Coverage Ignored Compile Errors Total Detected Total Undetected Total Mutants
FileSystem/ChangeHandler.cs 25.00% 1 0 0 3 3 0 1 3 7
Helpers/ChangeDescriptionExtensions.cs 0.00% 0 0 0 15 5 0 0 15 20
MockFileSystem.cs 85.71% 18 0 0 3 5 0 18 3 26
Notification.cs 100.00% 31 0 3 0 16 0 34 0 50
Storage/InMemoryStorage.cs 7.22% 21 1 0 269 103 71 21 270 465

The final mutation score is 20.27%

Coverage Thresholds: high:80 low:60 break:0

Testably.Abstractions.AccessControl

Details
File Score Killed Survived Timeout No Coverage Ignored Compile Errors Total Detected Total Undetected Total Mutants

The final mutation score is NaN%

Coverage Thresholds: high:80 low:60 break:0

Testably.Abstractions.Compression

Details
File Score Killed Survived Timeout No Coverage Ignored Compile Errors Total Detected Total Undetected Total Mutants

The final mutation score is NaN%

Coverage Thresholds: high:80 low:60 break:0

Testably.Abstractions

Details
File Score Killed Survived Timeout No Coverage Ignored Compile Errors Total Detected Total Undetected Total Mutants

The final mutation score is NaN%

Coverage Thresholds: high:80 low:60 break:0

Copy link

github-actions bot commented Jan 11, 2025

Test Results

     46 files  ±  0       46 suites  ±0   22m 14s ⏱️ -11s
 55 244 tests + 50   52 270 ✅ + 50   2 974 💤 ±0  0 ❌ ±0 
114 806 runs  +423  102 505 ✅ +423  12 301 💤 ±0  0 ❌ ±0 

Results for commit dd9b9be. ± Comparison against base commit 3c033dd.

This pull request removes 47552 and adds 47602 tests. Note that renamed tests count towards both.
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.MockFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "path161fb148-b083-44d8-8918-b949dc456dd8")
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.MockFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "path2be1ca56-fa50-4d84-a982-b0e76419266b")
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.MockFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "path64ced7f6-cc96-48af-ad4f-e6949d3e6005")
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.MockFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "path6928d800-b237-447f-9945-973d6693d428")
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.MockFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "path82647aba-68a1-4c07-93a0-d61ae6d12f19")
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.MockFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "path9598edaa-a184-4514-af60-68183fcdf6ad")
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.MockFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "pathabc0e0e5-af51-4b4d-a20f-2d76be2373ff")
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.MockFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "pathaed10a81-c9f0-4fc8-8d47-782d2a68d955")
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.MockFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "pathd67b8464-a588-41e9-ae57-799e72958f0b")
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.RealFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "path021b3e56-2ca6-4e06-9caa-dc4abbeb364f")
…
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.MockFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "path098d084d-7579-43f0-8683-08af91dbd3d0")
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.MockFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "path0ea8259c-fd73-427d-bed7-c8f15134a368")
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.MockFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "path24fd241c-d505-4525-93e9-316d1853c529")
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.MockFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "path422fc7c3-87b4-42cb-8677-fb08c6949d05")
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.MockFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "path6f72ada5-c868-4698-83af-ff302d5459e0")
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.MockFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "pathb5cab552-053a-42c4-97b5-9899e9c42c35")
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.MockFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "pathb959a6f7-2f50-44bf-aa38-172e5e9146cc")
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.MockFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "pathcbac29da-082e-4339-a2d1-439632eba479")
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.MockFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "pathf4f6b7e3-b73a-4870-8b29-35cf6190fd2f")
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.RealFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "path0d72aaa6-9131-4c53-a4be-821108a11899")
…
This pull request removes 2351 skipped tests and adds 2351 skipped tests. Note that renamed tests count towards both.
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.MockFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "path161fb148-b083-44d8-8918-b949dc456dd8")
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.MockFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "path64ced7f6-cc96-48af-ad4f-e6949d3e6005")
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.MockFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "path82647aba-68a1-4c07-93a0-d61ae6d12f19")
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.MockFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "pathabc0e0e5-af51-4b4d-a20f-2d76be2373ff")
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.MockFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "pathaed10a81-c9f0-4fc8-8d47-782d2a68d955")
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.MockFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "pathd67b8464-a588-41e9-ae57-799e72958f0b")
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.RealFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "path021b3e56-2ca6-4e06-9caa-dc4abbeb364f")
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.RealFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "path0472429e-28e2-4f11-ac40-46c8e403f3b2")
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.RealFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "path2a1c304d-91a0-464f-91c5-1caaf766a1c7")
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.RealFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "path43dd844f-bb81-4255-8137-951fffd4f7d1")
…
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.MockFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "path098d084d-7579-43f0-8683-08af91dbd3d0")
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.MockFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "path24fd241c-d505-4525-93e9-316d1853c529")
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.MockFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "path422fc7c3-87b4-42cb-8677-fb08c6949d05")
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.MockFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "path6f72ada5-c868-4698-83af-ff302d5459e0")
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.MockFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "pathb959a6f7-2f50-44bf-aa38-172e5e9146cc")
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.MockFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "pathcbac29da-082e-4339-a2d1-439632eba479")
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.RealFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "path1297adac-328b-4585-8e97-bef2d2de8751")
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.RealFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "path3302b977-da81-424c-8099-d94411bfd2e1")
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.RealFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "path7fde29b5-5aa8-4bc6-9d14-c0d41d05bad6")
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.RealFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "path922d4854-1368-4be3-bc04-3ab3cd84e09e")
…

♻️ This comment has been updated with latest results.

@vbreuss vbreuss force-pushed the topic/allow-dispose-event-registration branch from 639f41d to 8ac7323 Compare January 11, 2025 08:32
@vbreuss vbreuss marked this pull request as ready for review January 11, 2025 09:06
@vbreuss vbreuss force-pushed the topic/allow-dispose-event-registration branch from 2821bff to dd9b9be Compare January 11, 2025 09:11
@vbreuss vbreuss enabled auto-merge (squash) January 11, 2025 09:11
@vbreuss vbreuss merged commit ef0eac7 into main Jan 11, 2025
15 checks passed
@vbreuss vbreuss deleted the topic/allow-dispose-event-registration branch January 11, 2025 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change The changes require a new major version enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Filtering for file type in MockFileSystem.Intercept.Creating()
1 participant