Skip to content

Commit 3c88696

Browse files
committed
reverting back to unique test container naming.
1 parent e68387a commit 3c88696

26 files changed

Lines changed: 145 additions & 354 deletions

src/RustAnalyzer.TestAdapter.UnitTests/Cargo/BuildJsonOutputParserTests.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
using ApprovalTests;
55
using ApprovalTests.Namers;
66
using ApprovalTests.Reporters;
7-
using ApprovalTests.Reporters.TestFrameworks;
87
using KS.RustAnalyzer.TestAdapter.Cargo;
98
using KS.RustAnalyzer.TestAdapter.Common;
109
using KS.RustAnalyzer.Tests.Common;
@@ -16,7 +15,7 @@ namespace KS.RustAnalyzer.TestAdapter.UnitTests.Cargo;
1615
public class BuildJsonOutputParserTests
1716
{
1817
[Fact]
19-
[UseReporter(typeof(XUnit2Reporter))]
18+
[UseReporter(typeof(RaVsDiffReporter))]
2019
[MethodImpl(MethodImplOptions.NoInlining)]
2120
public void IfNotParsableReturnAsIs()
2221
{
@@ -27,7 +26,7 @@ public void IfNotParsableReturnAsIs()
2726
}
2827

2928
[Theory]
30-
[UseReporter(typeof(XUnit2Reporter))]
29+
[UseReporter(typeof(RaVsDiffReporter))]
3130
[InlineData("CompilerArtifact1.json")]
3231
[InlineData("CompilerArtifact2.json")]
3332
[InlineData("CompilerArtifact3.json")]
@@ -41,7 +40,7 @@ public void ParseCompilerArtifiacts(string dataFile)
4140
}
4241

4342
[Theory]
44-
[UseReporter(typeof(XUnit2Reporter))]
43+
[UseReporter(typeof(RaVsDiffReporter))]
4544
[InlineData("ComplexError1.json")]
4645
[InlineData("ComplexWarning1.json")]
4746
[InlineData("ComplexError2.json")]

src/RustAnalyzer.TestAdapter.UnitTests/Cargo/ToolChainServiceTests.BuildTestsAsync.hello_library.approved.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[
22
{
3-
"Item1": "<TestRoot>\\hello_library\\target\\debug\\hello_lib.rusttests",
3+
"Item1": "<TestRoot>\\hello_library\\target\\debug\\hello_lib_libhello_lib.rusttests",
44
"Item2": {
5-
"ThisPath": "<TestRoot>\\hello_library\\target\\debug\\hello_lib.rusttests",
5+
"ThisPath": "<TestRoot>\\hello_library\\target\\debug\\hello_lib_libhello_lib.rusttests",
66
"Manifest": "<TestRoot>\\hello_library\\Cargo.toml",
77
"TargetDir": "<TestRoot>\\hello_library\\target",
88
"AdditionalTestDiscoveryArguments": "",

src/RustAnalyzer.TestAdapter.UnitTests/Cargo/ToolChainServiceTests.BuildTestsAsync.hello_workspace.approved.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[
22
{
3-
"Item1": "<TestRoot>\\hello_workspace\\target\\debug\\main.rusttests",
3+
"Item1": "<TestRoot>\\hello_workspace\\target\\debug\\main_main.rusttests",
44
"Item2": {
5-
"ThisPath": "<TestRoot>\\hello_workspace\\target\\debug\\main.rusttests",
5+
"ThisPath": "<TestRoot>\\hello_workspace\\target\\debug\\main_main.rusttests",
66
"Manifest": "<TestRoot>\\hello_workspace\\main\\Cargo.toml",
77
"TargetDir": "<TestRoot>\\hello_workspace\\target",
88
"AdditionalTestDiscoveryArguments": "",
@@ -13,10 +13,10 @@
1313
}
1414
},
1515
{
16-
"Item1": "<TestRoot>\\hello_workspace\\target\\debug\\shared.rusttests",
16+
"Item1": "<TestRoot>\\hello_workspace\\target\\debug\\shared2_libshared2.rusttests",
1717
"Item2": {
18-
"ThisPath": "<TestRoot>\\hello_workspace\\target\\debug\\shared.rusttests",
19-
"Manifest": "<TestRoot>\\hello_workspace\\shared\\Cargo.toml",
18+
"ThisPath": "<TestRoot>\\hello_workspace\\target\\debug\\shared2_libshared2.rusttests",
19+
"Manifest": "<TestRoot>\\hello_workspace\\subfolder\\shared2\\Cargo.toml",
2020
"TargetDir": "<TestRoot>\\hello_workspace\\target",
2121
"AdditionalTestDiscoveryArguments": "",
2222
"AdditionalTestExecutionArguments": "",
@@ -26,10 +26,10 @@
2626
}
2727
},
2828
{
29-
"Item1": "<TestRoot>\\hello_workspace\\target\\debug\\shared2.rusttests",
29+
"Item1": "<TestRoot>\\hello_workspace\\target\\debug\\shared_libshared.rusttests",
3030
"Item2": {
31-
"ThisPath": "<TestRoot>\\hello_workspace\\target\\debug\\shared2.rusttests",
32-
"Manifest": "<TestRoot>\\hello_workspace\\subfolder\\shared2\\Cargo.toml",
31+
"ThisPath": "<TestRoot>\\hello_workspace\\target\\debug\\shared_libshared.rusttests",
32+
"Manifest": "<TestRoot>\\hello_workspace\\shared\\Cargo.toml",
3333
"TargetDir": "<TestRoot>\\hello_workspace\\target",
3434
"AdditionalTestDiscoveryArguments": "",
3535
"AdditionalTestExecutionArguments": "",

src/RustAnalyzer.TestAdapter.UnitTests/Cargo/ToolChainServiceTests.BuildTestsAsync.hello_world.approved.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[
22
{
3-
"Item1": "<TestRoot>\\hello_world\\target\\debug\\hello_world.rusttests",
3+
"Item1": "<TestRoot>\\hello_world\\target\\debug\\hello_world_hello_world.rusttests",
44
"Item2": {
5-
"ThisPath": "<TestRoot>\\hello_world\\target\\debug\\hello_world.rusttests",
5+
"ThisPath": "<TestRoot>\\hello_world\\target\\debug\\hello_world_hello_world.rusttests",
66
"Manifest": "<TestRoot>\\hello_world\\Cargo.toml",
77
"TargetDir": "<TestRoot>\\hello_world\\target",
88
"AdditionalTestDiscoveryArguments": "",
Lines changed: 8 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[
22
{
3-
"Item1": "<TestRoot>\\workspace_mixed\\target\\debug\\bin1.rusttests",
3+
"Item1": "<TestRoot>\\workspace_mixed\\target\\debug\\main_bin1.rusttests",
44
"Item2": {
5-
"ThisPath": "<TestRoot>\\workspace_mixed\\target\\debug\\bin1.rusttests",
5+
"ThisPath": "<TestRoot>\\workspace_mixed\\target\\debug\\main_bin1.rusttests",
66
"Manifest": "<TestRoot>\\workspace_mixed\\Cargo.toml",
77
"TargetDir": "<TestRoot>\\workspace_mixed\\target",
88
"AdditionalTestDiscoveryArguments": "",
@@ -13,9 +13,9 @@
1313
}
1414
},
1515
{
16-
"Item1": "<TestRoot>\\workspace_mixed\\target\\debug\\bin2.rusttests",
16+
"Item1": "<TestRoot>\\workspace_mixed\\target\\debug\\main_bin2.rusttests",
1717
"Item2": {
18-
"ThisPath": "<TestRoot>\\workspace_mixed\\target\\debug\\bin2.rusttests",
18+
"ThisPath": "<TestRoot>\\workspace_mixed\\target\\debug\\main_bin2.rusttests",
1919
"Manifest": "<TestRoot>\\workspace_mixed\\Cargo.toml",
2020
"TargetDir": "<TestRoot>\\workspace_mixed\\target",
2121
"AdditionalTestDiscoveryArguments": "",
@@ -26,9 +26,9 @@
2626
}
2727
},
2828
{
29-
"Item1": "<TestRoot>\\workspace_mixed\\target\\debug\\main.rusttests",
29+
"Item1": "<TestRoot>\\workspace_mixed\\target\\debug\\main_libmain.rusttests",
3030
"Item2": {
31-
"ThisPath": "<TestRoot>\\workspace_mixed\\target\\debug\\main.rusttests",
31+
"ThisPath": "<TestRoot>\\workspace_mixed\\target\\debug\\main_libmain.rusttests",
3232
"Manifest": "<TestRoot>\\workspace_mixed\\Cargo.toml",
3333
"TargetDir": "<TestRoot>\\workspace_mixed\\target",
3434
"AdditionalTestDiscoveryArguments": "",
@@ -39,9 +39,9 @@
3939
}
4040
},
4141
{
42-
"Item1": "<TestRoot>\\workspace_mixed\\target\\debug\\shared.rusttests",
42+
"Item1": "<TestRoot>\\workspace_mixed\\target\\debug\\shared_libshared.rusttests",
4343
"Item2": {
44-
"ThisPath": "<TestRoot>\\workspace_mixed\\target\\debug\\shared.rusttests",
44+
"ThisPath": "<TestRoot>\\workspace_mixed\\target\\debug\\shared_libshared.rusttests",
4545
"Manifest": "<TestRoot>\\workspace_mixed\\shared\\Cargo.toml",
4646
"TargetDir": "<TestRoot>\\workspace_mixed\\target",
4747
"AdditionalTestDiscoveryArguments": "",
@@ -50,31 +50,5 @@
5050
"Profile": "dev",
5151
"TestExe": "<not_yet_generated>"
5252
}
53-
},
54-
{
55-
"Item1": "<TestRoot>\\workspace_mixed\\target\\debug\\test1.rusttests",
56-
"Item2": {
57-
"ThisPath": "<TestRoot>\\workspace_mixed\\target\\debug\\test1.rusttests",
58-
"Manifest": "<TestRoot>\\workspace_mixed\\Cargo.toml",
59-
"TargetDir": "<TestRoot>\\workspace_mixed\\target",
60-
"AdditionalTestDiscoveryArguments": "",
61-
"AdditionalTestExecutionArguments": "",
62-
"TestExecutionEnvironment": "",
63-
"Profile": "dev",
64-
"TestExe": "<not_yet_generated>"
65-
}
66-
},
67-
{
68-
"Item1": "<TestRoot>\\workspace_mixed\\target\\debug\\test2.rusttests",
69-
"Item2": {
70-
"ThisPath": "<TestRoot>\\workspace_mixed\\target\\debug\\test2.rusttests",
71-
"Manifest": "<TestRoot>\\workspace_mixed\\Cargo.toml",
72-
"TargetDir": "<TestRoot>\\workspace_mixed\\target",
73-
"AdditionalTestDiscoveryArguments": "",
74-
"AdditionalTestExecutionArguments": "",
75-
"TestExecutionEnvironment": "",
76-
"Profile": "dev",
77-
"TestExe": "<not_yet_generated>"
78-
}
7953
}
8054
]

src/RustAnalyzer.TestAdapter.UnitTests/Cargo/ToolChainServiceTests.GetMetadataTestsAsync.workspace_mixed.approved.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"bin"
4848
],
4949
"TargetFileName": "bench1.exe",
50-
"IsRunnable": true,
50+
"IsRunnable": false,
5151
"CanHaveTests": false,
5252
"QualifiedTargetFileName": "[benchmark: shared\\] bench1.exe",
5353
"AdditionalBuildArgs": ""
@@ -62,7 +62,7 @@
6262
"bin"
6363
],
6464
"TargetFileName": "bench2.exe",
65-
"IsRunnable": true,
65+
"IsRunnable": false,
6666
"CanHaveTests": false,
6767
"QualifiedTargetFileName": "[benchmark: shared\\] bench2.exe",
6868
"AdditionalBuildArgs": ""
@@ -177,8 +177,8 @@
177177
"bin"
178178
],
179179
"TargetFileName": "test1.exe",
180-
"IsRunnable": true,
181-
"CanHaveTests": true,
180+
"IsRunnable": false,
181+
"CanHaveTests": false,
182182
"QualifiedTargetFileName": "[test: \\] test1.exe",
183183
"AdditionalBuildArgs": ""
184184
},
@@ -192,8 +192,8 @@
192192
"bin"
193193
],
194194
"TargetFileName": "test2.exe",
195-
"IsRunnable": true,
196-
"CanHaveTests": true,
195+
"IsRunnable": false,
196+
"CanHaveTests": false,
197197
"QualifiedTargetFileName": "[test: \\] test2.exe",
198198
"AdditionalBuildArgs": ""
199199
},
@@ -207,7 +207,7 @@
207207
"bin"
208208
],
209209
"TargetFileName": "bench1.exe",
210-
"IsRunnable": true,
210+
"IsRunnable": false,
211211
"CanHaveTests": false,
212212
"QualifiedTargetFileName": "[benchmark: \\] bench1.exe",
213213
"AdditionalBuildArgs": ""

src/RustAnalyzer.TestAdapter.UnitTests/Cargo/ToolChainServiceTests.GetTestSuiteTestsAsync.hello_library.approved.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"container": "<TestRoot>\\hello_library\\target\\release\\hello_lib.rusttests",
2+
"container": "<TestRoot>\\hello_library\\target\\release\\hello_lib_libhello_lib.rusttests",
33
"tests": [
44
{
55
"type": "test",
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"container": "<TestRoot>\\hello_world\\target\\release\\hello_world.rusttests",
2+
"container": "<TestRoot>\\hello_world\\target\\release\\hello_world_hello_world.rusttests",
33
"tests": []
44
}

src/RustAnalyzer.TestAdapter.UnitTests/Cargo/ToolChainServiceTests.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
using ApprovalTests;
55
using ApprovalTests.Namers;
66
using ApprovalTests.Reporters;
7-
using ApprovalTests.Reporters.TestFrameworks;
87
using FluentAssertions;
98
using KS.RustAnalyzer.TestAdapter.Cargo;
109
using KS.RustAnalyzer.TestAdapter.Common;
@@ -22,7 +21,7 @@ public sealed class ToolChainServiceTests
2221
[InlineData(@"hello_world")]
2322
[InlineData(@"hello_workspace")]
2423
[InlineData(@"workspace_mixed")]
25-
[UseReporter(typeof(XUnit2Reporter))]
24+
[UseReporter(typeof(RaVsDiffReporter))]
2625
public async Task GetMetadataTestsAsync(string workspaceRelRoot)
2726
{
2827
NamerFactory.AdditionalInformation = workspaceRelRoot.ReplaceInvalidChars();
@@ -83,7 +82,7 @@ public async Task RootPackageIsAddedAsync(string workspaceRelRoot)
8382
[InlineData(@"hello_library", "dev")]
8483
[InlineData(@"hello_workspace", "dev")]
8584
[InlineData(@"workspace_mixed", "dev")]
86-
[UseReporter(typeof(XUnit2Reporter))]
85+
[UseReporter(typeof(RaVsDiffReporter))]
8786
public async Task BuildTestsAsync(string workspaceRelRoot, string profile)
8887
{
8988
NamerFactory.AdditionalInformation = workspaceRelRoot.ReplaceInvalidChars();
@@ -115,9 +114,9 @@ public async Task AdditionalBuildArgsTestsAsync(string workspaceRelRoot, string
115114
}
116115

117116
[Theory]
118-
[InlineData(@"hello_world", "hello_world.rusttests", "release")] // No tests.
119-
[InlineData(@"hello_library", "hello_lib.rusttests", "release")] // Has tests.
120-
[UseReporter(typeof(XUnit2Reporter))]
117+
[InlineData(@"hello_world", "hello_world_hello_world.rusttests", "release")] // No tests.
118+
[InlineData(@"hello_library", "hello_lib_libhello_lib.rusttests", "release")] // Has tests.
119+
[UseReporter(typeof(RaVsDiffReporter))]
121120
public async Task GetTestSuiteTestsAsync(string workspaceRelRoot, string containerName, string profile)
122121
{
123122
NamerFactory.AdditionalInformation = workspaceRelRoot.ReplaceInvalidChars();

src/RustAnalyzer.TestAdapter.UnitTests/RustAnalyzer.TestAdapter.UnitTests.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@
4141
<Reference Include="System.Xml" />
4242
</ItemGroup>
4343
<ItemGroup>
44+
<Compile Include="..\TestsCommon\RaVsDiffReporter.cs">
45+
<Link>Common\RaVsDiffReporter.cs</Link>
46+
</Compile>
4447
<Compile Include="..\TestsCommon\TestHelpers.cs">
4548
<Link>Common\TestHelpers.cs</Link>
4649
</Compile>

0 commit comments

Comments
 (0)