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

[Internal] Tests : Fixes enable "warning-as-error" build errors #4588

Merged
merged 10 commits into from
Oct 3, 2024

Conversation

kirankumarkolli
Copy link
Member

@kirankumarkolli kirankumarkolli commented Jul 12, 2024

Fixes dotnet test reported below issues

[D:\a\1\s\Microsoft.Azure.Cosmos\tests\Microsoft.Azure.Cosmos.Tests\bin\Debug\net6.0\Microsoft.Azure.Cosmos.Tests.dll] UTA007: Method ClientRetryPolicy_Retry_SingleMaster_Read_PreferredLocations defined in class Microsoft.Azure.Cosmos.Client.Tests.ClientRetryPolicyTests does not have correct signature. Test method marked with the [TestMethod] attribute must be non-static, public, return-type as void  and should not take any parameter. Example: public void Test.Class1.Test(). Additionally, if you are using async-await in test method then return-type must be Task. Example: public async Task Test.Class1.Test2()
[MSTest][Discovery][D:\a\1\s\Microsoft.Azure.Cosmos\tests\Microsoft.Azure.Cosmos.Tests\bin\Debug\net6.0\Microsoft.Azure.Cosmos.Tests.dll] UTA007: Method ClientRetryPolicy_Retry_MultiMaster_Read_PreferredLocations defined in class Microsoft.Azure.Cosmos.Client.Tests.ClientRetryPolicyTests does not have correct signature. Test method marked with the [TestMethod] attribute must be non-static, public, return-type as void  and should not take any parameter. Example: public void Test.Class1.Test(). Additionally, if you are using async-await in test method then return-type must be Task. Example: public async Task Test.Class1.Test2()
[MSTest][Discovery][D:\a\1\s\Microsoft.Azure.Cosmos\tests\Microsoft.Azure.Cosmos.Tests\bin\Debug\net6.0\Microsoft.Azure.Cosmos.Tests.dll] UTA007: Method ClientRetryPolicy_Retry_MultiMaster_Write_PreferredLocations defined in class Microsoft.Azure.Cosmos.Client.Tests.ClientRetryPolicyTests does not have correct signature. Test method marked with the [TestMethod] attribute must be non-static, public, return-type as void  and should not take any parameter. Example: public void Test.Class1.Test(). Additionally, if you are using async-await in test method then return-type must be Task. Example: public async Task Test.Class1.Test2()
[MSTest][Discovery][D:\a\1\s\Microsoft.Azure.Cosmos\tests\Microsoft.Azure.Cosmos.Tests\bin\Debug\net6.0\Microsoft.Azure.Cosmos.Tests.dll] UTA007: Method ClientRetryPolicy_NoRetry_SingleMaster_Write_PreferredLocations defined in class Microsoft.Azure.Cosmos.Client.Tests.ClientRetryPolicyTests does not have correct signature. Test method marked with the [TestMethod] attribute must be non-static, public, return-type as void  and should not take any parameter. Example: public void Test.Class1.Test(). Additionally, if you are using async-await in test method then return-type must be Task. Example: public async Task Test.Class1.Test2()
[MSTest][Discovery][D:\a\1\s\Microsoft.Azure.Cosmos\tests\Microsoft.Azure.Cosmos.Tests\bin\Debug\net6.0\Microsoft.Azure.Cosmos.Tests.dll] UTA007: Method ClientRetryPolicy_NoRetry_SingleMaster_Read_NoPreferredLocations defined in class Microsoft.Azure.Cosmos.Client.Tests.ClientRetryPolicyTests does not have correct signature. Test method marked with the [TestMethod] attribute must be non-static, public, return-type as void  and should not take any parameter. Example: public void Test.Class1.Test(). Additionally, if you are using async-await in test method then return-type must be Task. Example: public async Task Test.Class1.Test2()
[MSTest][Discovery][D:\a\1\s\Microsoft.Azure.Cosmos\tests\Microsoft.Azure.Cosmos.Tests\bin\Debug\net6.0\Microsoft.Azure.Cosmos.Tests.dll] UTA007: Method ClientRetryPolicy_NoRetry_SingleMaster_Write_NoPreferredLocations defined in class Microsoft.Azure.Cosmos.Client.Tests.ClientRetryPolicyTests does not have correct signature. Test method marked with the [TestMethod] attribute must be non-static, public, return-type as void  and should not take any parameter. Example: public void Test.Class1.Test(). Additionally, if you are using async-await in test method then return-type must be Task. Example: public async Task Test.Class1.Test2()
[MSTest][Discovery][D:\a\1\s\Microsoft.Azure.Cosmos\tests\Microsoft.Azure.Cosmos.Tests\bin\Debug\net6.0\Microsoft.Azure.Cosmos.Tests.dll] UTA007: Method ClientRetryPolicy_NoRetry_MultiMaster_Read_NoPreferredLocations defined in class Microsoft.Azure.Cosmos.Client.Tests.ClientRetryPolicyTests does not have correct signature. Test method marked with the [TestMethod] attribute must be non-static, public, return-type as void  and should not take any parameter. Example: public void Test.Class1.Test(). Additionally, if you are using async-await in test method then return-type must be Task. Example: public async Task Test.Class1.Test2()
[MSTest][Discovery][D:\a\1\s\Microsoft.Azure.Cosmos\tests\Microsoft.Azure.Cosmos.Tests\bin\Debug\net6.0\Microsoft.Azure.Cosmos.Tests.dll] UTA007: Method ClientRetryPolicy_NoRetry_MultiMaster_Write_NoPreferredLocations defined in class Microsoft.Azure.Cosmos.Client.Tests.ClientRetryPolicyTests does not have correct signature. Test method marked with the [TestMethod] attribute must be non-static, public, return-type as void  and should not take any parameter. Example: public void Test.Class1.Test(). Additionally, if you are using async-await in test method then return-type must be Task. Example: public async Task Test.Class1.Test2()
c:\src\v32\Microsoft.Azure.Cosmos\tests\Microsoft.Azure.Cosmos.Tests\Query\Pipeline\NonStreamingOrderByQueryTests.cs(731,42): warning CS0649: Field 'NonStreamingOrderByQueryTests.DebugTraceHelpers.Enabled' is never assigned to, and will always have its default value false
    c:\src\v32\Microsoft.Azure.Cosmos\tests\Microsoft.Azure.Cosmos.Tests\Routing\PartitionKeyHash.cs(79,40): warning CA2013: Do not pass an argument with value type 'Microsoft.Azure.Cosmos.Routing.PartitionKeyHash' to 'ReferenceEquals'. Due to value boxing, this call to 'ReferenceEquals' can return an unexpected result. Consider using 'Equals' instead, or pass reference type arguments if you intend to use 'ReferenceEquals'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2013)
    c:\src\v32\Microsoft.Azure.Cosmos\tests\Microsoft.Azure.Cosmos.Tests\ChangeFeed\ChangeFeedPartitionKeyResultSetIteratorCoreTests.cs(43,13): warning CA1416: This call site is reachable on all platforms. 'ResourceType' is only supported on: 'windows'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)
    c:\src\v32\Microsoft.Azure.Cosmos\tests\Microsoft.Azure.Cosmos.Tests\ChangeFeed\ChangeFeedPartitionKeyResultSetIteratorCoreTests.cs(124,13): warning CA1416: This call site is reachable on all platforms. 'ResourceType' is only supported on: 'windows'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)
    c:\src\v32\Microsoft.Azure.Cosmos\tests\Microsoft.Azure.Cosmos.Tests\ChangeFeed\ChangeFeedPartitionKeyResultSetIteratorCoreTests.cs(195,13): warning CA1416: This call site is reachable on all platforms. 'ResourceType' is only supported on: 'windows'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)```

[D:\a\1\s\Microsoft.Azure.Cosmos\tests\Microsoft.Azure.Cosmos.Tests\bin\Debug\net6.0\Microsoft.Azure.Cosmos.Tests.dll] UTA007: Method ClientRetryPolicy_Retry_SingleMaster_Read_PreferredLocations defined in class Microsoft.Azure.Cosmos.Client.Tests.ClientRetryPolicyTests does not have correct signature. Test method marked with the [TestMethod] attribute must be non-static, public, return-type as void  and should not take any parameter. Example: public void Test.Class1.Test(). Additionally, if you are using async-await in test method then return-type must be Task. Example: public async Task Test.Class1.Test2()
[MSTest][Discovery][D:\a\1\s\Microsoft.Azure.Cosmos\tests\Microsoft.Azure.Cosmos.Tests\bin\Debug\net6.0\Microsoft.Azure.Cosmos.Tests.dll] UTA007: Method ClientRetryPolicy_Retry_MultiMaster_Read_PreferredLocations defined in class Microsoft.Azure.Cosmos.Client.Tests.ClientRetryPolicyTests does not have correct signature. Test method marked with the [TestMethod] attribute must be non-static, public, return-type as void  and should not take any parameter. Example: public void Test.Class1.Test(). Additionally, if you are using async-await in test method then return-type must be Task. Example: public async Task Test.Class1.Test2()
[MSTest][Discovery][D:\a\1\s\Microsoft.Azure.Cosmos\tests\Microsoft.Azure.Cosmos.Tests\bin\Debug\net6.0\Microsoft.Azure.Cosmos.Tests.dll] UTA007: Method ClientRetryPolicy_Retry_MultiMaster_Write_PreferredLocations defined in class Microsoft.Azure.Cosmos.Client.Tests.ClientRetryPolicyTests does not have correct signature. Test method marked with the [TestMethod] attribute must be non-static, public, return-type as void  and should not take any parameter. Example: public void Test.Class1.Test(). Additionally, if you are using async-await in test method then return-type must be Task. Example: public async Task Test.Class1.Test2()
[MSTest][Discovery][D:\a\1\s\Microsoft.Azure.Cosmos\tests\Microsoft.Azure.Cosmos.Tests\bin\Debug\net6.0\Microsoft.Azure.Cosmos.Tests.dll] UTA007: Method ClientRetryPolicy_NoRetry_SingleMaster_Write_PreferredLocations defined in class Microsoft.Azure.Cosmos.Client.Tests.ClientRetryPolicyTests does not have correct signature. Test method marked with the [TestMethod] attribute must be non-static, public, return-type as void  and should not take any parameter. Example: public void Test.Class1.Test(). Additionally, if you are using async-await in test method then return-type must be Task. Example: public async Task Test.Class1.Test2()
[MSTest][Discovery][D:\a\1\s\Microsoft.Azure.Cosmos\tests\Microsoft.Azure.Cosmos.Tests\bin\Debug\net6.0\Microsoft.Azure.Cosmos.Tests.dll] UTA007: Method ClientRetryPolicy_NoRetry_SingleMaster_Read_NoPreferredLocations defined in class Microsoft.Azure.Cosmos.Client.Tests.ClientRetryPolicyTests does not have correct signature. Test method marked with the [TestMethod] attribute must be non-static, public, return-type as void  and should not take any parameter. Example: public void Test.Class1.Test(). Additionally, if you are using async-await in test method then return-type must be Task. Example: public async Task Test.Class1.Test2()
[MSTest][Discovery][D:\a\1\s\Microsoft.Azure.Cosmos\tests\Microsoft.Azure.Cosmos.Tests\bin\Debug\net6.0\Microsoft.Azure.Cosmos.Tests.dll] UTA007: Method ClientRetryPolicy_NoRetry_SingleMaster_Write_NoPreferredLocations defined in class Microsoft.Azure.Cosmos.Client.Tests.ClientRetryPolicyTests does not have correct signature. Test method marked with the [TestMethod] attribute must be non-static, public, return-type as void  and should not take any parameter. Example: public void Test.Class1.Test(). Additionally, if you are using async-await in test method then return-type must be Task. Example: public async Task Test.Class1.Test2()
[MSTest][Discovery][D:\a\1\s\Microsoft.Azure.Cosmos\tests\Microsoft.Azure.Cosmos.Tests\bin\Debug\net6.0\Microsoft.Azure.Cosmos.Tests.dll] UTA007: Method ClientRetryPolicy_NoRetry_MultiMaster_Read_NoPreferredLocations defined in class Microsoft.Azure.Cosmos.Client.Tests.ClientRetryPolicyTests does not have correct signature. Test method marked with the [TestMethod] attribute must be non-static, public, return-type as void  and should not take any parameter. Example: public void Test.Class1.Test(). Additionally, if you are using async-await in test method then return-type must be Task. Example: public async Task Test.Class1.Test2()
[MSTest][Discovery][D:\a\1\s\Microsoft.Azure.Cosmos\tests\Microsoft.Azure.Cosmos.Tests\bin\Debug\net6.0\Microsoft.Azure.Cosmos.Tests.dll] UTA007: Method ClientRetryPolicy_NoRetry_MultiMaster_Write_NoPreferredLocations defined in class Microsoft.Azure.Cosmos.Client.Tests.ClientRetryPolicyTests does not have correct signature. Test method marked with the [TestMethod] attribute must be non-static, public, return-type as void  and should not take any parameter. Example: public void Test.Class1.Test(). Additionally, if you are using async-await in test method then return-type must be Task. Example: public async Task Test.Class1.Test2()

There are still some more query test issues that needs attention (next follow-UpsertUser)

[MSTest][Discovery][D:\a\1\s\Microsoft.Azure.Cosmos\tests\Microsoft.Azure.Cosmos.Tests\bin\Debug\net6.0\Microsoft.Azure.Cosmos.Tests.dll] UTA001: TestClass attribute defined on non-public class Microsoft.Azure.Cosmos.Tests.Query.OrderByQueryPartitionRangePageAsyncEnumeratorTests+Implementation
[MSTest][Discovery][D:\a\1\s\Microsoft.Azure.Cosmos\tests\Microsoft.Azure.Cosmos.Tests\bin\Debug\net6.0\Microsoft.Azure.Cosmos.Tests.dll] UTA001: TestClass attribute defined on non-public class Microsoft.Azure.Cosmos.Tests.Query.QueryPartitionRangePageAsyncEnumeratorTests+Implementation
[MSTest][Discovery][D:\a\1\s\Microsoft.Azure.Cosmos\tests\Microsoft.Azure.Cosmos.Tests\bin\Debug\net6.0\Microsoft.Azure.Cosmos.Tests.dll] UTA001: TestClass attribute defined on non-public class Microsoft.Azure.Cosmos.Tests.Pagination.BufferedPartitionPartitionRangeEnumeratorTests+Implementation
[MSTest][Discovery][D:\a\1\s\Microsoft.Azure.Cosmos\tests\Microsoft.Azure.Cosmos.Tests\bin\Debug\net6.0\Microsoft.Azure.Cosmos.Tests.dll] UTA001: TestClass attribute defined on non-public class Microsoft.Azure.Cosmos.Tests.Pagination.SinglePartitionPartitionRangeEnumeratorTests+Implementation
@kirankumarkolli kirankumarkolli enabled auto-merge (squash) September 17, 2024 20:43
@kirankumarkolli kirankumarkolli added the auto-merge Enables automation to merge PRs label Oct 2, 2024
@kirankumarkolli kirankumarkolli changed the title [Internal] Tests : Fixes dotnet test reported below issues [Internal] Tests : Fixes enable warning as error build flag Oct 2, 2024
Copy link
Member

@FabianMeiswinkel FabianMeiswinkel left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@FabianMeiswinkel FabianMeiswinkel left a comment

Choose a reason for hiding this comment

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

LGTM Thanks!

@kirankumarkolli kirankumarkolli merged commit 1e150b6 into master Oct 3, 2024
21 checks passed
@kirankumarkolli kirankumarkolli deleted the users/kirankk/ut_fixes branch October 3, 2024 03:29
@kirankumarkolli kirankumarkolli changed the title [Internal] Tests : Fixes enable warning as error build flag [Internal] Tests : Fixes enable "warning-as-error" build errors Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-merge Enables automation to merge PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants