Skip to content

Commit

Permalink
Fix SignalR Npm flakiness (#11450)
Browse files Browse the repository at this point in the history
  • Loading branch information
BrennanConroy authored Jun 27, 2019
1 parent 7610ba3 commit 585b575
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ modules/
launchSettings.json
msbuild.ProjectImports.zip
StyleCop.Cache
UpgradeLog.htm
UpgradeLog.htm
15 changes: 13 additions & 2 deletions eng/targets/Npm.Common.targets
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
<_BackupPackageJson>$(IntermediateOutputPath)$(MSBuildProjectName).package.json.bak</_BackupPackageJson>
</PropertyGroup>

<ItemGroup>
<TSFiles Include="$(MSBuildProjectDirectory)\*\*.ts" />
<TSFiles Include="$(MSBuildProjectDirectory)\package.json" />
</ItemGroup>

<Target Name="_CheckForInvalidConfiguration">
<Error Text="Missing expected property: PackageId" Condition="'$(IsPackable)' != 'false' and '$(PackageId)' == ''" />
</Target>
Expand All @@ -31,8 +36,14 @@
BuildInParallel="true" />
</Target>

<Target Name="Build" DependsOnTargets="PrepareForBuild;ResolveProjectReferences">
<Yarn Command="run build" Condition="'$(IsBuildable)' != 'false'" StandardOutputImportance="High" StandardErrorImportance="High" />
<Target Name="Build" DependsOnTargets="PrepareForBuild;ResolveProjectReferences;_Build" />

<Target Name="_Build"
Condition="'$(IsBuildable)' != 'false'"
Inputs="@(TSFiles)"
Outputs="$(BaseIntermediateOutputPath)\build-sentinel" >
<Yarn Command="run build" StandardOutputImportance="High" StandardErrorImportance="High" />
<WriteLinesToFile Overwrite="true" File="$(BaseIntermediateOutputPath)\build-sentinel" />
</Target>

<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,16 @@

<PropertyGroup>
<IsPackable>false</IsPackable>
<IsTestProject>false</IsTestProject>
<IsTestProject>true</IsTestProject>
<BrowserTestHostName Condition="'$(ContinuousIntegrationBuild)' == 'true'">sauce.local</BrowserTestHostName>
<_TestSauceArgs>--verbose --no-color --configuration $(Configuration) --sauce-user "$(SauceUser)" --sauce-key "$(SauceKey)"</_TestSauceArgs>
<_TestSauceArgs Condition="'$(BrowserTestHostName)' != ''">$(_TestSauceArgs) --use-hostname "$(BrowserTestHostName)"</_TestSauceArgs>
<NpmTestArgs Condition="'$(DailyTests)' != 'true'">run test:local --no-color --configuration $(Configuration)</NpmTestArgs>
<NpmTestArgs Condition="'$(DailyTests)' != 'true'">run test:inner --no-color --configuration $(Configuration)</NpmTestArgs>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="SignalR.Client.FunctionalTestApp.csproj" Condition="'$(BuildManaged)' == 'true'" />
<ProjectReference Include="..\signalr\signalr.npmproj" />
<ProjectReference Include="..\signalr-protocol-msgpack\signalr-protocol-msgpack.npmproj" />
<ProjectReference Include="SignalR.Client.FunctionalTestApp.csproj" />
<ProjectReference Include="..\client-ts.npmproj" />
</ItemGroup>

<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), Directory.Build.targets))\Directory.Build.targets" />
Expand Down
5 changes: 3 additions & 2 deletions src/SignalR/clients/ts/FunctionalTests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,13 @@
"preclean": "cd .. && yarn run build",
"clean": "node ../common/node_modules/rimraf/bin.js ./wwwroot/dist ./obj/js",
"prebuild": "yarn run clean && yarn install --mutex network",
"build": "yarn run build:lint && yarn run build:webpack",
"build": "yarn run build:inner",
"build:inner": "yarn run build:lint && yarn run build:webpack",
"build:lint": "node ../common/node_modules/tslint/bin/tslint -c ../tslint.json -p ./tsconfig.json",
"build:webpack": "node ../common/node_modules/webpack-cli/bin/cli.js",
"pretest": "yarn run build && dotnet build SignalR.Client.FunctionalTestApp.csproj",
"test": "tsc --noEmit && yarn run test:local",
"test:inner": "yarn run build && dotnet build SignalR.Client.FunctionalTestApp.csproj && yarn run test:local",
"test:inner": "yarn run build:inner && ts-node --project ./scripts/tsconfig.json ./scripts/run-tests.ts",
"test:local": "yarn run pretest && ts-node --project ./scripts/tsconfig.json ./scripts/run-tests.ts",
"test:all": "yarn run pretest && ts-node --project ./scripts/tsconfig.json ./scripts/run-tests.ts --all-browsers",
"test:sauce": "yarn run pretest && ts-node --project ./scripts/tsconfig.json ./scripts/run-tests.ts --sauce",
Expand Down
2 changes: 1 addition & 1 deletion src/SignalR/clients/ts/client-ts.npmproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<PropertyGroup>
<IsPackable>false</IsPackable>
<IsBuildable>false</IsBuildable>
<IsTestProject>false</IsTestProject>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit 585b575

Please sign in to comment.