Commit Graph

108 Commits

Author SHA1 Message Date
Paul Johnson
79aa2e1cc2 LocalDb TestDatabase cleanup
LocalDbTestDatabase now renames the final database like it used to (guid vs sensible name)
Made serilog log to integration tests TEMP as far as I can tell it wasn't writing at all before
2020-12-17 11:19:47 +00:00
Paul Johnson
431403e372 Fixup CoreRuntime so it starts after Startup.Configure
Makes integration tests play nice with Components as RuntimeLevel will be correct
2020-12-17 11:19:47 +00:00
Paul Johnson
a69739a7a2 Remove CoreInitialComponent 2020-12-17 11:17:46 +00:00
Paul Johnson
4dbe5d0c38 Consolidate LocalDbTestDatabase and SqlDeveloperTestDatabase
Resolve issue with multiple empties
2020-12-12 11:33:57 +00:00
Paul Johnson
312ab96277 Resolve issues with AdvancedMigrationTests 2020-12-11 19:04:39 +00:00
Paul Johnson
897fe804b0 Multiple test databases, similar setup to LocalDbTestDatabase.DatabasePool 2020-12-11 14:12:34 +00:00
Paul Johnson
51f20119a2 Enable running integrations tests on Linux 2020-12-11 14:12:34 +00:00
James Jackson-South
826e5a9bad Update to match new rules. And fix dup usings 2020-12-03 13:32:04 +00:00
James Jackson-South
0369375d8e Merge branch 'netcore/netcore' into netcore/feature/9397 2020-12-01 12:44:10 +00:00
James Jackson-South
748cbb1f7b Normalize builder namespace 2020-12-01 12:42:14 +00:00
Shannon
e0665973e3 Merge remote-tracking branch 'origin/netcore/netcore' into netcore/task/6666-auth-policies
# Conflicts:
#	src/Umbraco.Infrastructure/Runtime/CoreInitialComposer.cs
#	src/Umbraco.Web.BackOffice/Extensions/BackOfficeServiceCollectionExtensions.cs
#	src/Umbraco.Web.Common/Filters/UmbracoBackOfficeAuthorizeFilter.cs
#	src/Umbraco.Web.Common/Runtime/AspNetCoreComposer.cs
2020-11-25 11:55:16 +11:00
Paul Johnson
5268f9d7f0 Resolve review comments 2020-11-24 09:37:52 +00:00
Paul Johnson
a62079d794 Use OptionsMonitorAdapter over AspNetCoreHostingEnvironmentWithoutOptionsMonitor
Rollback Serilog setup as I broke BASEDIR env var
2020-11-23 10:27:13 +00:00
Paul Johnson
0241649f7f Cleanup AddUmbraco & AddUmbracoCore 2020-11-21 15:22:24 +00:00
Paul Johnson
39657dea6d UmbracoBuilder now requires TypeLoader via ctor 2020-11-20 12:18:25 +00:00
Paul Johnson
5b1ccb0659 Remove the crazy Func param on AddUmbracoCore 2020-11-20 11:13:53 +00:00
Paul Johnson
daf972fc62 Closer to removing all BuildServiceProvider calls 2020-11-19 22:02:19 +00:00
Paul Johnson
8b97ce69b1 Removed CoreRuntimeBootstrapper
Establish runtime level at run time not during service registration.
2020-11-19 20:21:45 +00:00
Paul Johnson
3672a9f2f2 Add composers via extension on UmbracoBuilder
reduce scope of CoreRuntimeBootstrapper
2020-11-19 16:20:39 +00:00
Paul Johnson
48b61ec4c4 Simplify UmbracoBuilder setup 2020-11-19 09:12:39 +00:00
Paul Johnson
aec25d5007 Replace Composition with UmbracoBuilder 2020-11-18 17:41:57 +00:00
Bjarke Berg
e46a248832 Merge remote-tracking branch 'origin/netcore/netcore' into netcore/task/6973-migrating-authenticationcontroller-merge
# Conflicts:
#	src/Umbraco.Infrastructure/HostedServices/ScheduledPublishing.cs
#	src/Umbraco.Infrastructure/Runtime/CoreInitialComposer.cs
#	src/Umbraco.Infrastructure/Scheduling/SchedulerComponent.cs
#	src/Umbraco.Infrastructure/Scheduling/SchedulerComposer.cs
#	src/Umbraco.Tests.Integration/Testing/UmbracoIntegrationTest.cs
#	src/Umbraco.Tests/Testing/UmbracoTestBase.cs
#	src/Umbraco.Web.BackOffice/Extensions/BackOfficeApplicationBuilderExtensions.cs
#	src/Umbraco.Web.BackOffice/Runtime/BackOfficeComposer.cs
#	src/Umbraco.Web.Common/Runtime/AspNetCoreComposer.cs
#	src/Umbraco.Web.Common/UmbracoContext/UmbracoContext.cs
#	src/Umbraco.Web.UI.NetCore/appsettings.json
#	src/Umbraco.Web/Editors/BackOfficeController.cs
#	src/Umbraco.Web/Runtime/WebInitialComponent.cs
2020-11-12 13:10:19 +01:00
Bjarke Berg
d756248c7c Merge remote-tracking branch 'origin/netcore/dev' into netcore/task/6973-migrating-authenticationcontroller-merge
# Conflicts:
#	src/Umbraco.Examine.Lucene/UmbracoContentIndex.cs
#	src/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/MediaServiceTests.cs
#	src/Umbraco.Tests/Services/MemberServiceTests.cs
#	src/Umbraco.Web.BackOffice/Controllers/PreviewController.cs
#	src/Umbraco.Web.BackOffice/Services/IconService.cs
#	src/Umbraco.Web.UI.NetCore/umbraco/UmbracoBackOffice/Preview.cshtml
#	src/Umbraco.Web.UI.NetCore/umbraco/config/lang/da.xml
#	src/Umbraco.Web.UI.NetCore/umbraco/config/lang/en.xml
#	src/Umbraco.Web.UI.NetCore/umbraco/config/lang/en_us.xml
#	src/Umbraco.Web.UI/config/umbracoSettings.config
2020-11-12 12:57:03 +01:00
Paul Johnson
8775770d76 Remove BuildServiceProvider call from UmbracoWebServiceCollectionExtensions (#9372) 2020-11-10 20:04:29 +01:00
Paul Johnson
3f5f85880e NetCore: MSDI refactor split CoreRuntime & Remove Current (#9356)
* Split Bootstrap code from CoreRuntime

* Make ContentService method signatures match interface
prevents need to hide the concrete class in tests

* Remove Current

Only bit that bugs me is TreeNode for IconFilePath
I get the feeling it's dead code, but can just use a setter in cs or work out path in js if required.

* Fix tests, remember to terminate IRuntime
2020-11-10 09:50:47 +01:00
Paul Johnson
4ae329589a NetCore: MSDI refactor remove IFactory & IRegister (#9308)
* Replace IFactory with IServiceProvider

* Replace IRegister with IServiceCollection

* Fix Rte.cshtml so the view can service locate.

* Replace Composing Lifetime with MSDI ServiceLifetime

* Remove ServiceProvider AddMultipleUnique extension

* Remove Umbraco.Web.Composing.Current.Reset and any calls

* Remove LightInject from net framework projects

* Brought back a helper for setting MediaFileSystem underlying IFileSystem
2020-10-30 12:16:17 +01:00
Bjarke Berg
0a05611826 Migrated ScopedRepositoryTests
Signed-off-by: Bjarke Berg <mail@bergmania.dk>
2020-10-29 14:08:01 +01:00
Bjarke Berg
cfaa353dff Fixed isses with NewEmpty* integration tests
Signed-off-by: Bjarke Berg <mail@bergmania.dk>
2020-10-28 14:54:16 +01:00
Bjarke Berg
765140b7cd Moved unit tests to right project + Cleanup + Write info in test console
Signed-off-by: Bjarke Berg <mail@bergmania.dk>
2020-10-27 14:10:19 +01:00
Bjarke Berg
4d260b036b Merge branch 'netcore/bugfix/azure-devops-tests' into netcore/netcore 2020-10-27 11:57:38 +01:00
Paul Johnson
ec66990e72 NetCore: MSDI refactor phase 2 (#9280)
* Moved adapters from Infra -> Core

* Allow Composition to accept a service collection instead of an IRegister

* Composition no longer takes IRegister as constructor arg

all tests passing

* Composition no longer implements IRegister

* Lose _uniques in Composition

* lose Composition OnCreatingFactory actions

* Clean up UmbracoCoreServiceCollectionExtensions & Composition

Less IFactory

* LightInject gone where TFW == netstandard2.0 || TFW == netcoreapp3.1

* Resolve dead code issues

* Rename IFactory methods to match IServiceProvider so they can be trivially swapped later.

* Rename IFactory methods to match IServiceProvider so they can be trivially swapped later (continued)

Thought the counts were low, it's mostly extension method usage
2020-10-27 11:53:01 +01:00
Bjarke Berg
a6ef907427 Merge remote-tracking branch 'origin/netcore/netcore' into netcore/bugfix/azure-devops-tests 2020-10-26 16:26:59 +01:00
Bjarke Berg
b47f946ffe Merge remote-tracking branch 'origin/netcore/netcore' into netcore/task/6973-migrating-authenticationcontroller
Signed-off-by: Bjarke Berg <mail@bergmania.dk>

# Conflicts:
#	src/Umbraco.Infrastructure/HealthCheck/NotificationMethods/EmailNotificationMethod.cs
#	src/Umbraco.Web/Editors/AuthenticationController.cs
2020-10-26 14:34:06 +01:00
Paul Johnson
a99f625f6a Netcore: Alternate approach for MSDI refactor (#9247)
* Doesn't make much sense to have Concrete on IRegister, only on IFactory

* Handle FilesTreeController requires IFileSystem of type PhysicalFileSystem

* Handle registration of default MediaFileSystem without using RegisterUniqueFor

* Remove RegisterFor / RegisterUniqueFor from IRegister

* Switch over from LightInject to wrappers around MSDI

* Made mapper dependencies more explicit

* Remove registration for AngularJsonMediaTypeFormatter

It's dependencies aren't registered so container validation fails

* Resolve lifetime issue for EnsureValidSessionId by service locating

else resolve scoped in singleton

* Make registration more explicit for backoffice UserManager

* Make install step registrations more explicit

* Disable service provider validation so site can launch

Maybe this is a problem maybe not, we build about 8000 service providers so maybe everything is fine later...

* Further cleanup of IFactory interface

* Further cleanup of IRegister interface

* Revert "Make registration more explicit for backoffice UserManager"

This reverts commit 7215fe836103c597cd0873c66737a79b91ed4c49.

* Resolve issue where NewInstallStep would fail to reset password for "SuperUser"

Before MSDI, somehow BackOfficeIdentityOptions would be configured with token provider map from IdentityBuilder.AddDefaultTokenProviders.
After switchover those config actions are lost.

Subclass IdentityBuilder to ensure BackOfficeIdentityOptions doesn't miss config setup upstream.

* Initialize current.

* Add todo to turn container validation back on.

* Migrated ScopeFileSystemsTests to integration tests

Signed-off-by: Bjarke Berg <mail@bergmania.dk>

* Resolve issue where MediaFileSystem was skipping ShadowFileSystem

* Attempt to fix ScopeFileSystemsTests on azure devops

Signed-off-by: Bjarke Berg <mail@bergmania.dk>

* Be interesting to know what the actual full path is in pipeline.

* Clarify intent of CreateMediaTest

Doesn't help resolve weird UnauthorizedAccessException but it cuts so much cognitive overhead for the future.

* Use ILoggerfactory rather than mock for the manually constructed file PhysicalFileSystem

* Maybe resolve failing test on azure pipeline.

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2020-10-26 11:47:14 +01:00
Shannon
2b1dfc5888 Merge remote-tracking branch 'origin/netcore/netcore' into netcore/task/6973-migrating-authenticationcontroller
# Conflicts:
#	src/Umbraco.Tests.Integration/Testing/UmbracoIntegrationTest.cs
#	src/Umbraco.Tests/Web/Mvc/UmbracoViewPageTests.cs
#	src/Umbraco.Web.BackOffice/Controllers/BackOfficeController.cs
#	src/Umbraco.Web/Editors/BackOfficeController.cs
#	src/Umbraco.Web/Mvc/UmbracoController.cs
2020-10-22 21:16:44 +11:00
Bjarke Berg
5ecc2676e3 Migrated ThreadSafetyServiceTest.cs 2020-10-21 13:54:22 +02:00
Shannon
d1b35deb43 Migrates remaining backofficecontroller but still a bunch of work to do , streamlines Backoffice to BackOffice (but is that what we want?) 2020-10-21 16:51:00 +11:00
Bjarke Berg
95197f6ae7 Debug info for tests, to debug on Azure Devops
Signed-off-by: Bjarke Berg <mail@bergmania.dk>
2020-10-18 17:01:52 +02:00
Bjarke Berg
ee1b4eff2c Debug info for tests, to debug on Azure Devops
Signed-off-by: Bjarke Berg <mail@bergmania.dk>
2020-10-16 09:52:39 +02:00
Bjarke Berg
fc89de9541 Debug info for tests, to debug on Azure Devops
Signed-off-by: Bjarke Berg <mail@bergmania.dk>
2020-10-16 09:49:20 +02:00
Bjarke Berg
38897c297f Debug info for tests, to debug on Azure Devops
Signed-off-by: Bjarke Berg <mail@bergmania.dk>
2020-10-16 08:38:25 +02:00
Bjarke Berg
d74ec6e130 Changed default test setting to Boot=false
Signed-off-by: Bjarke Berg <mail@bergmania.dk>
2020-10-16 07:08:50 +02:00
Bjarke Berg
76f87a1243 Clean up
Signed-off-by: Bjarke Berg <mail@bergmania.dk>
2020-10-14 08:30:45 +02:00
Andy Butland
ef962b6934 Migrated ContentServiceTests. 2020-10-11 22:31:54 +02:00
Andy Butland
a331e6db30 Removed Mocked entity static helpers from new test projects, so they are only used for legacy tests.
Created equivalent methods as static builder methods, that use the builders to construct the model objects.
2020-10-07 11:28:09 +02:00
Bjarke Berg
3551d6e65e Clean up and fixed todos
Signed-off-by: Bjarke Berg <mail@bergmania.dk>
2020-10-06 21:23:15 +02:00
Bjarke Berg
18828951a6 Clean up
Signed-off-by: Bjarke Berg <mail@bergmania.dk>
2020-10-06 20:04:13 +02:00
Bjarke Berg
baf2aaecab Merge remote-tracking branch 'origin/netcore/netcore' into netcore/feature/migrate-logging
Signed-off-by: Bjarke Berg <mail@bergmania.dk>

# Conflicts:
#	src/Umbraco.Infrastructure/Runtime/CoreInitialComposer.cs
#	src/Umbraco.Tests.Integration/Packaging/CreatedPackagesRepositoryTests.cs
#	src/Umbraco.Tests.Integration/Services/CachedDataTypeServiceTests.cs
#	src/Umbraco.Tests.Integration/Services/DataTypeServiceTests.cs
#	src/Umbraco.Tests.Integration/Services/MacroServiceTests.cs
#	src/Umbraco.Tests.Integration/Testing/UmbracoIntegrationTest.cs
#	src/Umbraco.Tests.UnitTests/Umbraco.Core/Services/LocalizedTextServiceTests.cs
2020-10-06 18:49:03 +02:00
Bjarke Berg
170aaa47a9 Changed the way we setup logging in integration tests, to respect the test option attribute
Signed-off-by: Bjarke Berg <mail@bergmania.dk>
2020-10-06 18:43:07 +02:00
Mole
c7aad452ee Clean 2020-10-06 14:16:29 +02:00