Ipipeline's pll library has been optimized and implemented accordingly.

Problem Description

After the project's CI system introduced the Jenkins 2.0 iPipeline framework (plll library), it should be said that many happy feelings have been promoted. One of the important aspects of the CI system is that the framework has provided users with the basic format of reports and emails. The display is intuitive and efficient.

The basic format of a typical report and email is as follows:

Ipipeline's pll library has been optimized and implemented accordingly.

As can be seen from the figure, the format of the overview information for each step is displayed, execution reports and links, product library reports and links, and the running time at a glance.

However, because the Plll library has formatted reports and emails, users cannot expand the content of reports and mailings based on basic report styles. This is not very convenient if the result report of several use case tests of this project needs to be attached to reports and emails.

Therefore, we decided to turn the report and mail display into an extensible mode, where users can freely add other data outside the basic report format and display it. We call this feature a shortcut report (Quick Report).

With this problem, we made corresponding optimization and practice of the Plll library.

Optimization practice

Optimize the plll library source code, add QuickReport function:

Def quickReportContent =""

Try{

ForeachFunctions{ context ->

If(context.args.param.quick_report){

For(int i=0; i

{

Def report = context.args.param.quick_report[i]

If(report.report_dir && report.report_file && report.report_name

&&(report.report_always || context.message=='')){

Def quickReportFile = report.report_dir +"/"+ report.report_file

quickReportContent = readFile quickReportFile

quickReportContent = "


"+ quickReportContent // Add a light green boundary line

Echo "quickReport content is:" + quickReportContent

}

}

}

}

}

Catch(Exception ex){

Echo ex.getMessage()

getData().result='failure'

getData().message+="[ERROR] PublishReportAll ${ex.getMessage()} "

}

Html = html + quickReportContent

Use example:

For the user, just add the quick_report parameter in the param parameter list of the interface of the plll interface to indicate the parameters such as report content and file name that need to be expanded. Then the user's extended content will be added to the report or mail, and the sample code is displayed. as follows:

plll.Test("check_xxx_case","case check",[

Run_dir:"${verifyScriptPath}/${runSubPath}",

Run_execute:{ run "${cmd}"},

Verify_dir:"${->env.OUTPUT_PATH}/",

Verify_after: tmp_move_shell_name,

Verify_execute: tmp_verify_shell_log_name,

Param:[

Report_file:[[report_dir:"${->env.OUTPUT_PATH}/", report_file:"${publishLogName}",report_name:"case check_report", report_always:true]],

Quick_report:[[report_dir:"${->env.OUTPUT_PATH}/", report_file:"${quickReportName}",report_name:"case check_quick_report", report_always:true]]

]

]);

As can be seen from the code, we have configured the directory, report file name, and report name contained in the user's quick report in the quick_report parameter list. The framework can then automatically add the user-defined report to the original basic table and split it with a green split line.

Show results:

For example, for this project, each time in the test task, there is a message called a CASE test report that needs to be presented to the user visually, without the need for the user to click on the link to view it, so we can extend it as QuickReport to email and Jenkins In the summary report:

The Jenkins summary display report is as follows. The user-defined table has been expanded below, as shown in the following figure:

Ipipeline's pll library has been optimized and implemented accordingly.

The same message is also displayed in the extension, as shown below:

Ipipeline's pll library has been optimized and implemented accordingly.

Laptop Adapter

Laptop AC adapter for common brands, such as HP, Sony, Lenovo, Dell, Asus, Toshiba, Acer, Samsung etc. Our products have high quality and reasonable price.

CE, FCC, ROHS certification are approved by our products, and it have two years warranty. Built with input/output overvoltage protection, input/output overcurrent protection, over temperature protection, over power protection and short circuit protection. We are a professional power adapter manufacturer in China. We can meet your specific requirement. We have perfect after-sale service and technical support.

Hope we can establish friendly business relationship with you in the near future!


Laptop Adapter,Adapter For Macbook,Power Supply For Macbook, Charger For Macbook

Shenzhen Waweis Technology Co., Ltd. , https://www.laptopsasdapter.com