@@ -398,10 +398,13 @@ public void FileGen_SharedFiles_CaseInsensitive()
398398 {
399399 // Arrange
400400 string testDir = TestUtils . CreateTestSpecificFolder ( this . TestContext ) ;
401+ // Create 2 uuids and order them so that test is reproducible
402+ Guid [ ] uuids = new Guid [ ] { Guid . NewGuid ( ) , Guid . NewGuid ( ) } ;
403+ Array . Sort ( uuids ) ;
401404
402405 string project1Dir = TestUtils . EnsureTestSpecificFolder ( this . TestContext , "project1" ) ;
403406 string project1Path = Path . Combine ( project1Dir , "project1.proj" ) ;
404- string project1Info = CreateProjectInfoInSubDir ( testDir , "projectName1" , Guid . NewGuid ( ) , ProjectType . Product , false , project1Path , "UTF-8" ) ; // not excluded
407+ string project1Info = CreateProjectInfoInSubDir ( testDir , "projectName1" , uuids [ 0 ] , ProjectType . Product , false , project1Path , "UTF-8" ) ; // not excluded
405408 var sharedFile = Path . Combine ( testDir , "contentFile.txt" ) ;
406409 var sharedFileDifferentCase = Path . Combine ( testDir , "ContentFile.TXT" ) ;
407410 CreateEmptyFile ( testDir , "contentFile.txt" ) ;
@@ -412,7 +415,7 @@ public void FileGen_SharedFiles_CaseInsensitive()
412415
413416 string project2Dir = TestUtils . EnsureTestSpecificFolder ( this . TestContext , "project2" ) ;
414417 string project2Path = Path . Combine ( project2Dir , "project2.proj" ) ;
415- string project2Info = CreateProjectInfoInSubDir ( testDir , "projectName2" , Guid . NewGuid ( ) , ProjectType . Product , false , project2Path , "UTF-8" ) ; // not excluded
418+ string project2Info = CreateProjectInfoInSubDir ( testDir , "projectName2" , uuids [ 1 ] , ProjectType . Product , false , project2Path , "UTF-8" ) ; // not excluded
416419
417420 // Reference shared file, but not under the project directory
418421 string contentFileList2 = CreateFile ( project2Dir , "contentList.txt" , sharedFileDifferentCase ) ;
@@ -427,6 +430,7 @@ public void FileGen_SharedFiles_CaseInsensitive()
427430 // Assert
428431 SQPropertiesFileReader provider = new SQPropertiesFileReader ( result . FullPropertiesFilePath ) ;
429432 provider . AssertSettingExists ( "sonar.projectBaseDir" , testDir ) ;
433+ // First one wins
430434 provider . AssertSettingExists ( "sonar.sources" , sharedFile ) ;
431435 }
432436
@@ -856,7 +860,7 @@ private static string CreateProjectInfoInSubDir(string parentDir,
856860 string projectName , Guid projectGuid , ProjectType projectType , bool isExcluded , string fullProjectPath , string encoding ,
857861 AnalysisProperties additionalProperties = null )
858862 {
859- string newDir = Path . Combine ( parentDir , Guid . NewGuid ( ) . ToString ( ) ) ;
863+ string newDir = Path . Combine ( parentDir , projectName ) ;
860864 Directory . CreateDirectory ( newDir ) ; // ensure the directory exists
861865
862866 ProjectInfo project = new ProjectInfo ( )
0 commit comments