Commit Graph

56 Commits

Author SHA1 Message Date
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
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
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
Bjarke Berg
7b5012e00a Debug info for tests, to debug on Azure Devops
Signed-off-by: Bjarke Berg <mail@bergmania.dk>
2020-10-16 09:54:03 +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
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
7a8a7104c7 Merge remote-tracking branch 'origin/netcore/netcore' into netcore/feature/migrate-logging
# Conflicts:
#	src/Umbraco.Tests.UnitTests/Umbraco.Core/Manifest/ManifestParserTests.cs
#	src/Umbraco.Tests/IO/ShadowFileSystemTests.cs
2020-10-06 08:13:29 +02:00
Bjarke Berg
375a85903f Changed the UmbracoIntegrationTest setup to be sync, to avoid issue with AsyncLocal
Signed-off-by: Bjarke Berg <mail@bergmania.dk>
2020-10-05 10:02:11 +02:00
Bjarke Berg
3607dd14f1 Clean up + Removed old SignalR code
Signed-off-by: Bjarke Berg <mail@bergmania.dk>
2020-10-01 07:09:54 +02:00
Mole
cbdb96dfe6 Add SignalR in integration tests 2020-09-30 14:27:18 +02:00
Mole
8258178c5a Merge remote-tracking branch 'origin/netcore/netcore' into netcore/feature/migrate-logging
# Conflicts:
#	src/Umbraco.Infrastructure/Media/UploadAutoFillProperties.cs
#	src/Umbraco.Infrastructure/PropertyEditors/FileUploadPropertyEditor.cs
#	src/Umbraco.Infrastructure/PropertyEditors/ImageCropperPropertyEditor.cs
#	src/Umbraco.Tests/Models/MediaXmlTest.cs
#	src/Umbraco.Tests/Routing/MediaUrlProviderTests.cs
#	src/Umbraco.Web.BackOffice/Controllers/BackOfficeController.cs
#	src/Umbraco.Web.BackOffice/Controllers/MediaController.cs
2020-09-23 13:32:49 +02:00
Mole
3d52949938 Merge pull request #8944 from umbraco/netcore/bugfix/8856-user_culture_not_used_everywhere
Netcore: Bugfix for user culture not used everywhere
2020-09-23 09:58:30 +02:00
Mole
75608919cd Merge pull request #8925 from umbraco/netcore/feature/use-serilog-to-log-all-messages
Netcore: Use serilog to log all messages and use appsettings as config
2020-09-23 09:37:43 +02:00
Bjarke Berg
4880b16512 Fix tests
Signed-off-by: Bjarke Berg <mail@bergmania.dk>
2020-09-22 19:59:01 +02:00
Mole
438515fa66 Merge Netcore: Use serilog to log all messages and use appsettings as config into Netcore/feature/migrate logging 2020-09-22 15:09:16 +02:00
Mole
c0616d516a Merge remote-tracking branch 'origin/netcore/netcore' into netcore/feature/migrate-logging
# Conflicts:
#	src/Umbraco.Infrastructure/Scheduling/ScheduledPublishing.cs
#	src/Umbraco.Infrastructure/Scheduling/SchedulerComponent.cs
#	src/Umbraco.Tests.Integration/Umbraco.Web.BackOffice/Filters/ContentModelValidatorTests.cs
#	src/Umbraco.Web.BackOffice/Controllers/BackOfficeController.cs
#	src/Umbraco.Web.BackOffice/Controllers/CurrentUserController.cs
#	src/Umbraco.Web.BackOffice/Controllers/MacrosController.cs
#	src/Umbraco.Web.BackOffice/Controllers/PackageInstallController.cs
#	src/Umbraco.Web.BackOffice/Controllers/RedirectUrlManagementController.cs
#	src/Umbraco.Web.BackOffice/Controllers/UsersController.cs
#	src/Umbraco.Web.BackOffice/Filters/ContentModelValidator.cs
#	src/Umbraco.Web.BackOffice/Filters/ContentSaveModelValidator.cs
#	src/Umbraco.Web.BackOffice/Filters/ContentSaveValidationAttribute.cs
#	src/Umbraco.Web.BackOffice/Filters/MediaItemSaveValidationAttribute.cs
#	src/Umbraco.Web.BackOffice/Filters/MediaSaveModelValidator.cs
#	src/Umbraco.Web.BackOffice/Filters/MemberSaveModelValidator.cs
#	src/Umbraco.Web.BackOffice/Filters/MemberSaveValidationAttribute.cs
#	src/Umbraco.Web.BackOffice/Trees/ContentTreeController.cs
#	src/Umbraco.Web.BackOffice/Trees/ContentTreeControllerBase.cs
#	src/Umbraco.Web.BackOffice/Trees/MediaTreeController.cs
#	src/Umbraco.Web.Common/Install/InstallController.cs
2020-09-22 13:44:22 +02:00
Bjarke Berg
96facc4d35 Netcore: Introduce BackofficeSecurityAccessor (#8871)
* Introduced IWebSecurityAccessor

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

* Fixed tests

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

* Renamed WebSecurity to BackofficeSecurity and all related names

* Fixes typos

Co-authored-by: Elitsa Marinovska <elm@umbraco.dk>
2020-09-22 10:01:00 +02:00
Mole
d61b9f54fa Merge options 2020-09-18 12:53:06 +02:00
berg
f6f0687bf8 fix in syntax after merge
Signed-off-by: berg <mail@bergmania.dk>
2020-09-18 09:11:16 +02:00
berg
f11391961f Merge remote-tracking branch 'origin/netcore/netcore' into netcore/feature/use-serilog-to-log-all-messages
# Conflicts:
#	src/Umbraco.Tests.Integration/TestServerTest/UmbracoBuilderExtensions.cs
#	src/Umbraco.Web.Common/Extensions/UmbracoCoreServiceCollectionExtensions.cs
#	src/Umbraco.Web/UmbracoApplicationBase.cs
2020-09-18 08:31:09 +02:00
Bjarke Berg
7d3bc9be1c Moved serilog config to appsettings and configured it to also catch MS logging messages.
Added Console log for Development
2020-09-17 09:01:10 +02:00
Nikolaj
4492d48aef Inject IFactory and ILogger more places 2020-09-15 15:42:04 +02:00
Bjarke Berg
b7a48686f0 Updates based on review feedback 2020-09-15 13:18:01 +02:00
Bjarke Berg
e079bd5a50 Cleanup usages of Configs 2020-09-08 13:03:43 +02:00
Bjarke Berg
3efee8284a Post merge fixes 2020-09-07 15:28:58 +02:00
Bjarke Berg
c8669b18c2 Merge remote-tracking branch 'origin/netcore/netcore' into feature/8651-config-options-patten
Signed-off-by: Bjarke Berg <mail@bergmania.dk>
2020-09-04 14:30:48 +02:00
Shannon
855a58a3cc fix tests 2020-09-04 01:40:46 +10:00
Shannon
7c78b5b34f Updates CoreRuntime with better dependencies so we can disable caches, fixes integration test to run multiple callbacks registered for TearDown, ensure we TearDown the runtime. 2020-09-04 00:27:43 +10:00
Shannon
a5772f10e1 comments 2020-09-02 18:21:51 +10:00
Shannon
b5d2adaf25 remove explicit 2020-09-02 18:20:30 +10:00
Shannon
f84a93ae20 Adds IUmbracoBuilder to build the config so it's easier to split apart, ensures background tasks don't run in integration tests, uses a custom CoreRuntime to ensure we use SimpleMainDom, re-wires the UmbracoWebApplicationFactory so that duplicate Hosts are not running at the same time, fixes issues with overriding/shadowing, uses RAMDirectory in lucene for tests, fixes CoreRuntime's events that we're moved incorrectly and not backwards compat, adds new real non static events which we can use in integration tests to install the DB before the runtime state is calculated 2020-09-02 18:10:29 +10:00
Bjarke Berg
edd457c24b Force Examine to run in sync for integration tests 2020-08-31 11:31:56 +02:00
Bjarke Berg
3c2f2ac0b3 Netcore: Let build.ps1 create the dotnet new templates (#8591)
* Creates the Umbraco.Templates.nuspec on build

* Update nuspec to match nuget packages

* Updated namespace of Program.cs and Startup.cs and replace these with the project name in templates

* Bugfixes for sqlce

* Simplified template to have one template with --UseSqlCe as option

* Update build/build.ps1

Co-authored-by: Elitsa Marinovska <21998037+elit0451@users.noreply.github.com>

Co-authored-by: Elitsa Marinovska <21998037+elit0451@users.noreply.github.com>
2020-08-11 08:28:16 +02:00
Bjarke Berg
8322151426 Fix test issue. Now testserver tests always is executed in debugmode 2020-08-10 14:10:08 +02:00
Bjarke Berg
8dea65286b Fix test. Asserting on something irrelevant 2020-08-10 13:21:44 +02:00
Bjarke Berg
711e2306e0 Cleanup
Signed-off-by: Bjarke Berg <mail@bergmania.dk>
2020-07-07 15:02:53 +02:00
Bjarke Berg
254921e24c inserted explicit on failing tests.. Still need to investigate
Signed-off-by: Bjarke Berg <mail@bergmania.dk>
2020-07-07 14:10:00 +02:00
Bjarke Berg
4993e99f4d Merge remote-tracking branch 'origin/netcore/feature/fix-integration-tests' into netcore/feature/fix-integration-tests 2020-07-07 13:26:31 +02:00
Bjarke Berg
a67629e9c0 Merge remote-tracking branch 'origin/netcore/feature/remaining-backoffice-controllers' into netcore/feature/fix-integration-tests 2020-07-07 13:25:58 +02:00
Bjarke Berg
f3614d51fa Merge remote-tracking branch 'origin/netcore/feature/contentcontroller_and_related' into netcore/feature/remaining-backoffice-controllers
# Conflicts:
#	src/Umbraco.Web.BackOffice/Filters/UmbracoAuthorizeFilter.cs
2020-07-07 13:17:08 +02:00
Bjarke Berg
7e90db5b30 Cleanup based on review
Signed-off-by: Bjarke Berg <mail@bergmania.dk>
2020-07-06 13:01:25 +02:00
Bjarke Berg
8400b53f70 Cleanup based on review
Signed-off-by: Bjarke Berg <mail@bergmania.dk>
2020-07-06 12:55:23 +02:00
Bjarke Berg
aac8cd5423 Clean up + migrated AuditServiceTests 2020-07-01 17:42:39 +02:00
Bjarke Berg
7b546e6cee Attempts to fix issue
Signed-off-by: Bjarke Berg <mail@bergmania.dk>
2020-06-30 20:11:39 +02:00
Bjarke Berg
aedac5a2b4 Added test to TemplateQueryController.GetContentTypes to ensure camelcase
Signed-off-by: Bjarke Berg <mail@bergmania.dk>
2020-06-29 14:22:58 +02:00
Bjarke Berg
6d993eb63b Cleanup
Signed-off-by: Bjarke Berg <mail@bergmania.dk>
2020-06-26 13:58:15 +02:00
Bjarke Berg
f9d5acee84 Added test 2020-06-25 11:22:59 +02:00
Bjarke Berg
aaccaef6af Started on AutoMoqDataAttribute
Signed-off-by: Bjarke Berg <mail@bergmania.dk>
2020-06-24 22:00:27 +02:00