Skip to content

Commit

Permalink
adding log output to reindex tests (#3278)
Browse files Browse the repository at this point in the history
  • Loading branch information
v-mserdar authored May 3, 2023
1 parent 00ee876 commit d0b205a
Showing 1 changed file with 7 additions and 1 deletion.
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

0 comments on commit d0b205a

Please sign in to comment.