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

adding log output to reindex tests #3278

Merged
merged 1 commit into from
May 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
using Newtonsoft.Json;
using NSubstitute;
using Xunit;
using Xunit.Abstractions;
using Task = System.Threading.Tasks.Task;

namespace Microsoft.Health.Fhir.Tests.Integration.Features.Operations.Reindex
Expand Down Expand Up @@ -73,6 +74,7 @@ public class ReindexJobTests : IClassFixture<FhirStorageTestsFixture>, IAsyncLif
private SearchParameterStatusManager _searchParameterStatusManager2;
private readonly ISearchParameterSupportResolver _searchParameterSupportResolver = Substitute.For<ISearchParameterSupportResolver>();

private readonly ITestOutputHelper _output;
private ReindexJobWorker _reindexJobWorker;
private IScoped<ISearchService> _searchService;

Expand All @@ -82,10 +84,11 @@ public class ReindexJobTests : IClassFixture<FhirStorageTestsFixture>, IAsyncLif
private ISearchParameterOperations _searchParameterOperations2 = null;
private readonly IDataStoreSearchParameterValidator _dataStoreSearchParameterValidator = Substitute.For<IDataStoreSearchParameterValidator>();

public ReindexJobTests(FhirStorageTestsFixture fixture)
public ReindexJobTests(FhirStorageTestsFixture fixture, ITestOutputHelper output)
{
_fixture = fixture;
_testHelper = _fixture.TestHelper;
_output = output;
}

public async Task InitializeAsync()
Expand Down Expand Up @@ -838,6 +841,9 @@ private async Task<ReindexJobWrapper> PerformReindexingOperation(
}
}

var serializer = new FhirJsonSerializer();
_output.WriteLine(serializer.SerializeToString(reindexJobWrapper.ToParametersResourceElement().ToPoco<Parameters>()));

Assert.True(
operationStatus == reindexJobWrapper.JobRecord.Status,
$"Current job status '{reindexJobWrapper.JobRecord.Status}'. Expected job status '{operationStatus}'. Number of attempts: {delayCount}. Time elapsed: {stopwatch.Elapsed}.");
Expand Down