Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
dotNET Platform
runtime
提交
b13715b6
R
runtime
项目概览
dotNET Platform
/
runtime
大约 1 年 前同步成功
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
runtime
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
b13715b6
编写于
6月 07, 2021
作者:
F
Fan Yang
提交者:
GitHub
6月 07, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add runtime test logs to HELIX_WORKITEM_UPLOAD_ROOT (#53798)
上级
c1b4be36
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
33 addition
and
5 deletion
+33
-5
src/tests/Common/CLRTest.Execute.Bash.targets
src/tests/Common/CLRTest.Execute.Bash.targets
+1
-1
src/tests/Common/CLRTest.Execute.Batch.targets
src/tests/Common/CLRTest.Execute.Batch.targets
+1
-1
src/tests/Common/Coreclr.TestWrapper/CoreclrTestWrapperLib.cs
...tests/Common/Coreclr.TestWrapper/CoreclrTestWrapperLib.cs
+2
-1
src/tests/run.proj
src/tests/run.proj
+29
-2
未找到文件。
src/tests/Common/CLRTest.Execute.Bash.targets
浏览文件 @
b13715b6
...
...
@@ -363,7 +363,7 @@ else
HARNESS_RUNNER="xharness"
fi
$__Command $HARNESS_RUNNER android test --instrumentation="net.dot.MonoRunner" --package-name="net.dot.$__Category" --app="$__TestBinaryBase/$__Category.apk" --output-directory=
`$HELIX_WORKITEM_UPLOAD_ROOT`
--arg=entrypoint:libname=$(MsBuildProjectName).dll --expected-exit-code=100 -v
$__Command $HARNESS_RUNNER android test --instrumentation="net.dot.MonoRunner" --package-name="net.dot.$__Category" --app="$__TestBinaryBase/$__Category.apk" --output-directory=
"$__OutputDir"
--arg=entrypoint:libname=$(MsBuildProjectName).dll --expected-exit-code=100 -v
CLRTestExitCode=$?
# Exist code of xharness is zero when tests finished successfully
...
...
src/tests/Common/CLRTest.Execute.Batch.targets
浏览文件 @
b13715b6
...
...
@@ -329,7 +329,7 @@ IF NOT "%XHARNESS_CLI_PATH%"=="" (
set HARNESS_RUNNER=xharness
)
%__Command% %HARNESS_RUNNER% android test --instrumentation="net.dot.MonoRunner" --package-name="net.dot.%__Category%" --app="%__TestBinaryBase%\%__Category%.apk" --output-directory="%
HELIX_WORKITEM_UPLOAD_ROOT
%" --arg=entrypoint:libname=$(MsBuildProjectName).dll --expected-exit-code=100 -v
%__Command% %HARNESS_RUNNER% android test --instrumentation="net.dot.MonoRunner" --package-name="net.dot.%__Category%" --app="%__TestBinaryBase%\%__Category%.apk" --output-directory="%
__OutputDir
%" --arg=entrypoint:libname=$(MsBuildProjectName).dll --expected-exit-code=100 -v
set CLRTestExitCode=!ERRORLEVEL!
set CLRTestExpectedExitCode=0
]]></BatchCLRTestLaunchCmds>
...
...
src/tests/Common/Coreclr.TestWrapper/CoreclrTestWrapperLib.cs
浏览文件 @
b13715b6
...
...
@@ -284,7 +284,7 @@ static unsafe IEnumerable<Process> FindChildProcessesByName(Process process, str
return
children
;
}
public
int
RunTest
(
string
executable
,
string
outputFile
,
string
errorFile
,
string
category
,
string
testBinaryBase
)
public
int
RunTest
(
string
executable
,
string
outputFile
,
string
errorFile
,
string
category
,
string
testBinaryBase
,
string
outputDir
)
{
Debug
.
Assert
(
outputFile
!=
errorFile
);
...
...
@@ -321,6 +321,7 @@ public int RunTest(string executable, string outputFile, string errorFile, strin
process
.
StartInfo
.
RedirectStandardError
=
true
;
process
.
StartInfo
.
EnvironmentVariables
.
Add
(
"__Category"
,
category
);
process
.
StartInfo
.
EnvironmentVariables
.
Add
(
"__TestBinaryBase"
,
testBinaryBase
);
process
.
StartInfo
.
EnvironmentVariables
.
Add
(
"__OutputDir"
,
outputDir
);
DateTime
startTime
=
DateTime
.
Now
;
process
.
Start
();
...
...
src/tests/run.proj
浏览文件 @
b13715b6
...
...
@@ -120,11 +120,25 @@ $(_XunitEpilog)
<PackageReference
Include=
"Microsoft.DotNet.XUnitConsoleRunner"
Version=
"$(MicrosoftDotNetXUnitConsoleRunnerVersion)"
/>
</ItemGroup>
<ItemGroup>
<Content
Include=
"xunit.runner.json"
CopyToOutputDirectory=
"PreserveNewest"
/>
</ItemGroup>
<Import
Sdk=
"Microsoft.NET.Sdk"
Project=
"Sdk.targets"
/>
</Project>
]]>
</XunitWrapperGenCsProj>
<XunitRunnerConfig>
<![CDATA[
{
"diagnosticMessages": true,
"longRunningTestSeconds": 120,
"shadowCopy": false,
"preEnumerateTheories": false
}
]]>
</XunitRunnerConfig>
</PropertyGroup>
<!-- <Exec Command="md" -->
...
...
@@ -141,6 +155,12 @@ $(_XunitEpilog)
File=
"$(XunitWrapperSrcDir)\$(XunitWrapper).csproj"
Lines=
"$(XunitWrapperGenCsProj)"
Overwrite=
"true"
/>
<!-- Write the file -->
<WriteLinesToFile
File=
"$(XunitWrapperSrcDir)\xunit.runner.json"
Lines=
"$(XunitRunnerConfig)"
Overwrite=
"true"
/>
</Target>
<Target
Name=
"BuildXunitWrapper"
>
...
...
@@ -184,6 +204,7 @@ namespace $([System.String]::Copy($(Category)).Replace(".","_").Replace("\","").
internal static string testBinaryBase%3B
internal static string coreRoot%3B
internal static string category%3B
internal static string helixUploadRoot%3B
static _Global()
{
...
...
@@ -191,6 +212,10 @@ namespace $([System.String]::Copy($(Category)).Replace(".","_").Replace("\","").
testBinaryBase = System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)%3B
coreRoot = System.Environment.GetEnvironmentVariable(%22CORE_ROOT%22)%3B
category = "$([System.String]::Copy($(Category)).Replace(".","_").Replace("\","").Replace("-","_"))"%3B
helixUploadRoot = System.Environment.GetEnvironmentVariable(%22HELIX_WORKITEM_UPLOAD_ROOT%22)%3B
if (!String.IsNullOrEmpty(helixUploadRoot)) {
reportBase = System.IO.Path.Combine(System.IO.Path.GetFullPath(helixUploadRoot), "Reports")%3B
}
if (String.IsNullOrEmpty(reportBase)) {
reportBase = System.IO.Path.Combine(testBinaryBase, "Reports")%3B
...
...
@@ -266,6 +291,7 @@ namespace $([System.String]::Copy($(Category)).Replace(".","_").Replace("\","").
string outputFile = null%3B
string errorFile = null%3B
string testExecutable = null%3B
string outputDir = null%3B
Exception infraEx = null%3B
try
...
...
@@ -276,6 +302,7 @@ namespace $([System.String]::Copy($(Category)).Replace(".","_").Replace("\","").
errorFile = System.IO.Path.GetFullPath(_Global.reportBase + testSubfolder + @"%(AllCMDs.FileName).error.txt")%3B
testExecutable = System.IO.Path.GetFullPath(_Global.testBinaryBase + @"$([System.String]::Copy('%(AllCMDs.FullPath)').Replace("$(_CMDDIR)",''))")%3B
$(TestExecutableReplacement)
outputDir = System.IO.Path.GetDirectoryName(outputFile)%3B
if (!_Global.runningInWindows) {
testExecutable = testExecutable.Replace(".cmd", ".sh")%3B
...
...
@@ -283,7 +310,7 @@ namespace $([System.String]::Copy($(Category)).Replace(".","_").Replace("\","").
System.IO.Directory.CreateDirectory(_Global.reportBase + testSubfolder)%3B
ret = wrapper.RunTest(testExecutable, outputFile, errorFile, _Global.category, _Global.testBinaryBase)%3B
ret = wrapper.RunTest(testExecutable, outputFile, errorFile, _Global.category, _Global.testBinaryBase
, outputDir
)%3B
}
catch (Exception ex)
{
...
...
@@ -345,7 +372,7 @@ namespace $([System.String]::Copy($(Category)).Replace(".","_").Replace("\","").
//
Add
Android
app
running
log
to
testOutput
if
(ret
!=
CoreclrTestWrapperLib.EXIT_SUCCESS_CODE)
{
string
androidLogFile =
System.IO.Path.Combine(
System.IO.Path.GetDirectoryName(testExecutable),
"adb-logcat-net.dot."
+
_Global.category
+
"
.log")%3B
string
androidLogFile =
System.IO.Path.Combine(
outputDir,
"adb-logcat-net.dot."
+
_Global.category
+
"-net.dot.MonoRunner
.log")%3B
if(File.Exists(androidLogFile))
{
testOutput.AddRange(System.IO.File.ReadAllLines(androidLogFile))%3B
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录