Fix tests on linux-musl-x64

This commit is contained in:
Nate McMaster 2018-06-08 16:58:40 -07:00
parent d3ceb777ef
commit 10dff2410f
No known key found for this signature in database
GPG Key ID: A778D9601BD78810
5 changed files with 33 additions and 8 deletions

View File

@ -530,19 +530,34 @@
<Target Name="BuildSharedFx" DependsOnTargets="GeneratePropsFiles;ResolveSharedFxFiles;CrossGenAssemblies;CrossGenSymbols;PackSharedFx;TestSharedFx"/>
<Target Name="TestSharedFx" DependsOnTargets="DefineSharedFxPrerequisites;ResolveCommitHash">
<PropertyGroup>
<UnitTestFxProject>$(RepositoryRoot)\test\SharedFx.UnitTests\SharedFx.UnitTests.csproj</UnitTestFxProject>
<UnitTestFxTrxLogFile>$(LogOutputDir)SharedFx-UnitTests.trx</UnitTestFxTrxLogFile>
<UnitTestFxTrxPhysicalFilePath>$(UnitTestFxTrxLogFile)</UnitTestFxTrxPhysicalFilePath>
<UnitTestFxTrxPhysicalFilePath Condition="'$(HostMachineRepositoryRoot)' != ''">$(HostMachineRepositoryRoot)/artifacts/logs/SharedFx-UnitTests.trx</UnitTestFxTrxPhysicalFilePath>
</PropertyGroup>
<Target Name="TestSharedFx" DependsOnTargets="DefineSharedFxPrerequisites;ResolveCommitHash;InstallDotNet">
<PropertyGroup>
<UnitTestFxProject>$(RepositoryRoot)\test\SharedFx.UnitTests\SharedFx.UnitTests.csproj</UnitTestFxProject>
<UnitTestFxTestProps>
DotNetRestoreSourcePropsPath=$(GeneratedRestoreSourcesPropsPath);
DotNetPackageVersionPropsPath=$(GeneratedPackageVersionPropsPath);
SharedFxOutputPath=$(SharedFxIntermediateOutputPath);
RepositoryCommit=$(RepositoryCommit);
VSTestLogger=$([MSBuild]::Escape('trx;LogFileName=$(UnitTestFxTrxLogFile)'));
SharedFxRuntimeIdentifier=$(SharedFXRid)
</UnitTestFxTestProps>
</PropertyGroup>
<MSBuild Projects="$(UnitTestFxProject)" Targets="Restore" Properties="_Dummy=restore;$(UnitTestFxTestProps)" />
<MSBuild Projects="$(UnitTestFxProject)" Targets="VSTest" Properties="$(UnitTestFxTestProps)" />
<CallTarget Targets="ReportTestSharedFxTrx" />
<OnError ExecuteTargets="ReportTestSharedFxTrx" />
</Target>
<Target Name="ReportTestSharedFxTrx">
<Message Text="##teamcity[importData type='vstest' path='$(UnitTestFxTrxPhysicalFilePath)']"
Importance="high"
Condition=" '$(TEAMCITY_VERSION)' != '' AND Exists('$(UnitTestFxTrxLogFile)') "/>
</Target>
</Project>

View File

@ -115,4 +115,5 @@ docker run \
${docker_args[@]+"${docker_args[@]}"} \
$tagname \
./build.sh \
${build_args[@]+"${build_args[@]}"}
${build_args[@]+"${build_args[@]}"} \
"-p:HostMachineRepositoryRoot=$DIR"

View File

@ -1,2 +1,2 @@
version:2.2.0-preview1-17082
commithash:13b85a32c7aa9d62f6f3cc211c5c7c566d16b3dd
version:2.2.0-preview1-17084
commithash:d7fb2f0a63fbc33e8fe2bdb8f4ef63c1aea6d6ce

View File

@ -32,6 +32,9 @@ Re-installs KoreBuild
.PARAMETER ConfigFile
The path to the configuration file that stores values. Defaults to korebuild.json.
.PARAMETER CI
Sets up CI specific settings and variables.
.PARAMETER PackageVersionPropsUrl
(optional) the url of the package versions props path containing dependency versions.
@ -81,7 +84,8 @@ param(
[Alias('u')]
[switch]$Update,
[switch]$Reinstall,
[string]$ConfigFile,
[string]$ConfigFile = $null,
[switch]$CI,
[string]$PackageVersionPropsUrl = $null,
[string]$AccessTokenSuffix = $null,
[string]$RestoreSources = $null,
@ -235,7 +239,7 @@ $korebuildPath = Get-KoreBuild
Import-Module -Force -Scope Local (Join-Path $korebuildPath 'KoreBuild.psd1')
try {
Set-KoreBuildSettings -ToolsSource $ToolsSource -DotNetHome $DotNetHome -RepoPath $Path -ConfigFile $ConfigFile
Set-KoreBuildSettings -ToolsSource $ToolsSource -DotNetHome $DotNetHome -RepoPath $Path -ConfigFile $ConfigFile -CI:$CI
Invoke-KoreBuildCommand $Command @MSBuildArguments
}
finally {

7
run.sh
View File

@ -18,6 +18,7 @@ reinstall=false
repo_path="$DIR"
channel=''
tools_source=''
ci=false
package_version_props_url=''
asset_root_url=''
access_token_suffix=''
@ -48,6 +49,7 @@ __usage() {
echo " --product-build-id <ID> The product build ID for correlation with orchestrated builds."
echo " -u|--update Update to the latest KoreBuild even if the lock file is present."
echo " --reinstall Reinstall KoreBuild."
echo " --ci Apply CI specific settings and environment variables."
echo ""
echo "Description:"
echo " This function will create a file \$DIR/korebuild-lock.txt. This lock file can be committed to source, but does not have to be."
@ -216,6 +218,9 @@ while [[ $# -gt 0 ]]; do
--reinstall|-Reinstall)
reinstall=true
;;
--ci|-[Cc][Ii])
ci=true
;;
--verbose|-Verbose)
verbose=true
;;
@ -288,7 +293,7 @@ fi
[ -z "$tools_source" ] && tools_source='https://aspnetcore.blob.core.windows.net/buildtools'
get_korebuild
set_korebuildsettings "$tools_source" "$DOTNET_HOME" "$repo_path" "$config_file"
set_korebuildsettings "$tools_source" "$DOTNET_HOME" "$repo_path" "$config_file" "$ci"
# This incantation avoids unbound variable issues if msbuild_args is empty
# https://stackoverflow.com/questions/7577052/bash-empty-array-expansion-with-set-u