Skip to content

Commit

Permalink
Fix integration tests on Windows when using Linux containers (#888)
Browse files Browse the repository at this point in the history
  • Loading branch information
pjanotti authored Jun 28, 2022
1 parent 75d0f22 commit 20508f7
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ for more details.
| `AspNet` | ASP.NET Core | * | source |
| `GraphQL` | [GraphQL](https://www.nuget.org/packages/GraphQL/) | ≥2.3.0 & < 3.0.0 | bytecode |
| `HttpClient` | [System.Net.Http.HttpClient](https://docs.microsoft.com/dotnet/api/system.net.http.httpclient) and [System.Net.HttpWebRequest](https://docs.microsoft.com/dotnet/api/system.net.httpwebrequest) | * | source |
| `MongoDb` | [MongoDB.Driver.Core](https://www.nuget.org/packages/MongoDB.Driver.Core) | ≥2.3.0 & < 3.0.0 | source & bytecode |
| `MongoDb` | [MongoDB.Driver.Core](https://www.nuget.org/packages/MongoDB.Driver.Core) **Not supported on .NET Framework** | ≥2.3.0 & < 3.0.0 | source & bytecode |
| `SqlClient` | [Microsoft.Data.SqlClient](https://www.nuget.org/packages/Microsoft.Data.SqlClient) and [System.Data.SqlClient](https://www.nuget.org/packages/System.Data.SqlClient) | * | source |

### Instrumented metrics libraries and frameworks
Expand Down
2 changes: 2 additions & 0 deletions test/IntegrationTests/MongoDbCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
// limitations under the License.
// </copyright>

#if !NETFRAMEWORK
using System.Threading.Tasks;
using DotNet.Testcontainers.Builders;
using DotNet.Testcontainers.Containers;
Expand Down Expand Up @@ -75,3 +76,4 @@ private async Task ShutdownMongoContainerAsync(TestcontainersContainer container
await container.DisposeAsync();
}
}
#endif
5 changes: 2 additions & 3 deletions test/IntegrationTests/MongoDbTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@
// limitations under the License.
// </copyright>

#if !NETFRAMEWORK
using System;
#if NETCOREAPP
using System.Collections.Generic;
#endif
using System.Linq;
using System.Text.RegularExpressions;
using IntegrationTests.Helpers;
Expand Down Expand Up @@ -91,3 +89,4 @@ public void SubmitsTraces()
}
}
}
#endif
10 changes: 5 additions & 5 deletions test/IntegrationTests/SqlTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
// </copyright>

using System;
using System.Collections.Generic;
using FluentAssertions;
using FluentAssertions.Execution;
using IntegrationTests.Helpers;
Expand Down Expand Up @@ -59,11 +60,10 @@ public void SubmitTraces()
{
span.Service.Should().Be(ServiceName);
span.Name.Should().Be("master");
span.Tags["db.system"].Should().Be("mssql");
span.Tags["db.name"].Should().Be("master");
span.Tags["peer.service"].Should().Contain($"{_sqlClientFixture.Port}");
span.Tags["db.statement_type"].Should().Be("Text");
span.Tags["span.kind"].Should().Be("client");
span.Tags.Should().Contain(new KeyValuePair<string, string>("db.system", "mssql"));
span.Tags.Should().Contain(new KeyValuePair<string, string>("db.name", "master"));
span.Tags.Should().Contain(new KeyValuePair<string, string>("peer.service", $"localhost,{_sqlClientFixture.Port}"));
span.Tags.Should().Contain(new KeyValuePair<string, string>("span.kind", "client"));
}
}
}
Expand Down

0 comments on commit 20508f7

Please sign in to comment.