DevOps Filling In Octane Analysis (Ex 2) - admpresales/oscillating GitHub Wiki
Goal
Ex 1
Create a Job to Run Tests that Fail and Link to the Job inSteps you will need to perform to accomplish this task
- Edit the "Corndog" job to add more tests for execution
- Run the "Corndog" pipeline and check the pipeline and determine if the test failed
- Propagate a LeanFT failure back to Jenkins and add Custom Build Report to see the LeanFT report quickly and easily
- Edit the "Corndog" job to add "alwaysThrowsExceptionButCaughtPayPal" test for execution
- Edit the "Corndog" job to add "alwaysThrowsExceptionPayPal" test for execution
- Edit the "Corndog" job to add "UnstableTest" class for execution
1. Edit the "Corndog" job to add more tests for execution
-
Edit the build step using the following
clean test -Dtest=LoginTests,StableTests,PayPalTest#alwaysPassesPayPal+alwaysFailsPayPal
-
To get a clearer understanding of the pattern used above to select individual test classes and methods for execution, refer to the Maven Surfire Plugin
2. Run the "Corndog" pipeline and check the pipeline and determine if the test failed
Why do we not see any failed tests?
Where can you go to see the LeanFT test results? (hint: look in the job's workspace under RunResults)
3. Propagate a LeanFT failure back to Jenkins and add Custom Build Report to see the LeanFT report quickly and easily
- Uncomment the line in the net.demo.paypal.PapPalTest file for the alwaysFailsPaypal test
if (Reporter.getStatus() == Status.Failed){
Assert.fail();
}
Commit and push the code.
- You must make sure to Archive the RunResults/runresults.html file so you can refer back to after multiple builds. So in the "Corndog" job, archive the folder (at least the runresults.html file). This would be a Post-build Action, and select "Archive the Artifacts". Order of the post build actions is not important here
- There are various ways to get the link to the runresults.html file, I find the easiest is to run the job and then go grab the link from the "Build Artifacts" similar to the image below.
- In Octane, click on the pipeline ID, got to Topology, select the "Corndog" and then the Configure gear.
- Paste the URL you got from Jenkins for the report for the build. You will notice the two highlight arguments. You need to at least do the '{build_number}'. The custom report can be created to reference files and reports which are generated by assets other than LeanFT.
- Now run the "Corndog" job and find the report.
4. Edit the "Corndog" job to add "alwaysThrowsExceptionButCaughtPayPal" test for execution
-
Edit the Corndog Job and add the following so it runs the "alwaysThrowsExceptionButCaughtPayPal" test
clean test -Dtest=LoginTests,StableTests,PayPalTest#alwaysPassesPayPal+alwaysFailsPayPal+alwaysThrowsExceptionButCaughtPayPal
- Do you see any failures?
- Why do you think not seeing a failure is correct?
- Take a look at the Octane pipeline Topology now. Do you know why it looks the way it does?
5. Edit the Corndog Job and add the following so it runs all the tests in the "PayPalTest" class
-
Edit the Corndog Job and add the following so it runs all the tests in the "PayPalTest" class
clean test -Dtest=LoginTests,StableTests,PayPalTest
-
Run the pipeline from Octane or from Jenkins
6. Edit the "Corndog" job to add "UnstableTest" class for execution
-
Edit the Corndog Job and add the following so it runs all the tests in the "UnstableTest" class
clean test -Dtest=LoginTests,StableTests,PayPalTest,UnstableTest
-
Run the pipeline from Octane or the "Corndog" from Jenkins