Skip to content

Update to latest tooling #65

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
dougbu opened this issue Oct 9, 2017 · 7 comments
Closed

Update to latest tooling #65

dougbu opened this issue Oct 9, 2017 · 7 comments
Assignees

Comments

@dougbu
Copy link
Contributor

dougbu commented Oct 9, 2017

Bring this repo up-to-date w.r.t. the MSBuild version, the StyleCop version, and the Castle.Core / Moq / xUnit versions used in tests. Do not change product code, dependencies, or runtime targets.

This includes a small quirk on the test side: Latest xUnit packages depend on various .NET Standard packages if the test project targets anything earlier than .NET 4.5.2. Update the test projects to target .NET 4.5.2 to avoid those dependencies. We're only testing on more-recent Windows, and therefore desktop .NET, versions anyhow.

See PR aspnet/WebHooks#167 for a smaller variant of this work.

@dougbu dougbu self-assigned this Oct 9, 2017
@dougbu dougbu added this to the 5.2.4 milestone Oct 9, 2017
@dougbu
Copy link
Contributor Author

dougbu commented Oct 9, 2017

Self-assigning because using the old tooling is slowing work on my local machine and may be the root cause of odd test failures that don't reproduce on the (older) CI infrastructure.

dougbu added a commit that referenced this issue Oct 17, 2017
- stable release
- part of #65
dougbu added a commit that referenced this issue Oct 19, 2017
- stable release
- part of #65
@dougbu
Copy link
Contributor Author

dougbu commented Oct 19, 2017

StyleCop update: 2c759d3

dougbu added a commit that referenced this issue Oct 19, 2017
- #72 and also related to #65
- v7.0.1 is the next major version after what the product code is built against (v6.0.4)
  - this version corrects test failures I saw on a machine with .NET 4.7 (#72)
- add binding redirects and include the app.config files in test projects
- avoid new `TypeLoadException`s for Newtonsoft.Json that break numerous tests
  - consistently disable Copy Local (aka `%(Private)` metadata) in `src` projects
  - add Newtonsoft.Json references in test projects that bring it in transitively
    - otherwise, product code is last to mention Newtonsoft.Json assembly
dougbu added a commit that referenced this issue Oct 20, 2017
- #72 and also related to #65
- v7.0.1 is the next major version after what the product code is built against (v6.0.4)
  - this version corrects test failures I saw on a machine with .NET 4.7 (#72)
- add binding redirects and include the app.config files in test projects
- avoid new `TypeLoadException`s for Newtonsoft.Json that break numerous tests
  - consistently disable Copy Local (aka `%(Private)` metadata) in `src` projects
  - add Newtonsoft.Json references in test projects that bring it in transitively
    - otherwise, product code is last to mention Newtonsoft.Json assembly
@dougbu
Copy link
Contributor Author

dougbu commented Oct 21, 2017

Newtonsoft.Json upgrade: e4c8e01

@dougbu
Copy link
Contributor Author

dougbu commented Oct 23, 2017

MSBuild and xUnit MSBuild upgrade: 634c9d2
Testing .NET Framework upgrade (enabling Moq / xUnit upgrades): 4b30958

dougbu added a commit that referenced this issue Oct 23, 2017
- part of #65
- NuGet added System.Configuration references

- add `[InternalsVisibleTo("DynamicProxyGenAssembly2, ...)]` attribute in MVC to fix more than 70 failures
  - mainly impacted mocks of `internal` interface implementations e.g. `ActionDescriptor` & `IUniquelyIdentifiable`
- split some `Setup(...)` and `SetupGet(...)` lambda expressions in two
  - mainly impacted mocks of types with `protected` constructors e.g. `HttpResponseBase`
- typo in `HttpRouteCollectionTest` should have always broken the test
- not sure why tests using `PortReserver` weren't failing before; tests shouldn't be opening UDP ports
dougbu added a commit that referenced this issue Oct 25, 2017
- part of #65
- NuGet added System.Configuration references

- add `[InternalsVisibleTo("DynamicProxyGenAssembly2, ...)]` attribute in MVC to fix more than 70 failures
  - mainly impacted mocks of `internal` interface implementations e.g. `ActionDescriptor` & `IUniquelyIdentifiable`
- split some `Setup(...)` and `SetupGet(...)` lambda expressions in two
  - mainly impacted mocks of types with `protected` constructors e.g. `HttpResponseBase`
- typo in `HttpRouteCollectionTest` should have always broken the test
- not sure why tests using `PortReserver` weren't failing before; tests shouldn't be opening UDP ports
@dougbu
Copy link
Contributor Author

dougbu commented Oct 25, 2017

Moq and Castle.Core upgrade: 62cc8b3

dougbu added a commit that referenced this issue Oct 25, 2017
- part of #65
- remove `xUnit` meta-package: delay introduction of analyzers temporarily
- remove `xunit.core` package from Microsoft.TestCommon permanently
  - not needed for xUnit extensions
@dougbu
Copy link
Contributor Author

dougbu commented Oct 25, 2017

xUnit runtime upgrade: 64806c4

dougbu added a commit that referenced this issue Oct 25, 2017
…stem.Web.Cors.Test

- part of #65
- do not use `xunit.core` package in Microsoft.TestCommon
- improve `TestData` behavior when tests sharing dataset properties run in parallel

ExceptionResultTests.ExecuteAsync_ReturnsCorrectResponse_WhenContentNegotiationSucceedsAndIncludeErrorDetailIsTrue

Manual changes:
- use `Assert.IsAssignableFrom<T>(...)`, `Assert.IsType<T>(...)` and `Assert.Single(...)` return values
- work around xUnit1013, Public method should be marked as test
  - move duplicated `[Theory]` and `[TestDataSet(...)]` attributes down to `abstract` methods
  - add suppression due to xnuit/xunit#1466
- work around xUnit1026, `[Theory]` method doesn't use all parameters
  - add new data sets or `GC.KeepAlive(...)`
- reset `OAuthWebSecurity.OAuthDataProvider` after use in two tests
dougbu added a commit that referenced this issue Oct 25, 2017
…elpers.Test to System.Web.Http.SignalR.Test

- part of #65

Few manual changes:
- use `Assert.IsAssignableFrom<T>(...)`, `Assert.IsType<T>(...)` and `Assert.Single(...)` return values
- suppress xUnit1013, Public method should be marked as test
  - mark a few methods as `private` for the same reason
- work around xUnit1026, `[Theory]` method doesn't use all parameters
  - add `GC.KeepAlive(...)`
dougbu added a commit that referenced this issue Oct 25, 2017
….Web.Http.Test

- part of #65
- change `ExceptionResultTests` to not use `Assert.Same(...)` for `string`s (failed occassionally)

Few manual changes:
- workaround xUnit1026, `[Theory]` method doesn't use all parameters
  - add new data set properties or `GC.KeepAlive(...)`
- `Assert.Equal<T>(...)` -> `Assert.Equal(...)`
- use `Assert.IsAssignableFrom<T>(...)`, `Assert.IsType<T>(...)` and `Assert.Single(...)` return values
- avoid Linq's `.Where` inside `Assert.Contains(...)` and similar
dougbu added a commit that referenced this issue Oct 25, 2017
…ttp.Tracing.Test to System.Web.Mvc.Test

- part of #65

Few manual changes:
- use `Assert.IsAssignableFrom<T>(...)`, `Assert.IsType<T>(...)` and `Assert.Single(...)` return values
- fix xUnit1026, "`[Theory]` method doesn't use all parameters" issues
  - turn `[Theory]` that used no parameters into a `[Fact]`
  - add new dataset properties; see `EncodedDataSets` in particular
- `Assert.Equal<T>(...)` -> `Assert.Equal(...)`
- avoid Linq's `.Where` inside `Assert.Contains(...)` and similar
dougbu added a commit that referenced this issue Oct 25, 2017
….Web.Razor.Test to end

- part of #65

Few manual changes:
- work around xunit/xunit#1502
- use `Assert.IsAssignableFrom<T>(...)`, `Assert.IsType<T>(...)` and `Assert.Single(...)` return values
- suppress xUnit1013, Public method should be marked as test
  - helper method is called from multiple test classes; none inherit from defining class
- fix xUnit1026, `[Theory]` method doesn't use all parameters
  - add new data set properties
- suppress xUnit2013, Do not use equality check to check for collection size.
  - calls `Count` because the `Mock<T>` does not set up `GetEnumerable()`
- `Assert.Equal<T>(...)` -> `Assert.Equal(...)`
- avoid Linq's `.Where` inside `Assert.Contains(...)` and similar
dougbu added a commit that referenced this issue Oct 25, 2017
…stem.Web.Cors.Test

- part of #65
- do not use `xunit.core` package in Microsoft.TestCommon
- improve `TestData` behavior when tests sharing dataset properties run in parallel

Manual changes:
- use `Assert.IsAssignableFrom<T>(...)`, `Assert.IsType<T>(...)` and `Assert.Single(...)` return values
- work around xUnit1013, Public method should be marked as test
  - move duplicated `[Theory]` and `[TestDataSet(...)]` attributes down to `abstract` methods
  - add suppression due to xnuit/xunit#1466
- work around xUnit1026, `[Theory]` method doesn't use all parameters
  - add new data sets or `GC.KeepAlive(...)`
- reset `OAuthWebSecurity.OAuthDataProvider` after use in two tests
dougbu added a commit that referenced this issue Oct 25, 2017
…elpers.Test to System.Web.Http.SignalR.Test

- part of #65

Few manual changes:
- use `Assert.IsAssignableFrom<T>(...)`, `Assert.IsType<T>(...)` and `Assert.Single(...)` return values
- suppress xUnit1013, Public method should be marked as test
  - mark a few methods as `private` for the same reason
- work around xUnit1026, `[Theory]` method doesn't use all parameters
  - add `GC.KeepAlive(...)`
dougbu added a commit that referenced this issue Oct 28, 2017
dougbu added a commit that referenced this issue Oct 31, 2017
….Web.Http.Test

- part of #65
- change `ExceptionResultTests` to not use `Assert.Same(...)` for `string`s (failed occassionally)

Few manual changes:
- workaround xUnit1026, `[Theory]` method doesn't use all parameters
  - add new data set properties or `GC.KeepAlive(...)`
- `Assert.Equal<T>(...)` -> `Assert.Equal(...)`
- use `Assert.IsAssignableFrom<T>(...)`, `Assert.IsType<T>(...)` and `Assert.Single(...)` return values
- avoid Linq's `.Where` inside `Assert.Contains(...)` and similar
dougbu added a commit that referenced this issue Oct 31, 2017
…ttp.Tracing.Test to System.Web.Mvc.Test

- part of #65

Few manual changes:
- use `Assert.IsAssignableFrom<T>(...)`, `Assert.IsType<T>(...)` and `Assert.Single(...)` return values
- fix xUnit1026, "`[Theory]` method doesn't use all parameters" issues
  - turn `[Theory]` that used no parameters into a `[Fact]`
  - add new dataset properties; see `EncodedDataSets` in particular
- `Assert.Equal<T>(...)` -> `Assert.Equal(...)`
- avoid Linq's `.Where` inside `Assert.Contains(...)` and similar
dougbu added a commit that referenced this issue Oct 31, 2017
dougbu added a commit that referenced this issue Oct 31, 2017
….Web.Razor.Test to end

- part of #65

Few manual changes:
- work around xunit/xunit#1502
- use `Assert.IsAssignableFrom<T>(...)`, `Assert.IsType<T>(...)` and `Assert.Single(...)` return values
- suppress xUnit1013, Public method should be marked as test
  - helper method is called from multiple test classes; none inherit from defining class
- fix xUnit1026, `[Theory]` method doesn't use all parameters
  - add new data set properties
- suppress xUnit2013, Do not use equality check to check for collection size.
  - calls `Count` because the `Mock<T>` does not set up `GetEnumerable()`
- `Assert.Equal<T>(...)` -> `Assert.Equal(...)`
- avoid Linq's `.Where` inside `Assert.Contains(...)` and similar
dougbu added a commit that referenced this issue Nov 1, 2017
….Web.Razor.Test to end

- part of #65

Few manual changes:
- temporarily remove xUnit analyzers from System.Web.Razor.Test
  - work around xunit/xunit#1502
  - should restore analyzers as part of a #96 fix
- use `Assert.IsAssignableFrom<T>(...)`, `Assert.IsType<T>(...)` and `Assert.Single(...)` return values
- avoid xUnit1013, Public method should be marked as test
  - mark a helper method `internal`
- fix xUnit1026, `[Theory]` method doesn't use all parameters
  - add new data set properties
- suppress xUnit2013, Do not use equality check to check for collection size.
  - calls `Count` because the `Mock<T>` does not set up `GetEnumerable()`
- `Assert.Equal<T>(...)` -> `Assert.Equal(...)`
- avoid Linq's `.Where` inside `Assert.Contains(...)` and similar
@dougbu
Copy link
Contributor Author

dougbu commented Nov 1, 2017

Add xUnit analyzers and take fixer suggestions:

xUnit MSBuild runner upgrade to stable version: 2d18360
xUnit VisualStudio runner upgrade: 125b71a

@dougbu dougbu closed this as completed Nov 1, 2017
@Eilon Eilon added the task label Nov 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants