0
0
Jenkinsdevops~10 mins

HTML reports publishing in Jenkins - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to publish HTML reports in Jenkins pipeline.

Jenkins
publishHTML(target: [allowMissing: false, alwaysLinkToLastBuild: true, keepAll: true, reportDir: 'reports', reportFiles: '[1]', reportName: 'Test Report'])
Drag options to blanks, or click blank then click option'
Areport.txt
Bindex.html
Coutput.log
Dsummary.md
Attempts:
3 left
💡 Hint
Common Mistakes
Using a non-HTML file like .txt or .log as the report file.
Leaving the reportFiles parameter empty.
2fill in blank
medium

Complete the code to specify the directory containing the HTML reports.

Jenkins
publishHTML(target: [reportDir: '[1]', reportFiles: 'index.html', reportName: 'Coverage Report'])
Drag options to blanks, or click blank then click option'
Acoverage
Bbuild
Clogs
Dsrc
Attempts:
3 left
💡 Hint
Common Mistakes
Using a directory that does not contain the HTML files.
Confusing source code folders with report folders.
3fill in blank
hard

Fix the error in the Jenkins pipeline snippet to correctly publish HTML reports.

Jenkins
publishHTML(target: [allowMissing: false, alwaysLinkToLastBuild: true, keepAll: true, reportDir: 'test-results', reportFiles: '[1]', reportName: 'Test Results'])
Drag options to blanks, or click blank then click option'
Aresults.html
Btest-results.html
Creport.xml
Dindex.html
Attempts:
3 left
💡 Hint
Common Mistakes
Using XML or non-HTML files as reportFiles.
Mismatching the reportFiles name with actual file in directory.
4fill in blank
hard

Fill both blanks to configure Jenkins to keep all reports and link to the last build.

Jenkins
publishHTML(target: [keepAll: [1], alwaysLinkToLastBuild: [2], reportDir: 'output', reportFiles: 'index.html', reportName: 'Build Report'])
Drag options to blanks, or click blank then click option'
Atrue
Bfalse
Cyes
Dno
Attempts:
3 left
💡 Hint
Common Mistakes
Using strings like 'yes' or 'no' instead of boolean true/false.
Setting these options to false disables report retention or linking.
5fill in blank
hard

Fill all three blanks to create a Jenkins pipeline snippet that publishes HTML reports with custom report directory, file, and name.

Jenkins
publishHTML(target: [reportDir: '[1]', reportFiles: '[2]', reportName: '[3]'])
Drag options to blanks, or click blank then click option'
Atest-results
Bindex.html
CFunctional Tests
Dlogs
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up directory and file names.
Using generic or unclear report names.