From b5479302dbfdd595160fca202bd3f1afbf378c48 Mon Sep 17 00:00:00 2001 From: Kashish Gupta <90824921+kashish2508@users.noreply.github.com> Date: Thu, 12 Dec 2024 12:03:05 +0530 Subject: [PATCH] fix(playwrighttesting): suiteId to use hash instead of classname (#47513) * fix(playwrighttesting): suiteId to use hash instead of classname * updated --------- Co-authored-by: guptakashish --- .../src/Processor/DataProcessor.cs | 2 +- .../tests/Processor/DataProcessorTests.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/Processor/DataProcessor.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/Processor/DataProcessor.cs index e1e135158fea9..dab4f56f9dc96 100644 --- a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/Processor/DataProcessor.cs +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/src/Processor/DataProcessor.cs @@ -107,7 +107,7 @@ public TestResults GetTestCaseResultData(TestResult? testResultSource) testCaseResultData.TestTitle = testResultSource.TestCase.DisplayName; var className = FetchTestClassName(testResultSource.TestCase.FullyQualifiedName); testCaseResultData.SuiteTitle = className; - testCaseResultData.SuiteId = className; + testCaseResultData.SuiteId = ReporterUtils.CalculateSha1Hash(className); testCaseResultData.FileName = FetchFileName(testResultSource.TestCase.Source); testCaseResultData.LineNumber = testResultSource.TestCase.LineNumber; testCaseResultData.Retry = 0; // TODO Retry and PreviousRetries diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/tests/Processor/DataProcessorTests.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/tests/Processor/DataProcessorTests.cs index 75fc38eb7a35f..7040bf15fd1e8 100644 --- a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/tests/Processor/DataProcessorTests.cs +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting.TestLogger/tests/Processor/DataProcessorTests.cs @@ -165,7 +165,7 @@ public void GetTestCaseResultData_WithNonNullTestResult_ReturnsTestResults() Assert.IsNotNull(result.TestId); Assert.AreEqual(testResult.TestCase.DisplayName, result.TestTitle); Assert.AreEqual("Test", result.SuiteTitle); - Assert.AreEqual("Test", result.SuiteId); + Assert.AreEqual(ReporterUtils.CalculateSha1Hash("Test"), result.SuiteId); Assert.AreEqual("TestNamespace.TestClass", result.FileName); Assert.AreEqual(testResult.TestCase.LineNumber, result.LineNumber); Assert.AreEqual(0, result.Retry);