File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
tests/FSharp.Test.Utilities Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -77,13 +77,21 @@ module TestCaseCustomizations =
7777 let oldTestClass = oldTestMethod.TestClass
7878 let oldTestCollection = oldTestMethod.TestClass.TestCollection
7979
80+ // Create a DETERMINISTIC collection ID based on the test case's unique ID
81+ // This ensures the same test case always gets the same collection ID
82+ let collectionId =
83+ use sha = System.Security.Cryptography.SHA256.Create()
84+ let bytes = System.Text.Encoding.UTF8.GetBytes( testCase.UniqueID)
85+ let hash = sha.ComputeHash( bytes)
86+ System.Guid( hash.[ 0 .. 15 ]) // Take first 16 bytes for GUID
87+
8088 // Create a new collection with a unique id for the test case.
8189 let newTestCollection =
8290 new TestCollection(
8391 oldTestCollection.TestAssembly,
8492 oldTestCollection.CollectionDefinition,
8593 oldTestCollection.DisplayName,
86- Guid.NewGuid ()
94+ collectionId
8795 )
8896
8997 let newTestClass = new TestClass( newTestCollection, oldTestClass.Class)
You can’t perform that action at this time.
0 commit comments