Commit Graph

157 Commits

Author SHA1 Message Date
Javier Calvarro Nelson 9f1a978230
[Infrastructure improvements] (#8275)
* Improved selenium start and tear down
  * Selenium is set up and torn down in an assembly fixture.
  * Selenium is initialized lazily and in a non-blocking way.
  * Selenium processes are tracked as part of the build and their pids
    written to a file on disk for cleanup in the event of unexpected
    termination of the test process.
  * Browser fixture retries with linear backoff to create a remote
    driver. Under heavy load (like when we are doing a simultaneous NPM
    restore) the selenium server can become unresponsive so we retry
    three times, with a longer comand timeout allowance each time up to
    a max of 3 minutes.
* Moved test project setup to build time instead of runtime.
  * Added target PrepareForTest to create the required files for testing
    * The template creation folder.
    * The template props file to use our built packages.
    * The folder for the custom hive.
  * Added assembly metadata attributes to find all the data we need to
    run the tests.
    * Path to the artifacts shipping packages folder.
    * Path to the artifacts non-shipping packages folder.
    * Path to the test templates creation folder.
    * Path to use for the custom templating hive used in tests.
  * Proper cleanup as part of the build
    * Remove the test templates creation folder.
    * Remove the test packages restore path.
    * Recreate the test templates creation folder.
    * Recreate the test packages restore path.
  * Generated Directory.Build.Props and Directory.Build.Targets in the
    test templates creation folder.
  * Cleaned up potentially stale templatetestsprops.
* Improved test flows
  * Initialization is done lazily and asynchronously.
    * Selenium
    * Browser fixture
    * Template initialization.
  * Flattened test flows to avoid assertions inside deep callstacks.
    * All assertions happen at the test level with improved error messages.
      * With the exception of the migrations assertions.
    * Assertions contain information about which step failed, for what
      project and what failure details.
  * Broke down tests to perform individual steps instead of mixing build
    and publish.
    * Publish project.
    * Build project. (Debug)
    * Run built project.
    * Run published project.
  * Concentrated build logic into the Project class.
    * Context between the different steps of a test is maintained in
      this class.
    * All operations that require coordination are performed within this
      class.
      * There is a lock for dotnet and a lock for nodejs. When building
        SPAs we acquire the nodejs lock to correctly prevent multiple
        runs of nodejs in parallel.

[ApiAuthorization template cleanups]
  * Fix preview3 issues with breaking changes on Entity framework by
    manually configuring the model in ApiAuthorizationDbContext.
  * Add app.db to the project file when using local db.
  * Fix linting errors on angular template.
  * Fix react tests
  * Add tests to cover new auth options in the SPA templates.
2019-03-20 08:44:20 +01:00
Doug Bunting bcead68f0c React to EntityFrameworkCore and AspNetCore-Tooling breaking changes
- avoid `[Obsolete]` EF Core method
- mirror recent `RazorIntegrationTestBase` changes in this repo
2019-03-18 19:36:09 -07:00
Ryan Nowak 30d0afca05 Remove DisplayName overload from health checks
The builder now provides this directly.
2019-03-13 20:12:53 -07:00
Ryan Nowak e78a6521b9 Make naming of IEndpointRouteBuilderConsistent across usages. 2019-03-13 20:12:53 -07:00
Ryan Nowak d329cca17d Change APIs to internal in Diagnostics
These types are still used, but we don't want them to be public.
2019-03-13 13:15:06 -07:00
James Newton-King 21b20afb1d
Add friendly error message for when healthchecks services not registered (#8146) 2019-03-12 11:32:58 -07:00
Chris Baudin 77948feeba Update reference assemblies for health checks. 2019-03-11 20:56:08 -07:00
Chris Baudin 484978fe59 Update the health check endpoint route builder extensions to make the endpoint display name configurable. (#8359) 2019-03-11 20:56:08 -07:00
Pranav K 41e6fc8ab0 Use ApplicationPartFactory when adding application parts
Fixes https://github.com/aspnet/AspNetCore/issues/8288
2019-03-07 13:38:31 -08:00
Chris Ross 6db129a588
Support conditional compression #6925 (#8239) 2019-03-07 11:09:48 -08:00
Andrew Stanton-Nurse 7fb3d57f54
Skip some more flaky tests (#8194) 2019-03-07 09:40:26 -08:00
Ryan Nowak 8a46e8cd93 Update SpaDefaultPageMiddleware for endpoints
This change makes the SpaDefaultPageMiddleware noop when an endpoint has
been chosen. This is a problem today because this usually runs after
routing, but its always terminal.

So even if endpoint routing selected something, this would still serve
the default file. We're adding more things that fill this niche, but it
seems like a good idea to fix the existing stuff.
2019-03-06 09:48:07 -08:00
Ryan Nowak 089f64c528 Add fallback routing to file
This is a new routing feature that integrates static files to serve a
static file when routing doesn't match anything else.

This is a scenario that's covered by SPA services today, but given the
improvements to routing it makes much more sense to move lower in the
stack.
2019-03-06 09:48:07 -08:00
Ryan Nowak 7e63e2da43 Make StaticFiles Noop for middleware
Teaches all of the static files middleware (incl default files,
directory browser) to noop when an endpoint is selected. This is
desirable so you can place them after routing if you want with no ill
effect.
2019-03-06 09:48:07 -08:00
Chris Ross def25cb3de
Document the change policy for FileExtensionContentTypeProvider #2454 (#8213) 2019-03-05 13:50:48 -08:00
BrennanConroy 58ad7b7550
Fix build flakiness (#8211) 2019-03-05 12:59:21 -08:00
Ryan Brandenburg 414d8a514f
Add missing doc comments (#8035) 2019-03-05 10:01:20 -08:00
Chris Ross 93b195e566
Change SameSite default to None #2675 #4661 (#8043) 2019-03-01 16:22:12 -08:00
Hao Kung 3b16c69786 Skip NodeServices tests on helix (#8045)
NodeJs not installed on helix boxes by default currently

https://github.com/aspnet/AspNetCore/issues/8044 tracking this skip
2019-03-01 09:37:43 -08:00
Steve Sanderson 18c1b994df
Basic integration tests for NodeServices (#8029) 2019-02-28 17:58:57 +00:00
Nate McMaster e02e047dcb
Merge branch 'master' into merge/release/3.0-preview3-to-master 2019-02-24 09:31:17 -08:00
Nate McMaster 1b27c9905c
Update dependencies and react to changes (#7844)
* Add workaround for dotnet/sdk#2976
* Add new restore sources
* Update BAR manifest to point to  https://dotnetfeed.blob.core.windows.net/aspnet-aspnetcore/index.json
* Obsolete WithCulture
* Add retries to dockerbuild.sh
* Ensure each test run gets a unique in-memory database
2019-02-22 19:09:08 -08:00
Nate McMaster f0ef784783 Run yarn import to convert package-lock.json to yarn.lock 2019-02-22 13:30:19 -08:00
Nate McMaster 5be7d30231 Replace npm commands with yarn 2019-02-22 13:30:19 -08:00
Pavel Krymets 9355c7c1a5
Add reference assemblies support (#7764) 2019-02-21 14:33:35 -08:00
Pranav K 51e2bea403
Throw if CORS policy is configured to allow credentials and any origin (#7751)
* Throw if CORS policy is configured to allow credentials and any origin

Fixes https://github.com/aspnet/AspNetCore/issues/3106
2019-02-21 09:06:00 -08:00
Pranav K 5418698f39 Disable CORS functional tests from running in parallel
Fixes https://github.com/aspnet/AspNetCore-Internal/issues/1845
2019-02-21 06:20:11 -08:00
Nate McMaster 9a2db43848
Follow-up to VS2019 conversion (#7753)
* Set VS version in file to 16.0.0.0
* Fix for restore failure on Microsoft.AspNetCore.App.Runtime.csproj
2019-02-20 11:02:38 -08:00
Nate McMaster 85ae18c723
Make Visual Studio 2019 a prerequisite to building this repo (#7005)
Changes:

* Make Visual Studio 2019 a prerequisite for building this repo
* Update .sln files
* Update Windows SDK to 17134
* Update developer docs
* Disable ANCM tests
* Update to .NET Core SDK 3.0 Preview 2
* Use Microsoft.NET.Sdk.Razor as a package consistently accross the repo
* React to changes in metadata from Microsoft.NETCore.App
* React to changes in .NET Core SDK
* Attempt to workaround CodeCheck.ps1 failure which doesn't repro locally or on different agents. Possibly due to differences in the version of the PowerShell task?
* Remove dead YML file
* Rename usages of win7-{x64,x86} to win-{x64,x86}
* Update KoreBuild to 3.0.0-build-20190219.1
2019-02-20 09:53:53 -08:00
Chris Ross 4e44025a52
Replace IHostingEnvironment with IWebHostEnvironment (#7725) 2019-02-19 21:11:52 -08:00
Doug Bunting 3e0c75187c
Place limits on model binding collection size and recursion depth (#7214)
- #7052
- add MvcOptions.MaxModelBindingCollectionSize` and `MvcOptions.MaxModelBindingRecursionDepth`

nits:
- update syntax of a few `Resources.Designer.cs` files (I ran `/t:resx` on Mvc.sln)
- take VS suggestions in a few test classes
2019-02-19 15:17:56 -08:00
Nate McMaster 338de4710a
Automatically set 'PrivateAssets=All' for .Sources references (#7539)
When a `<Reference>` is named `*.Sources`, set PrivateAssets=All (exclude from generated nuspec) and IncludeAssets=ContentFiles (only consume content files, not .dll's)
2019-02-13 14:31:15 -08:00
Nate McMaster 3fd8a97af2
Add targets to generate the list of shared framework assemblies from project property (#7510)
Changes:
* Add support for a property, `IsAspNetCoreApp`, in the .csproj file of assemblies which are part of the shared framework. 
* Remove unused dependencies
* Remove reference which have become part of 'netcoreapp3.0'
2019-02-12 23:00:19 -08:00
Ryan Nowak c5d8f8c34e Update CORS package.json and friends
This is what NPM wants to do - why argue?
2019-02-11 16:19:27 -08:00
Javier Calvarro Nelson dbf746d210
[Antiforgery][Components][CORS] Remove obsolete APIs (#7459)
#7325
#7319
#7324
2019-02-11 10:38:31 -08:00
Justin Kotalik 35b99e44ce
Expose HttpResponse PipeWriter in Kestrel (#7110) 2019-02-08 17:24:26 -08:00
Hao Kung c9499e14e4
Run helix tests on master (#6728) 2019-02-07 09:20:08 -08:00
Ryan Brandenburg 28b56587b1
Handle PermanentRedirects in PrerenderTagHelpers (#7179)
Handle PermanentRedirects in PrerenderTagHelpers
2019-02-05 09:22:40 -08:00
Pranav K 00d58e84a2
Merge remote-tracking branch 'origin/release/2.2' 2019-02-01 13:41:59 -08:00
Pranav K c1a756c575 Skip test on OSX until this can be further diagnosed 2019-02-01 13:34:39 -08:00
Gérald Barré f1b24ccb92 Replace unsafe code with string.Create for hex generation (#6784) 2019-02-01 10:06:20 -08:00
Pranav K 51ec523d9e Attempt to install chromium as part of restore instead of running the CORS tests
One more go at https://github.com/aspnet/AspNetCore-Internal/issues/1619
2019-01-31 16:32:35 -08:00
BrennanConroy 25869c4690
Remove Obsolete WebSocketMiddleware constructor (#7163) 2019-01-31 16:11:50 -08:00
Nate McMaster 6081fec894
Add new build.cmd/sh options for suppressing restore, NodeJS, setting target arch and OS name, and more (#7137)
Add new command line parameters for working with the project:

* `-NoBuild`, `-NoRestore` - these already existed, but users found it hard to discover this powershell syntax: '-build:$false'
* `-Arch`/`--arch` - set the target CPU architecture to build. Defaults to x64
* `--os-name` - on non-Windows builds, manually specify if the build should target Alpine. generic Linux, or MacOS
* Rename flags used to build specific project types. The pattern now is `--build-$(group)` or `--no-build-$(group)` (In PowerShell its `-Build$(Group)` or `-NoBuild$(Group). Example: -NoBuildJava

Changes to build definitions:
* Update the ci build definition to build all supported architectures
* Support publishing multiple artifacts per job

Other changes:
* `-NoBuild` implies `-NoRestore`
* Add new properties, `TargetArchitecture`, `TargetOsName`, and `TargetRuntimeIdentifier`
* Replace usages of `SharedFxRid` with these new properties
* To make `--no-build-nodejs` actually work, replaced Components.Browser.JS.csproj with Components.Browser.JS.npmproj
* Fix errors when building for win-arm on a clean machine
* Fix a few other project errors, like using the wrong syntax for DefaultItemExcludes, or using the wrong Platform value for x86
2019-01-31 15:47:47 -08:00
Javier Calvarro Nelson 10156c496c
Merge branch 'master' into merge/release/2.2-to-master 2019-01-30 03:17:02 -08:00
Pranav K 93214b465c Move Cors Functional tests to a separate test group
Attemp #2 at addressing https://github.com/aspnet/AspNetCore-Internal/issues/1619

Puppetteer will attempt to download chromium as part of running the test. This seems odd, but
it might explain why this might be afflicted with the file descriptor contention issues that
the mondo repo tests encounter.

Moving these out in to a separate test group to see if this helps

Possible fix for https://github.com/aspnet/AspNetCore-Internal/issues/1619
2019-01-29 15:18:39 -08:00
Pavel Krymets 602a140a7a Merge branch 'release/2.2' 2019-01-28 21:51:18 -08:00
Pranav K 29898df8a8
Attempt to run Cors functional tests with watchman disabled. (#7076)
According to https://github.com/facebook/jest/issues/2219, jest will
not run tests if watchman is installed. It is not entirely clear if
this is the case in our OSX CI environment, but the symptoms seem close
to what's reported in the issue.

Possible fix for https://github.com/aspnet/AspNetCore-Internal/issues/1619
2019-01-28 16:44:56 -08:00
Pavel Krymets f06e1822f5
Enable strict mode in roslyn compiler (#6950) 2019-01-28 15:56:27 -08:00
Chris Ross 7d4b6fccff
Clean up ManualResetEvent usage in tests (#6961) 2019-01-28 12:10:16 -08:00