Understanding Gradle #21 – Test and Code Coverage Reporting

Understanding Gradle #21 – Test and Code Coverage Reporting

3,174 Просмотров

How are code coverage (JaCoCo) reports activated and how to produce aggregated reports for a complete code base?

🚀 Online course - Modern Gradle Fundamentals https://www.udemy.com/course/modern-gradle-fundamentals/?referralCode=3AC1B96C0EBE6F4FBE6E
🏎️ Training on your Gradle topics https://onepiece.software/#training
✨ Support with your Gradle project https://onepiece.software/#consulting
💙 Follow me on Mastodon https://mastodon.social/@jendrik

▶️ 0:00 Reporting when Testing
▶️ 0:18 Test Reports for each Component
▶️ 1:25 Code Coverage Reports for each Component
▶️ 2:39 Reports for the complete Code Base
▶️ 4:18 Apply report aggregation plugins
▶️ 5:03 Wire into Lifecycle Task
▶️ 5:37 Aggregate reports of multiple Source Sets
▶️ 8:00 Relationship to Variant-aware Dependency Management
▶️ 8:41 The outgoingVariants help task
▶️ 9:43 Summary

💾 Example on GitHub (Kotlin DSL): https://github.com/jjohannes/understanding-gradle/tree/main/21_Test_and_Code_Coverage_Reporting
💾 Example on GitHub (Groovy DSL): https://github.com/jjohannes/understanding-gradle/tree/groovy-dsl/21_Test_and_Code_Coverage_Reporting

Related Videos:
⏩ 08 Declaring Dependencies: https://www.youtube.com/watch?v=igug9tbl4J4&list=PLWQK2ZdV4Yl2k2OmC_gsjDpdIBTN0qqkE
⏩ 13 Aggregating Custom Artifacts: https://www.youtube.com/watch?v=2gPJD0mAres&list=PLWQK2ZdV4Yl2k2OmC_gsjDpdIBTN0qqkE
⏩ 18 Configuring Testing https://www.youtube.com/watch?v=7f_gBvGQN_0&list=PLWQK2ZdV4Yl2k2OmC_gsjDpdIBTN0qqkE
⏩ 19 The Test Task: https://www.youtube.com/watch?v=YJjNQJSaFww&list=PLWQK2ZdV4Yl2k2OmC_gsjDpdIBTN0qqkE

Further Readings:
📕 JaCoCo Plugin: https://docs.gradle.org/current/userguide/jacoco_plugin.html
📕 Test Report Aggregation Plugin: https://docs.gradle.org/current/userguide/test_report_aggregation_plugin.html
📕 Sample - Aggregating Test Results: https://docs.gradle.org/current/samples/sample_jvm_multi_project_with_test_aggregation_distribution.html
📕 JaCoCo Report Aggregation Plugin: https://docs.gradle.org/current/userguide/jacoco_report_aggregation_plugin.html
📕 Sample - Aggregating Code Coverage Reports: https://docs.gradle.org/current/samples/sample_jvm_multi_project_with_code_coverage_distribution.html
📕 Declaring dependencies / What are Configurations?: https://docs.gradle.org/current/userguide/declaring_dependencies.html
📕 Understanding Variant Selection: https://docs.gradle.org/current/userguide/variant_model.html
📕 Variant Attributes: https://docs.gradle.org/current/userguide/variant_attributes.html
📕 Sharing of Artifacts between Projects: https://docs.gradle.org/current/userguide/cross_project_publications.html#sec:variant-aware-sharing
Ссылки и html тэги не поддерживаются


Комментарии:

@maheshkumarpalled3583
@maheshkumarpalled3583 - 06.09.2022 06:54

how to pass parameters to a test task? Ex : task is like -> task ("integration-test", type:Test). How can add a parameter to task and use it to define type of test I want. Ex : if pass string from CLI as "sanity" it will take a suite which have sanity test and if "Regression" then runs all the test.

Any way to do this? like reading command line argument to decide which test to run.

Ответить