Bump HealthcareSharedPackageVersion from 6.1.10 to 6.1.29 (#2584)
* Bump HealthcareSharedPackageVersion from 6.1.10 to 6.1.29 Bumps `HealthcareSharedPackageVersion` from 6.1.10 to 6.1.29. Updates `Microsoft.Health.Abstractions` from 6.1.10 to 6.1.29 - [Release notes](https://github.com/microsoft/healthcare-shared-components/releases) - [Commits](https://github.com/microsoft/healthcare-shared-components/compare/6.1.10...6.1.29) Updates `Microsoft.Health.Api` from 6.1.10 to 6.1.29 - [Release notes](https://github.com/microsoft/healthcare-shared-components/releases) - [Commits](https://github.com/microsoft/healthcare-shared-components/compare/6.1.10...6.1.29) Updates `Microsoft.Health.Extensions.DependencyInjection` from 6.1.10 to 6.1.29 - [Release notes](https://github.com/microsoft/healthcare-shared-components/releases) - [Commits](https://github.com/microsoft/healthcare-shared-components/compare/6.1.10...6.1.29) Updates `Microsoft.Health.SqlServer` from 6.1.10 to 6.1.29 - [Release notes](https://github.com/microsoft/healthcare-shared-components/releases) - [Commits](https://github.com/microsoft/healthcare-shared-components/compare/6.1.10...6.1.29) Updates `Microsoft.Health.Test.Utilities` from 6.1.10 to 6.1.29 - [Release notes](https://github.com/microsoft/healthcare-shared-components/releases) - [Commits](https://github.com/microsoft/healthcare-shared-components/compare/6.1.10...6.1.29) Updates `Microsoft.Health.Core` from 6.1.10 to 6.1.29 - [Release notes](https://github.com/microsoft/healthcare-shared-components/releases) - [Commits](https://github.com/microsoft/healthcare-shared-components/compare/6.1.10...6.1.29) Updates `Microsoft.Health.Extensions.BuildTimeCodeGenerator` from 6.1.10 to 6.1.29 - [Release notes](https://github.com/microsoft/healthcare-shared-components/releases) - [Commits](https://github.com/microsoft/healthcare-shared-components/compare/6.1.10...6.1.29) Updates `Microsoft.Health.SqlServer.Api` from 6.1.10 to 6.1.29 - [Release notes](https://github.com/microsoft/healthcare-shared-components/releases) - [Commits](https://github.com/microsoft/healthcare-shared-components/compare/6.1.10...6.1.29) Updates `Microsoft.Health.Tools.Sql.Tasks` from 6.1.10 to 6.1.29 - [Release notes](https://github.com/microsoft/healthcare-shared-components/releases) - [Commits](https://github.com/microsoft/healthcare-shared-components/compare/6.1.10...6.1.29) Updates `Microsoft.Health.Client` from 6.1.10 to 6.1.29 - [Release notes](https://github.com/microsoft/healthcare-shared-components/releases) - [Commits](https://github.com/microsoft/healthcare-shared-components/compare/6.1.10...6.1.29) --- updated-dependencies: - dependency-name: Microsoft.Health.Abstractions dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: Microsoft.Health.Api dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: Microsoft.Health.Extensions.DependencyInjection dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: Microsoft.Health.SqlServer dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: Microsoft.Health.Test.Utilities dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: Microsoft.Health.Core dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: Microsoft.Health.Extensions.BuildTimeCodeGenerator dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: Microsoft.Health.SqlServer.Api dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: Microsoft.Health.Tools.Sql.Tasks dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: Microsoft.Health.Client dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * Fixes build errors * Updated test files Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Richa Bansal <57157506+rbans96@users.noreply.github.com> Co-authored-by: Richa Bansal <ribans@microsoft.com> Co-authored-by: apurvabhale <apurvabhale@microsoft.com>
This commit is contained in:
Родитель
e1818dbb8a
Коммит
458fd2efe7
|
@ -26,7 +26,7 @@
|
|||
<PropertyGroup>
|
||||
<RuntimePackageVersion>5.0.0</RuntimePackageVersion>
|
||||
<AspNetPackageVersion>5.0.16</AspNetPackageVersion>
|
||||
<HealthcareSharedPackageVersion>6.1.10</HealthcareSharedPackageVersion>
|
||||
<HealthcareSharedPackageVersion>6.1.29</HealthcareSharedPackageVersion>
|
||||
<Hl7FhirVersion>3.8.2</Hl7FhirVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
|
|
|
@ -10,14 +10,18 @@ using System.Threading.Tasks;
|
|||
using EnsureThat;
|
||||
using MediatR;
|
||||
using Microsoft.Data.SqlClient;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Logging.Abstractions;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Microsoft.Health.Extensions.DependencyInjection;
|
||||
using Microsoft.Health.Fhir.SqlServer.Features.Schema;
|
||||
using Microsoft.Health.Fhir.SqlServer.Features.Storage;
|
||||
using Microsoft.Health.SqlServer;
|
||||
using Microsoft.Health.SqlServer.Configs;
|
||||
using Microsoft.Health.SqlServer.Features.Client;
|
||||
using Microsoft.Health.SqlServer.Features.Schema;
|
||||
using Microsoft.Health.SqlServer.Features.Schema.Manager;
|
||||
using Microsoft.Health.SqlServer.Features.Storage;
|
||||
using NSubstitute;
|
||||
using Polly;
|
||||
using Polly.Retry;
|
||||
|
@ -217,15 +221,33 @@ namespace Microsoft.Health.Fhir.Tests.Integration.Persistence
|
|||
var schemaOptions = new SqlServerSchemaOptions { AutomaticUpdatesEnabled = true };
|
||||
var config = Options.Create(new SqlServerDataStoreConfiguration { ConnectionString = testConnectionString, Initialize = true, SchemaOptions = schemaOptions, StatementTimeout = TimeSpan.FromMinutes(10) });
|
||||
var schemaInformation = new SchemaInformation(SchemaVersionConstants.Min, maxSupportedSchemaVersion);
|
||||
var scriptProvider = new ScriptProvider<SchemaVersion>();
|
||||
var baseScriptProvider = new BaseScriptProvider();
|
||||
var mediator = Substitute.For<IMediator>();
|
||||
var sqlConnectionStringProvider = new DefaultSqlConnectionStringProvider(config);
|
||||
var defaultSqlConnectionBuilder = new DefaultSqlConnectionBuilder(sqlConnectionStringProvider, SqlConfigurableRetryFactory.CreateNoneRetryProvider());
|
||||
var schemaManagerDataStore = new SchemaManagerDataStore(defaultSqlConnectionBuilder, config, NullLogger<SchemaManagerDataStore>.Instance);
|
||||
var schemaUpgradeRunner = new SchemaUpgradeRunner(scriptProvider, baseScriptProvider, NullLogger<SchemaUpgradeRunner>.Instance, defaultSqlConnectionBuilder, schemaManagerDataStore);
|
||||
|
||||
return new SchemaInitializer(config, schemaManagerDataStore, schemaUpgradeRunner, schemaInformation, defaultSqlConnectionBuilder, sqlConnectionStringProvider, mediator, NullLogger<SchemaInitializer>.Instance);
|
||||
var sqlConnection = Substitute.For<ISqlConnectionBuilder>();
|
||||
sqlConnection.GetSqlConnectionAsync(Arg.Any<string>(), Arg.Any<CancellationToken>()).ReturnsForAnyArgs((x) => GetSqlConnection(testConnectionString));
|
||||
SqlRetryLogicBaseProvider sqlRetryLogicBaseProvider = SqlConfigurableRetryFactory.CreateFixedRetryProvider(new SqlClientRetryOptions().Settings);
|
||||
|
||||
var sqlConnectionWrapperFactory = new SqlConnectionWrapperFactory(new SqlTransactionHandler(), sqlConnection, sqlRetryLogicBaseProvider, config);
|
||||
var schemaManagerDataStore = new SchemaManagerDataStore(sqlConnectionWrapperFactory, config, NullLogger<SchemaManagerDataStore>.Instance);
|
||||
var schemaUpgradeRunner = new SchemaUpgradeRunner(new ScriptProvider<SchemaVersion>(), new BaseScriptProvider(), NullLogger<SchemaUpgradeRunner>.Instance, sqlConnectionWrapperFactory, schemaManagerDataStore);
|
||||
|
||||
Func<IServiceProvider, SchemaUpgradeRunner> schemaUpgradeRunnerFactory = p => schemaUpgradeRunner;
|
||||
Func<IServiceProvider, IReadOnlySchemaManagerDataStore> schemaManagerDataStoreFactory = p => schemaManagerDataStore;
|
||||
|
||||
var collection = new ServiceCollection();
|
||||
collection.AddScoped(schemaUpgradeRunnerFactory);
|
||||
collection.AddScoped(schemaManagerDataStoreFactory);
|
||||
var serviceProvider = collection.BuildServiceProvider();
|
||||
return new SchemaInitializer(serviceProvider, config, schemaInformation, defaultSqlConnectionBuilder, sqlConnectionStringProvider, Substitute.For<IMediator>(), NullLogger<SchemaInitializer>.Instance);
|
||||
}
|
||||
|
||||
protected async Task<SqlConnection> GetSqlConnection(string connectionString)
|
||||
{
|
||||
var connectionBuilder = new SqlConnectionStringBuilder(connectionString);
|
||||
var result = new SqlConnection(connectionBuilder.ToString());
|
||||
await result.OpenAsync();
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using System.Numerics;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using MediatR;
|
||||
using Microsoft.Data.SqlClient;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
@ -85,13 +86,25 @@ namespace Microsoft.Health.Fhir.Tests.Integration.Persistence
|
|||
var baseScriptProvider = new BaseScriptProvider();
|
||||
var mediator = Substitute.For<IMediator>();
|
||||
var sqlSortingValidator = new SqlServerSortingValidator(SchemaInformation);
|
||||
var sqlRetryLogicBaseProvider = SqlConfigurableRetryFactory.CreateNoneRetryProvider();
|
||||
SqlRetryLogicBaseProvider sqlRetryLogicBaseProvider = SqlConfigurableRetryFactory.CreateFixedRetryProvider(new SqlClientRetryOptions().Settings);
|
||||
|
||||
var sqlConnectionStringProvider = new DefaultSqlConnectionStringProvider(config);
|
||||
SqlConnectionBuilder = new DefaultSqlConnectionBuilder(sqlConnectionStringProvider, sqlRetryLogicBaseProvider);
|
||||
var schemaManagerDataStore = new SchemaManagerDataStore(SqlConnectionBuilder, config, NullLogger<SchemaManagerDataStore>.Instance);
|
||||
_schemaUpgradeRunner = new SchemaUpgradeRunner(scriptProvider, baseScriptProvider, NullLogger<SchemaUpgradeRunner>.Instance, SqlConnectionBuilder, schemaManagerDataStore);
|
||||
_schemaInitializer = new SchemaInitializer(config, schemaManagerDataStore, _schemaUpgradeRunner, SchemaInformation, SqlConnectionBuilder, sqlConnectionStringProvider, mediator, NullLogger<SchemaInitializer>.Instance);
|
||||
|
||||
var sqlConnection = Substitute.For<ISqlConnectionBuilder>();
|
||||
sqlConnection.GetSqlConnectionAsync(Arg.Any<string>(), Arg.Any<CancellationToken>()).ReturnsForAnyArgs((x) => GetSqlConnection(TestConnectionString));
|
||||
var sqlConnectionWrapperFactory = new SqlConnectionWrapperFactory(new SqlTransactionHandler(), sqlConnection, sqlRetryLogicBaseProvider, config);
|
||||
var schemaManagerDataStore = new SchemaManagerDataStore(sqlConnectionWrapperFactory, config, NullLogger<SchemaManagerDataStore>.Instance);
|
||||
_schemaUpgradeRunner = new SchemaUpgradeRunner(scriptProvider, baseScriptProvider, NullLogger<SchemaUpgradeRunner>.Instance, sqlConnectionWrapperFactory, schemaManagerDataStore);
|
||||
|
||||
Func<IServiceProvider, SchemaUpgradeRunner> schemaUpgradeRunnerFactory = p => _schemaUpgradeRunner;
|
||||
Func<IServiceProvider, IReadOnlySchemaManagerDataStore> schemaManagerDataStoreFactory = p => schemaManagerDataStore;
|
||||
|
||||
var collection = new ServiceCollection();
|
||||
collection.AddScoped(schemaUpgradeRunnerFactory);
|
||||
collection.AddScoped(schemaManagerDataStoreFactory);
|
||||
var serviceProviderSchemaInitializer = collection.BuildServiceProvider();
|
||||
_schemaInitializer = new SchemaInitializer(serviceProviderSchemaInitializer, config, SchemaInformation, SqlConnectionBuilder, sqlConnectionStringProvider, mediator, NullLogger<SchemaInitializer>.Instance);
|
||||
|
||||
_searchParameterDefinitionManager = new SearchParameterDefinitionManager(ModelInfoProvider.Instance, _mediator, () => _searchService.CreateMockScope(), NullLogger<SearchParameterDefinitionManager>.Instance);
|
||||
|
||||
|
@ -246,6 +259,14 @@ namespace Microsoft.Health.Fhir.Tests.Integration.Persistence
|
|||
await _testHelper.DeleteDatabase(_databaseName, CancellationToken.None);
|
||||
}
|
||||
|
||||
protected async Task<SqlConnection> GetSqlConnection(string connectionString)
|
||||
{
|
||||
var connectionBuilder = new SqlConnectionStringBuilder(connectionString);
|
||||
var result = new SqlConnection(connectionBuilder.ToString());
|
||||
await result.OpenAsync();
|
||||
return result;
|
||||
}
|
||||
|
||||
object IServiceProvider.GetService(Type serviceType)
|
||||
{
|
||||
if (serviceType == typeof(IFhirDataStore))
|
||||
|
|
|
@ -11,8 +11,10 @@ using System.Threading;
|
|||
using System.Threading.Tasks;
|
||||
using MediatR;
|
||||
using Microsoft.Data.SqlClient;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Logging.Abstractions;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Microsoft.Health.Extensions.DependencyInjection;
|
||||
using Microsoft.Health.Fhir.Core.Configs;
|
||||
using Microsoft.Health.Fhir.Core.Features.Definition;
|
||||
using Microsoft.Health.Fhir.Core.Features.Search;
|
||||
|
@ -149,20 +151,27 @@ namespace Microsoft.Health.Fhir.Tests.Integration.Persistence
|
|||
var mediator = Substitute.For<IMediator>();
|
||||
|
||||
var schemaManagerDataStore = new SchemaManagerDataStore(
|
||||
defaultSqlConnectionBuilder,
|
||||
defaultSqlConnectionWrapperFactory,
|
||||
config,
|
||||
NullLogger<SchemaManagerDataStore>.Instance);
|
||||
var schemaUpgradeRunner = new SchemaUpgradeRunner(
|
||||
scriptProvider,
|
||||
baseScriptProvider,
|
||||
NullLogger<SchemaUpgradeRunner>.Instance,
|
||||
defaultSqlConnectionBuilder,
|
||||
defaultSqlConnectionWrapperFactory,
|
||||
schemaManagerDataStore);
|
||||
|
||||
Func<IServiceProvider, SchemaUpgradeRunner> schemaUpgradeRunnerFactory = p => schemaUpgradeRunner;
|
||||
Func<IServiceProvider, IReadOnlySchemaManagerDataStore> schemaManagerDataStoreFactory = p => schemaManagerDataStore;
|
||||
|
||||
var collection = new ServiceCollection();
|
||||
collection.AddScoped(schemaUpgradeRunnerFactory);
|
||||
collection.AddScoped(schemaManagerDataStoreFactory);
|
||||
var serviceProviderSchemaInitializer = collection.BuildServiceProvider();
|
||||
|
||||
var schemaInitializer = new SchemaInitializer(
|
||||
serviceProviderSchemaInitializer,
|
||||
config,
|
||||
schemaManagerDataStore,
|
||||
schemaUpgradeRunner,
|
||||
schemaInformation,
|
||||
defaultSqlConnectionBuilder,
|
||||
sqlConnectionStringProvider,
|
||||
|
|
Загрузка…
Ссылка в новой задаче