diff --git a/performance/arkui/benchmark_pipeline/Benchmark/build-profile.json5 b/performance/arkui/benchmark_pipeline/Benchmark/build-profile.json5 index b8fa006fde4f81c0e46abe0fd25e6e7dd2cd13a6..bdfc3e881338072434174e19e670fb43dea22b84 100644 --- a/performance/arkui/benchmark_pipeline/Benchmark/build-profile.json5 +++ b/performance/arkui/benchmark_pipeline/Benchmark/build-profile.json5 @@ -21,9 +21,9 @@ "type": "HarmonyOS", "material": { "certpath": "C:\\Users\\LeeiOS\\.ohos\\config\\auto_debug_Benchmark_com.example.benchmark_2850086000500386127.cer", - "storePassword": "0000001A8B84254F56DEBBB02E7D698F0FED83DBFA69347BBBB1C1DABCFE6B630D2A20C2C0215560CA4B", + "storePassword": "0000001A61C9AAB1D34D4683D01A84952C62F8FDA60704162E3C3277EB16A657072CC0AFCBE8F75FD151", "keyAlias": "debugKey", - "keyPassword": "0000001A5DD9164C6B958A05D9A532352F07A012659A36A9BBDC5A26847736547F873912B137D7E0DBF0", + "keyPassword": "0000001A32C6990C4CA92032D943A1CCA53077CC0EE6074F63A3ECB627E672D2ADDD249C8C2A8E5C59E4", "profile": "C:\\Users\\LeeiOS\\.ohos\\config\\auto_debug_Benchmark_com.example.benchmark_2850086000500386127.p7b", "signAlg": "SHA256withECDSA", "storeFile": "C:\\Users\\LeeiOS\\.ohos\\config\\auto_debug_Benchmark_com.example.benchmark_2850086000500386127.p12" diff --git a/performance/arkui/benchmark_pipeline/Benchmark/entry/src/ohosTest/ets/test/Index.test.ets b/performance/arkui/benchmark_pipeline/Benchmark/entry/src/ohosTest/ets/test/Index.test.ets index 26606a13d0f7bc92c927690b180adc3e466362b8..2278376f49d8ae1b8d3cf7076f58d9a9bba7ce49 100644 --- a/performance/arkui/benchmark_pipeline/Benchmark/entry/src/ohosTest/ets/test/Index.test.ets +++ b/performance/arkui/benchmark_pipeline/Benchmark/entry/src/ohosTest/ets/test/Index.test.ets @@ -27,6 +27,10 @@ async function startApp() { await abilityDelegatorRegistry.getAbilityDelegator().startAbility(want) } +function sleep(time: number) { + return new Promise((resolve: Function) => setTimeout(resolve, time)); +} + // 通用测试case async function commonTestCase(pageBtnId: string, compId: string) { // 启动App @@ -36,6 +40,9 @@ async function commonTestCase(pageBtnId: string, compId: string) { await driver.delayMs(5000) // 延迟1s // 点击跳转用例页面 let bk = await driver.findComponent(ON.id(pageBtnId)) + while (bk == null) { + bk = await driver.findComponent(ON.id(pageBtnId)) + } await bk.click() // 跳转页面耗时 await driver.delayMs(1000) @@ -50,7 +57,7 @@ async function commonTestCase(pageBtnId: string, compId: string) { await firstBtn.click() } // **当前页面跳转or显示有转场动画时间or按钮点击事件处理,需要延迟** - await driver.delayMs(2000) + await driver.delayMs(3000) } export default function IndexTest() { diff --git a/performance/arkui/benchmark_pipeline/README.md b/performance/arkui/benchmark_pipeline/README.md index 47b295e80c4579f830632e4538f3d9b48b5f6269..763255dd207e7e1eb8d5e06475360aeb3b8d79fe 100644 --- a/performance/arkui/benchmark_pipeline/README.md +++ b/performance/arkui/benchmark_pipeline/README.md @@ -1,4 +1,5 @@ # 工程目录结构 + ``` ├── Benchmark     // 场景用例Sample及ohosTest ├── pip             // python安装读写Excel插件的配置文件 @@ -14,6 +15,19 @@ > **benchmark_pipeline_report.html 需把html后缀改为xls** +# 前期准备 + +### 设备 + +> 1、手机要求Mate 60或同等级设备及以上 +> +> 2、系统要求ALN-AL00 + +### 锁频锁核 + +> [脚本地址下载](https://wiki.huawei.com/domains/1456/wiki/8/WIKI20220906294838) +> +> 使用方法按上面wiki文档说明操作即可 # 安装python最新版,至少3.x以上 @@ -43,12 +57,14 @@ > 说明: > -> 1、确保所有工具和【渲染管线报告.xls】处于同一目录下; +> 1、确保所有工具和【benchmark_pipeline_report.xls】处于同一目录下; > > 2、如果选择1,则自动运行全部用例,中间无需做其他操作;如果选择2只可以运行具体某用例; > -> 3、无论选择1还是2,耗时时间都会自动写入【渲染管线报告.xls】; +> 3、无论选择1还是2,耗时时间都会自动写入【benchmark_pipeline_report.xls】; +> +> 4、工具会自动比对,耗时时间小于基线时间或者不大于基线时间10%均为Pass,否则Fail > -> 4、在运行用例时,禁止打开【渲染管线报告.xls】,否则耗时时间无法写入。 +> 5、在运行用例时,禁止打开【渲染管线报告.xls】,否则耗时时间无法写入。 > > ![图片6](https://gitee.com/kunge-hub/ostest_integration_test/raw/benchmark_pipeline/performance/arkui/benchmark_pipeline/screenshot/image6.png) diff --git a/performance/arkui/benchmark_pipeline/benchmark.bat b/performance/arkui/benchmark_pipeline/benchmark.bat index a4986cddc14441180d60d36b7925b88bc6dee879..03b1e10f9d64dc38095d062d8ebb86f3f24777f8 100644 --- a/performance/arkui/benchmark_pipeline/benchmark.bat +++ b/performance/arkui/benchmark_pipeline/benchmark.bat @@ -42,8 +42,8 @@ echo ------------------ echo 15Columnа100buttonbuttonıbutton֡FlushDirtyNodeUpdate echo 16Columnа100buttonʹԶbuttonıbutton֡FlushDirtyNodeUpdate echo ------------------ -echo 17Columnа100buttonbuttonΪɼHandleVisibleAreaChangeEvent -echo 18Columnа100buttonʹԶbuttonΪɼHandleVisibleAreaChangeEvent +echo 17Columnа100buttonԻײHandleVisibleAreaChangeEvent +echo 18Columnа100buttonʹԶԻײHandleVisibleAreaChangeEvent echo ------------------ echo 19Columnа100buttonbuttonıbuttonߡHandleOnAreaChangeEvent echo 20Columnа100buttonʹԶbuttonıbuttonߡHandleOnAreaChangeEvent @@ -146,5 +146,5 @@ if not exist %tracefolder% (mkdir %tracefolder%) ::Զbytrace start cmd /c test.bat %testname% -timeout -nobreak 3 +timeout -nobreak 5 start cmd /c bytrace.bat %filename% %tracefolder% %tagname% %rownum% %mode% %isAuto% \ No newline at end of file diff --git a/performance/arkui/benchmark_pipeline/benchmark_pipeline_report.html b/performance/arkui/benchmark_pipeline/benchmark_pipeline_report.html index 33d4699ba5e7bb9f08f4977f66a31b957f43aa3f..3602bab736a4e86d720e5951e20873752afb59b3 100644 Binary files a/performance/arkui/benchmark_pipeline/benchmark_pipeline_report.html and b/performance/arkui/benchmark_pipeline/benchmark_pipeline_report.html differ diff --git a/performance/arkui/benchmark_pipeline/test.bat b/performance/arkui/benchmark_pipeline/test.bat index 0e6c14a22b545218236cd6c778749ec8e88f631a..5ef0d4fc1f2cf6f3b48f6fd3fe721b9f4a356846 100644 --- a/performance/arkui/benchmark_pipeline/test.bat +++ b/performance/arkui/benchmark_pipeline/test.bat @@ -12,4 +12,4 @@ :: limitations under the License. ::Զ -hdc shell aa test -b com.example.benchmark -m entry_test -s unittest OpenHarmonyTestRunner -s class IndexTest#%1 -s timeout 150000 \ No newline at end of file +hdc shell aa test -b com.example.benchmark -m entry_test -s unittest /ets/testrunner/OpenHarmonyTestRunner -s itName %1 -s timeout 60000 \ No newline at end of file diff --git a/performance/arkui/benchmark_pipeline/traceParseFile.py b/performance/arkui/benchmark_pipeline/traceParseFile.py index 2967cd6fe6afb2021e4e9685aba973fdf65d8530..f5eee373673a45124a077177f1ed4c835b47453a 100644 --- a/performance/arkui/benchmark_pipeline/traceParseFile.py +++ b/performance/arkui/benchmark_pipeline/traceParseFile.py @@ -82,7 +82,7 @@ flushMessagesMaxDuration=0 #读取读取文件 -with open(ftraceFile) as file: +with open(ftraceFile, 'r', errors='ignore') as file: for item in file: #在ftrace中是多进程一起记录,故各个进程必须独立解析 #初步判断是当前任务 @@ -189,8 +189,27 @@ if(len(tagDict)==1): new_workbook = copy(workbook) write_save = new_workbook.get_sheet(0) outExcelFilePosArr=outExcelFilePosition.split(",") - - write_save.write(int(outExcelFilePosArr[0]), int(outExcelFilePosArr[1]), str(completeTagsDict[tagOri])+"μs") + row=int(outExcelFilePosArr[0]) + column=int(outExcelFilePosArr[1]) + # 测试数据 + test_data=completeTagsDict[tagOri] + write_save.write(row, column, test_data) + + # 读取基线数据 + work_sheet=workbook.sheets()[0] + base_line_data=int(work_sheet.cell_value(row, column-1)) + # 测试数据与基线数据比对并写入结果 + result="Pass" + # 如果测试数据大于基线数据 + if(test_data>base_line_data): + # 不大于10%也算通过 + if(((test_data-base_line_data)/base_line_data)<=0.1): + result="Pass" + else: + result="Fail" + write_save.write(row, column+1, result) + + print("test_data=%d, base_line_data:%d, comparison_result=%s" % (test_data,base_line_data,result)) new_workbook.save(tempFileName) workbook.release_resources()