diff --git a/.github/workflows/code_coverage.yml b/.github/workflows/code_coverage.yml index 72b775902e8..982f9958adb 100644 --- a/.github/workflows/code_coverage.yml +++ b/.github/workflows/code_coverage.yml @@ -263,10 +263,10 @@ jobs: - uses: actions/download-artifact@v4 - name: coverage-report-artifact - run: | - ls -R - echo "SHA256 hash of downloaded files:" - find . -type f -exec sha256sum {} \; +# run: | +# ls -R +# echo "SHA256 hash of downloaded files:" +# find . -type f -exec sha256sum {} \; - name: Filter Coverage Reports run: | diff --git a/scripts/src/java/org/oppia/android/scripts/coverage/CoverageReporter.kt b/scripts/src/java/org/oppia/android/scripts/coverage/CoverageReporter.kt index db27124d56e..0f9914b12c2 100644 --- a/scripts/src/java/org/oppia/android/scripts/coverage/CoverageReporter.kt +++ b/scripts/src/java/org/oppia/android/scripts/coverage/CoverageReporter.kt @@ -68,95 +68,95 @@ fun main(vararg args: String) { println("Coverage Report Container1: $coverageReportContainer") - - - - // Process coverage report files - val coverageResultList2 = filePathList.mapNotNull { filePath -> - println("Single Path: $filePath") - val filePathNew = filePath.removePrefix("./") - println("Single Path After removing prefix: $filePathNew") - - try { - val path = Paths.get(repoRoot, filePathNew) - Files.newInputStream(path).use { stream -> - CoverageReport.newBuilder().also { builder -> - builder.mergeFrom(stream) - }.build() - } - /*File(repoRoot, filePath).inputStream().use { stream -> - CoverageReport.newBuilder().also { builder -> - builder.mergeFrom(stream) - }.build() - }*/ - } catch (e: Exception) { - println("Error processing file $filePath: ${e.message}") - null - } - } - - // Create CoverageReportContainer and print it - val coverageReportContainer2 = CoverageReportContainer.newBuilder().apply { - addAllCoverageReport(coverageResultList2) - }.build() - - println("Coverage Report Container2: $coverageReportContainer2") - - - - - - val coverageResultList3 = mutableListOf() - - filePathList.forEach { filePath -> - val file = File(filePath) - if (file.exists()) { - file.inputStream().use { stream -> - val coverageReport = CoverageReport.newBuilder().also { builder -> - builder.mergeFrom(stream) - }.build() - coverageResultList3.add(coverageReport) - } - } else { - println("File does not exist: $filePath") - } - } - - val coverageReportContainer3 = CoverageReportContainer.newBuilder().apply { - addAllCoverageReport(coverageResultList3) - }.build() - - println("Coverage Report Container3: $coverageReportContainer3") - - - - val coverageResultList4 = mutableListOf() - - filePathList.forEach { filePath -> - println("Single Path: $filePath") - val filePathNew = filePath.removePrefix("./") - println("Single Path After removing prefix: $filePathNew") - val file = File(filePathNew) - if (file.exists()) { - File(filePathNew).inputStream().use { stream -> - val cvr = CoverageReport.newBuilder().also { builder -> - builder.mergeFrom(stream) - }.build() - coverageResultList4.add(cvr) - } - } else { - println("File does not exist: $filePathNew") - } - } - - // Create CoverageReportContainer and print it - val coverageReportContainer4 = CoverageReportContainer.newBuilder().apply { - addAllCoverageReport(coverageResultList3) - }.build() - - println("Coverage Report Container3: $coverageReportContainer4") - - +// +// +// +// // Process coverage report files +// val coverageResultList2 = filePathList.mapNotNull { filePath -> +// println("Single Path: $filePath") +// val filePathNew = filePath.removePrefix("./") +// println("Single Path After removing prefix: $filePathNew") +// +// try { +// val path = Paths.get(repoRoot, filePathNew) +// Files.newInputStream(path).use { stream -> +// CoverageReport.newBuilder().also { builder -> +// builder.mergeFrom(stream) +// }.build() +// } +// /*File(repoRoot, filePath).inputStream().use { stream -> +// CoverageReport.newBuilder().also { builder -> +// builder.mergeFrom(stream) +// }.build() +// }*/ +// } catch (e: Exception) { +// println("Error processing file $filePath: ${e.message}") +// null +// } +// } +// +// // Create CoverageReportContainer and print it +// val coverageReportContainer2 = CoverageReportContainer.newBuilder().apply { +// addAllCoverageReport(coverageResultList2) +// }.build() +// +// println("Coverage Report Container2: $coverageReportContainer2") +// +// +// +// +// +// val coverageResultList3 = mutableListOf() +// +// filePathList.forEach { filePath -> +// val file = File(filePath) +// if (file.exists()) { +// file.inputStream().use { stream -> +// val coverageReport = CoverageReport.newBuilder().also { builder -> +// builder.mergeFrom(stream) +// }.build() +// coverageResultList3.add(coverageReport) +// } +// } else { +// println("File does not exist: $filePath") +// } +// } +// +// val coverageReportContainer3 = CoverageReportContainer.newBuilder().apply { +// addAllCoverageReport(coverageResultList3) +// }.build() +// +// println("Coverage Report Container3: $coverageReportContainer3") +// +// +// +// val coverageResultList4 = mutableListOf() +// +// filePathList.forEach { filePath -> +// println("Single Path: $filePath") +// val filePathNew = filePath.removePrefix("./") +// println("Single Path After removing prefix: $filePathNew") +// val file = File(filePathNew) +// if (file.exists()) { +// File(filePathNew).inputStream().use { stream -> +// val cvr = CoverageReport.newBuilder().also { builder -> +// builder.mergeFrom(stream) +// }.build() +// coverageResultList4.add(cvr) +// } +// } else { +// println("File does not exist: $filePathNew") +// } +// } +// +// // Create CoverageReportContainer and print it +// val coverageReportContainer4 = CoverageReportContainer.newBuilder().apply { +// addAllCoverageReport(coverageResultList3) +// }.build() +// +// println("Coverage Report Container3: $coverageReportContainer4") +// +//