mirror of
https://github.com/dotnet/skills.git
synced 2026-09-20 09:49:54 +08:00
Fix timeout in MSTest.Sdk v3-to-v4 eval scenario 9 (#544)
The fixture csproj had MSTest.Sdk/3.8.0 while the prompt claimed the user already upgraded to 4.1.0. This mismatch caused the model to edit the csproj and run dotnet build, triggering slow MSTest SDK NuGet downloads that exceeded the 240s timeout on CI. - Update fixture csproj to MSTest.Sdk/4.1.0 to match the prompt - Add specific CS error codes to the prompt so the model provides direct fixes instead of building - Update rubric item to reflect the project already being on 4.1.0
This commit is contained in:
@@ -371,9 +371,13 @@ scenarios:
|
||||
|
||||
- name: "Migrate MSTest.Sdk v3 project using ManagedType and TestTimeout"
|
||||
prompt: |
|
||||
I have a test project using MSTest.Sdk/3.8.0. The tests use TestContext.ManagedType,
|
||||
TestTimeout.Infinite, and TestContext.Properties.Contains. After upgrading to
|
||||
MSTest.Sdk/4.1.0, I get compilation errors. How do I fix them?
|
||||
I upgraded my test project from MSTest.Sdk/3.8.0 to MSTest.Sdk/4.1.0 and now I get
|
||||
these compilation errors:
|
||||
- CS1061: 'TestContext' does not contain a definition for 'ManagedType'
|
||||
- CS0103: The name 'TestTimeout' does not exist in the current context
|
||||
- CS1061: 'IDictionary<string, object>' does not contain a definition for 'Contains'
|
||||
How do I fix these errors? Also, is there anything else I should know about
|
||||
MSTest.Sdk v4 behavior changes?
|
||||
setup:
|
||||
files:
|
||||
- path: "TestProject.csproj"
|
||||
@@ -391,7 +395,7 @@ scenarios:
|
||||
- "Identifies that TestContext.ManagedType is removed in v4 and recommends FullyQualifiedTestClassName"
|
||||
- "Identifies that TestTimeout.Infinite is removed and recommends int.MaxValue"
|
||||
- "Identifies that TestContext.Properties.Contains must become ContainsKey"
|
||||
- "Notes the MSTest.Sdk version should be updated to 4.1.0"
|
||||
- "Notes the project is using MSTest.Sdk/4.1.0 or confirms the SDK version upgrade"
|
||||
- "Mentions that MSTest.Sdk v4 no longer adds Microsoft.NET.Test.Sdk when using MTP"
|
||||
timeout: 240
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
<Project Sdk="MSTest.Sdk/3.8.0">
|
||||
<Project Sdk="MSTest.Sdk/4.1.0">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
|
||||
Reference in New Issue
Block a user