Skip to content

Analyze cibuild hang on Resharper tools update #1045

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
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"jetbrains.resharper.globaltools": {
"version": "2021.1.4",
"version": "2021.2.1",
"commands": [
"jb"
]
Expand All @@ -27,4 +27,4 @@
]
}
}
}
}
14 changes: 7 additions & 7 deletions Build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function CheckLastExitCode {

function RunInspectCode {
$outputPath = [System.IO.Path]::Combine([System.IO.Path]::GetTempPath(), 'jetbrains-inspectcode-results.xml')
dotnet jb inspectcode JsonApiDotNetCore.sln --output="$outputPath" --profile=WarningSeverities.DotSettings --properties:Configuration=Release --severity=WARNING --verbosity=WARN -dsl=GlobalAll -dsl=SolutionPersonal -dsl=ProjectPersonal
dotnet jb inspectcode --debug --no-build JsonApiDotNetCore.sln --output="$outputPath" --profile=WarningSeverities.DotSettings --properties:Configuration=Release --severity=WARNING --verbosity=TRACE -dsl=GlobalAll -dsl=SolutionPersonal -dsl=ProjectPersonal
CheckLastExitCode

[xml]$xml = Get-Content "$outputPath"
Expand Down Expand Up @@ -47,7 +47,7 @@ function RunCleanupCode {
$mergeCommitHash = git rev-parse "HEAD"
$targetCommitHash = git rev-parse "$env:APPVEYOR_REPO_BRANCH"

dotnet regitlint -s JsonApiDotNetCore.sln --print-command --jb --profile --jb --profile='\"JADNC Full Cleanup\"' --jb --properties:Configuration=Release --jb --verbosity=WARN -f commits -a $mergeCommitHash -b $targetCommitHash --fail-on-diff --print-diff
dotnet regitlint -s JsonApiDotNetCore.sln --print-command --jb --verbosity=TRACE --jb --debug --jb --profile --jb --profile='\"JADNC Full Cleanup\"' --jb --properties:Configuration=Release --jb --verbosity=WARN -f commits -a $mergeCommitHash -b $targetCommitHash --fail-on-diff --print-diff
CheckLastExitCode
}
}
Expand Down Expand Up @@ -100,11 +100,11 @@ dotnet build -c Release
CheckLastExitCode

RunInspectCode
RunCleanupCode
#RunCleanupCode

dotnet test -c Release --no-build --collect:"XPlat Code Coverage"
CheckLastExitCode
#dotnet test -c Release --no-build --collect:"XPlat Code Coverage"
#CheckLastExitCode

ReportCodeCoverage
#ReportCodeCoverage

CreateNuGetPackage
#CreateNuGetPackage
4 changes: 2 additions & 2 deletions cleanupcode.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ if ($LASTEXITCODE -ne 0) {
throw "Tool restore failed with exit code $LASTEXITCODE"
}

dotnet build -c Release
dotnet restore

if ($LASTEXITCODE -ne 0) {
throw "Build failed with exit code $LASTEXITCODE"
throw "Package restore failed with exit code $LASTEXITCODE"
}

dotnet regitlint -s JsonApiDotNetCore.sln --print-command --jb --profile --jb --profile='\"JADNC Full Cleanup\"' --jb --properties:Configuration=Release --jb --verbosity=WARN
8 changes: 1 addition & 7 deletions inspectcode.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,9 @@ if ($LASTEXITCODE -ne 0) {
throw "Tool restore failed with exit code $LASTEXITCODE"
}

dotnet build -c Release

if ($LASTEXITCODE -ne 0) {
throw "Build failed with exit code $LASTEXITCODE"
}

$outputPath = [System.IO.Path]::Combine([System.IO.Path]::GetTempPath(), 'jetbrains-inspectcode-results.xml')
$resultPath = [System.IO.Path]::Combine([System.IO.Path]::GetTempPath(), 'jetbrains-inspectcode-results.html')
dotnet jb inspectcode JsonApiDotNetCore.sln --output="$outputPath" --profile=WarningSeverities.DotSettings --properties:Configuration=Release --severity=WARNING --verbosity=WARN -dsl=GlobalAll -dsl=SolutionPersonal -dsl=ProjectPersonal
dotnet jb inspectcode JsonApiDotNetCore.sln --build --output="$outputPath" --profile=WarningSeverities.DotSettings --properties:Configuration=Release --severity=WARNING --verbosity=WARN -dsl=GlobalAll -dsl=SolutionPersonal -dsl=ProjectPersonal

if ($LASTEXITCODE -ne 0) {
throw "Code inspection failed with exit code $LASTEXITCODE"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public ResourcesInRelationshipsNotFoundException(IEnumerable<MissingResourceInRe

private static Error CreateError(MissingResourceInRelationship missingResourceInRelationship)
{
return new(HttpStatusCode.NotFound)
return new Error(HttpStatusCode.NotFound)
{
Title = "A related resource does not exist.",
Detail = $"Related resource of type '{missingResourceInRelationship.ResourceType}' with ID '{missingResourceInRelationship.ResourceId}' " +
Expand Down
4 changes: 2 additions & 2 deletions src/JsonApiDotNetCore/ObjectExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ public static T[] AsArray<T>(this T element)

public static List<T> AsList<T>(this T element)
{
return new()
return new List<T>
{
element
};
}

public static HashSet<T> AsHashSet<T>(this T element)
{
return new()
return new HashSet<T>
{
element
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public ResourceObjectBuilderSettingsProvider(IDefaultsQueryStringParameterReader
/// <inheritdoc />
public ResourceObjectBuilderSettings Get()
{
return new(_nullsReader.SerializerNullValueHandling, _defaultsReader.SerializerDefaultValueHandling);
return new ResourceObjectBuilderSettings(_nullsReader.SerializerNullValueHandling, _defaultsReader.SerializerDefaultValueHandling);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public MusicTrackReleaseDefinition(IResourceGraph resourceGraph, ISystemClock sy

public override QueryStringParameterHandlers<MusicTrack> OnRegisterQueryableHandlersForQueryStringParameters()
{
return new()
return new QueryStringParameterHandlers<MusicTrack>
{
["isRecentlyReleased"] = FilterOnRecentlyReleased
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public T GetContentAs<T>()

public static OutgoingMessage CreateFromContent(IMessageContent content)
{
return new()
return new OutgoingMessage
{
Type = content.GetType().Name,
FormatVersion = content.FormatVersion,
Expand Down
2 changes: 1 addition & 1 deletion test/TestBuildingBlocks/HttpResponseMessageExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public static class HttpResponseMessageExtensions
{
public static HttpResponseMessageAssertions Should(this HttpResponseMessage instance)
{
return new(instance);
return new HttpResponseMessageAssertions(instance);
}

public sealed class HttpResponseMessageAssertions : ReferenceTypeAssertions<HttpResponseMessage, HttpResponseMessageAssertions>
Expand Down
14 changes: 11 additions & 3 deletions test/UnitTests/Middleware/JsonApiMiddlewareTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,17 @@ private static Mock<IJsonApiOptions> CreateMockOptions(string forcedNamespace)

private static DefaultHttpContext CreateHttpContext(string path, bool isRelationship = false, string action = "", string id = null)
{
var context = new DefaultHttpContext();
context.Request.Path = new PathString(path);
context.Response.Body = new MemoryStream();
var context = new DefaultHttpContext
{
Request =
{
Path = new PathString(path)
},
Response =
{
Body = new MemoryStream()
}
};

var feature = new RouteValuesFeature
{
Expand Down
4 changes: 2 additions & 2 deletions test/UnitTests/Serialization/DeserializerTestsSetup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ protected Document CreateDocumentWithRelationships(string primaryType, string re

protected Document CreateDocumentWithRelationships(string primaryType)
{
return new()
return new Document
{
Data = new ResourceObject
{
Expand Down Expand Up @@ -67,7 +67,7 @@ protected RelationshipEntry CreateRelationshipData(string relatedType = null, bo

protected Document CreateTestResourceDocument()
{
return new()
return new Document
{
Data = new ResourceObject
{
Expand Down