Skip to content

Commit

Permalink
Bump Microsoft.NET.Test.Sdk and Microsoft.TestPlatform.ObjectModel (#654
Browse files Browse the repository at this point in the history
)

* Bump Microsoft.NET.Test.Sdk and Microsoft.TestPlatform.ObjectModel

Bumps [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) and [Microsoft.TestPlatform.ObjectModel](https://github.com/microsoft/vstest). These dependencies needed to be updated together.

Updates `Microsoft.NET.Test.Sdk` from 17.9.0 to 17.10.0
- [Release notes](https://github.com/microsoft/vstest/releases)
- [Changelog](https://github.com/microsoft/vstest/blob/main/docs/releases.md)
- [Commits](microsoft/vstest@v17.9.0...v17.10.0)

Updates `Microsoft.TestPlatform.ObjectModel` from 17.9.0 to 17.10.0
- [Release notes](https://github.com/microsoft/vstest/releases)
- [Changelog](https://github.com/microsoft/vstest/blob/main/docs/releases.md)
- [Commits](microsoft/vstest@v17.9.0...v17.10.0)

---
updated-dependencies:
- dependency-name: Microsoft.NET.Test.Sdk
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: Microsoft.TestPlatform.ObjectModel
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* Update CHANGELOG.md

Signed-off-by: Thomas Farr <[email protected]>

* Skip GitHubIssue5363

Signed-off-by: Thomas Farr <[email protected]>

---------

Signed-off-by: dependabot[bot] <[email protected]>
Signed-off-by: Thomas Farr <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Thomas Farr <[email protected]>
  • Loading branch information
dependabot[bot] and Xtansia authored May 27, 2024
1 parent cdc572f commit 2bbf2c1
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 63 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Bumps `System.Diagnostics.DiagnosticSource` from 8.0.0 to 8.0.1
- Bumps `Spectre.Console` from 0.48.0 to 0.49.1
- Bumps `Nullean.VsTest.Pretty.TestLogger` from 0.3.0 to 0.4.0
- Bumps `Microsoft.NET.Test.Sdk` from 17.9.0 to 17.10.0
- Bumps `Microsoft.TestPlatform.ObjectModel` from 17.9.0 to 17.10.0

## [1.7.1]
### Fixed
Expand Down Expand Up @@ -188,4 +190,4 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
[1.6.0]: https://github.com/opensearch-project/opensearch-net/compare/v1.5.0...v1.6.0
[1.5.0]: https://github.com/opensearch-project/opensearch-net/compare/v1.4.0...v1.5.0
[1.4.0]: https://github.com/opensearch-project/opensearch-net/compare/v1.3.0...v1.4.0
[1.3.0]: https://github.com/opensearch-project/opensearch-net/compare/v1.2.0...v1.3.0
[1.3.0]: https://github.com/opensearch-project/opensearch-net/compare/v1.2.0...v1.3.0
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.0" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.0" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion tests/Tests.Auth.AwsSigV4/Tests.Auth.AwsSigV4.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="$(SolutionRoot)\tests\Tests.Core\Tests.Core.csproj" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.0" />
</ItemGroup>
</Project>
115 changes: 58 additions & 57 deletions tests/Tests.Reproduce/GitHubIssue5363.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,64 +34,65 @@
using OpenSearch.OpenSearch.Xunit.XunitPlumbing;
using OpenSearch.Net;
using OpenSearch.Net.Diagnostics;
using Tests.Core.Xunit;
using Xunit;

namespace Tests.Reproduce
namespace Tests.Reproduce;

[Skip("When run in parallel with other tests the diagnostic listener may throw null pointer exceptions")]
public class GitHubIssue5363
{
public class GitHubIssue5363
{
internal class TestDiagnosticListener : IObserver<DiagnosticListener>, IDisposable
{
private ConcurrentBag<IDisposable> Disposables { get; } = new();

public Action<IApiCallDetails> OnEnded { get; }

public TestDiagnosticListener(Action<IApiCallDetails> onEnded) => OnEnded = onEnded;

public void OnError(Exception error) { }
public void OnCompleted() { }

public void OnNext(DiagnosticListener value) =>
TrySubscribe(DiagnosticSources.RequestPipeline.SourceName,
() => new RequestPipelineDiagnosticObserver(null, v => OnEnded(v.Value)), value);

private void TrySubscribe(string sourceName, Func<IObserver<KeyValuePair<string, object>>> listener, DiagnosticListener value)
{
if (value.Name != sourceName)
return;
var d = value.Subscribe(listener());

Disposables.Add(d);
}

public void Dispose()
{
foreach (var d in Disposables)
{
d.Dispose();
}
}
}

[U]
public async Task DiagnosticListener_AuditTrailIsValid()
{
using var listener = new TestDiagnosticListener(data =>
{
var auditTrailEvent = data.AuditTrail[0];

Assert.True(auditTrailEvent.Ended != default);
});

using var foo = DiagnosticListener.AllListeners.Subscribe(listener);

var connectionPool = new SingleNodeConnectionPool(new Uri("http://localhost:9200"));
var settings = new ConnectionConfiguration(connectionPool, new InMemoryConnection());

var client = new OpenSearchLowLevelClient(settings);
var person = new { Id = "1" };

await client.IndexAsync<BytesResponse>("test-index", PostData.Serializable(person));
}
}
internal class TestDiagnosticListener : IObserver<DiagnosticListener>, IDisposable
{
private ConcurrentBag<IDisposable> Disposables { get; } = new();

public Action<IApiCallDetails> OnEnded { get; }

public TestDiagnosticListener(Action<IApiCallDetails> onEnded) => OnEnded = onEnded;

public void OnError(Exception error) { }
public void OnCompleted() { }

public void OnNext(DiagnosticListener value) =>
TrySubscribe(DiagnosticSources.RequestPipeline.SourceName,
() => new RequestPipelineDiagnosticObserver(null, v => OnEnded(v.Value)), value);

private void TrySubscribe(string sourceName, Func<IObserver<KeyValuePair<string, object>>> listener, DiagnosticListener value)
{
if (value.Name != sourceName)
return;
var d = value.Subscribe(listener());

Disposables.Add(d);
}

public void Dispose()
{
foreach (var d in Disposables)
{
d.Dispose();
}
}
}

[U]
public async Task DiagnosticListener_AuditTrailIsValid()
{
using var listener = new TestDiagnosticListener(data =>
{
var auditTrailEvent = data.AuditTrail[0];

Assert.True(auditTrailEvent.Ended != default);
});

using var foo = DiagnosticListener.AllListeners.Subscribe(listener);

var connectionPool = new SingleNodeConnectionPool(new Uri("http://localhost:9200"));
var settings = new ConnectionConfiguration(connectionPool, new InMemoryConnection());

var client = new OpenSearchLowLevelClient(settings);
var person = new { Id = "1" };

await client.IndexAsync<BytesResponse>("test-index", PostData.Serializable(person));
}
}
2 changes: 1 addition & 1 deletion tests/Tests.Reproduce/Tests.Reproduce.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="$(SolutionRoot)\tests\Tests.Core\Tests.Core.csproj" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.0" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion tests/Tests/Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="$(SolutionRoot)\tests\Tests.Core\Tests.Core.csproj" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="FSharp.Core" Version="8.0.300" />
<PackageReference Include="System.Reactive" Version="6.0.0" />
<PackageReference Include="SemanticVersioning" Version="2.0.2" />
Expand Down

0 comments on commit 2bbf2c1

Please sign in to comment.