Skip to content

fix: Make MockDirectory.Exists behavior with forward slash on Windows consistent with actual file system - #1245

Merged
vbreuss merged 4 commits into
TestableIO:mainfrom
tbui17:fix-direxist-windows
Mar 13, 2025
Merged

fix: Make MockDirectory.Exists behavior with forward slash on Windows consistent with actual file system#1245
vbreuss merged 4 commits into
TestableIO:mainfrom
tbui17:fix-direxist-windows

Conversation

@tbui17

@tbui17tbui17 commented Mar 8, 2025

Copy link
Copy Markdown
Contributor

fixes#1244

Changes

  • Removed Unix OS check in MockDirectory.Exists
  • Added additional tests for MockDirectory, MockDirectoryInfo, FileSystem.Directory

@tbui17
tbui17force-pushed the fix-direxist-windows branch from a049751 to 377312fCompareMarch 9, 2025 08:00
@tbui17

Copy link
Copy Markdown
ContributorAuthor

Not sure why SonarQube wouldn't detect the project for my PR specifically in contrast with all the other ones within the past couple weeks. Looking into how the GHA integration works now.

 Error: ERROR: Error during SonarScanner execution
10:42:06 [ERR] ERROR: Error during SonarScanner execution
Error: ERROR: Project not found. Please check the 'sonar.projectKey' and 'sonar.organization' properties, the 'SONAR_TOKEN' environment variable, or contact the project administrator to check the permissions of the user the token belongs to
10:42:06 [ERR] ERROR: Project not found. Please check the 'sonar.projectKey' and 'sonar.organization' properties, the 'SONAR_TOKEN' environment variable, or contact the project administrator to check the permissions of the user the token belongs to
Error: ERROR: 10:42:06 [ERR] ERROR: Error: The SonarScanner did not complete successfully
10:42:07 [ERR] The SonarScanner did not complete successfully
Error: 10:42:07.076 Post-processing failed. Exit code: 1
10:42:07 [ERR] 10:42:07.076 Post-processing failed. Exit code: 1
Error: Target "CodeAnalysisEnd" has thrown an exception

…ont slash on Windows consistent with actual file system
@vbreuss
vbreussforce-pushed the fix-direxist-windows branch from 377312f to 43c63b2CompareMarch 12, 2025 11:58
@vbreuss

vbreuss commented Mar 13, 2025

Copy link
Copy Markdown
Member

Not sure why SonarQube wouldn't detect the project for my PR specifically in contrast with all the other ones within the past couple weeks. Looking into how the GHA integration works now.

 Error: ERROR: Error during SonarScanner execution
10:42:06 [ERR] ERROR: Error during SonarScanner execution
Error: ERROR: Project not found. Please check the 'sonar.projectKey' and 'sonar.organization' properties, the 'SONAR_TOKEN' environment variable, or contact the project administrator to check the permissions of the user the token belongs to
10:42:06 [ERR] ERROR: Project not found. Please check the 'sonar.projectKey' and 'sonar.organization' properties, the 'SONAR_TOKEN' environment variable, or contact the project administrator to check the permissions of the user the token belongs to
Error: ERROR: 10:42:06 [ERR] ERROR: Error: The SonarScanner did not complete successfully
10:42:07 [ERR] The SonarScanner did not complete successfully
Error: 10:42:07.076 Post-processing failed. Exit code: 1
10:42:07 [ERR] 10:42:07.076 Post-processing failed. Exit code: 1
Error: Target "CodeAnalysisEnd" has thrown an exception

The issue seems to be a bit more complicated, as in Github Actions secrets are not provided to workflow runs from forks. I have to check how I can work around this limitation...

Update: For the time being I deactivated SonarCloud analysis on external PRs.

@vbreussvbreuss changed the title fix(MockDirectory.Exists): Make MockDirectory.Exists behavior with front slash on Windows consistent with actual file systemfix(MockDirectory.Exists): Make MockDirectory.Exists behavior with forward slash on Windows consistent with actual file systemMar 13, 2025
@vbreussvbreuss changed the title fix(MockDirectory.Exists): Make MockDirectory.Exists behavior with forward slash on Windows consistent with actual file systemfix: Make MockDirectory.Exists behavior with forward slash on Windows consistent with actual file systemMar 13, 2025

@vbreussvbreuss left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
Thanks!

@vbreuss
vbreuss enabled auto-merge (squash) March 13, 2025 19:58
@vbreuss
vbreuss merged commit fe8f1db into TestableIO:mainMar 13, 2025
@github-actions

Copy link
Copy Markdown

This is addressed in release v22.0.12.

@github-actionsgithub-actionsBot added the state: released Issues that are released label Mar 13, 2025
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

state: releasedIssues that are released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MockFileSystem directory behavior with front slash inconsistent with actual file system behavior on Windows

2 participants

@tbui17@vbreuss