Skip to content

Commit

Permalink
Updated the template for Exempted cases to now be in a tabular form a…
Browse files Browse the repository at this point in the history
…nd also added a new line to bunch of files belonging to differnt shards to pre test everything as a mini version before running RunAllTests

If this reports everything succesfully then we can revert the new line changes and proceed with RunAllTests
  • Loading branch information
Rd4dev committed Aug 12, 2024
1 parent 292a4e9 commit 59091df
Show file tree
Hide file tree
Showing 17 changed files with 76 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ import org.oppia.android.app.utility.datetime.DateTimeUtil
* Instances of this subcomponent should be created using [ActivityComponentFactory].
*/
interface ActivityComponent : AppLanguageActivityInjector, DateTimeUtil.Injector

Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,4 @@ class HomeActivity :
)
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ interface SpotlightManager {
const val SPOTLIGHT_FRAGMENT_TAG = "SpotlightFragment"
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ sealed class SpotlightShape {
/** Represents a rounded rectangular spotlight highlight region. */
object RoundedRectangle : SpotlightShape()
}

1 change: 1 addition & 0 deletions app/src/main/res/layout/add_profile_activity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -250,3 +250,4 @@
</FrameLayout>
</LinearLayout>
</layout>

Original file line number Diff line number Diff line change
Expand Up @@ -216,3 +216,4 @@ class ClassroomListActivityTest {
override fun getApplicationInjector(): ApplicationInjector = component
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -402,3 +402,4 @@ class SpotlightFragmentTest {
override fun getApplicationInjector(): ApplicationInjector = component
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -262,3 +262,4 @@ class DateTimeUtilTest {
override fun getApplicationInjector(): ApplicationInjector = component
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ class FirebaseAuthWrapperImpl @Inject constructor(
}
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -156,3 +156,4 @@ class SpotlightStateController @Inject constructor(
return cacheStore
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,4 @@ class FakeLogUploader @Inject constructor() : LogUploader {
/** Returns the most recent work request id that's stored in the [firestoreRequestIdList]. */
fun getMostRecentFirestoreRequestId() = firestoreRequestIdList.last()
}

Original file line number Diff line number Diff line change
Expand Up @@ -1709,3 +1709,4 @@ class QuestionAssessmentProgressControllerTest {
private val TURKEY_TURKISH_LOCALE = Locale("tr", "TR")
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ class CoverageReporter(
.map { exemption ->
val filePath = exemption.exemption.filePath
val exemptionReason = exemption.exemption.exemptionReason
"${getFilenameAsDetailsSummary(filePath, exemptionReason)}"
"| ${getFilenameAsDetailsSummary(filePath)} | $exemptionReason |"
}.joinToString(separator = "\n") { "$it" }

val tableHeader = buildString {
Expand Down Expand Up @@ -470,7 +470,10 @@ class CoverageReporter(
if (testFileExemptedCasesList.isNotEmpty()) {
append("\n\n")
append("### Exempted coverage\n")
append("<details><summary>Files exempted from coverage</summary> <br>")
append("<details><summary>Files exempted from coverage</summary><br>")
append("\n\n")
append("| File | Exemption Reason |\n")
append("|------|------------------|\n")
append(testFileExemptedCasesList)
append("\n\n")
append(exemptionsReferenceNote)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ class RunCoverageTest {
fun testRunCoverage_testFileExempted_exemptedFromCoverageAnalysis() {
val exemptedFile = "TestExempted.kt"
val exemptedFilePathList = listOf(exemptedFile)
val additionalData = "This file is exempted from having a test file; skipping coverage check."
val exemptionReason = "This file is exempted from having a test file; skipping coverage check."
val exemptionsReferenceNote = ">Refer [test_file_exemptions.textproto]" +
"(https://github.com/oppia/oppia-android/blob/develop/" +
"scripts/assets/test_file_exemptions.textproto) for the comprehensive " +
Expand Down Expand Up @@ -221,8 +221,11 @@ class RunCoverageTest {
append("Coverage Analysis: **PASS** :white_check_mark:\n")
append("##\n\n")
append("### Exempted coverage\n")
append("<details><summary>Files exempted from coverage</summary> <br>")
append("${getFilenameAsDetailsSummary(exemptedFile, additionalData)}")
append("<details><summary>Files exempted from coverage</summary><br>")
append("\n\n")
append("| File | Exemption Reason |\n")
append("|------|------------------|\n")
append("| ${getFilenameAsDetailsSummary(exemptedFile)} | $exemptionReason |")
append("\n\n")
append(exemptionsReferenceNote)
append("</details>")
Expand All @@ -235,7 +238,7 @@ class RunCoverageTest {
fun testRunCoverage_sourceFileIncompatibleWithCodeCoverage_exemptedFromCoverageAnalysis() {
val exemptedFile = "SourceIncompatibleWithCoverage.kt"
val exemptedFilePathList = listOf(exemptedFile)
val additionalData = "This file is incompatible with code coverage tooling; " +
val exemptionReason = "This file is incompatible with code coverage tooling; " +
"skipping coverage check."
val exemptionsReferenceNote = ">Refer [test_file_exemptions.textproto]" +
"(https://github.com/oppia/oppia-android/blob/develop/" +
Expand Down Expand Up @@ -267,8 +270,11 @@ class RunCoverageTest {
append("Coverage Analysis: **PASS** :white_check_mark:\n")
append("##\n\n")
append("### Exempted coverage\n")
append("<details><summary>Files exempted from coverage</summary> <br>")
append("${getFilenameAsDetailsSummary(exemptedFile, additionalData)}")
append("<details><summary>Files exempted from coverage</summary><br>")
append("\n\n")
append("| File | Exemption Reason |\n")
append("|------|------------------|\n")
append("| ${getFilenameAsDetailsSummary(exemptedFile)} | $exemptionReason |")
append("\n\n")
append(exemptionsReferenceNote)
append("</details>")
Expand Down Expand Up @@ -1092,7 +1098,7 @@ class RunCoverageTest {
@Test
fun testRunCoverage_withSuccessAndExemptedFiles_generatesFinalCoverageReport() {
val exemptedFile = "TestExempted.kt"
val additionalData = "This file is exempted from having a test file; skipping coverage check."
val exemptionReason = "This file is exempted from having a test file; skipping coverage check."
val exemptionsReferenceNote = ">Refer [test_file_exemptions.textproto]" +
"(https://github.com/oppia/oppia-android/blob/develop/" +
"scripts/assets/test_file_exemptions.textproto) for the comprehensive " +
Expand Down Expand Up @@ -1148,10 +1154,11 @@ class RunCoverageTest {
)
append("</details>\n\n")
append("### Exempted coverage\n")
append("<details><summary>Files exempted from coverage</summary> <br>")
append(
"${getFilenameAsDetailsSummary(filePathList.get(1), additionalData)}"
)
append("<details><summary>Files exempted from coverage</summary><br>")
append("\n\n")
append("| File | Exemption Reason |\n")
append("|------|------------------|\n")
append("| ${getFilenameAsDetailsSummary(filePathList.get(1))} | $exemptionReason |")
append("\n\n")
append(exemptionsReferenceNote)
append("</details>")
Expand All @@ -1163,7 +1170,7 @@ class RunCoverageTest {
@Test
fun testRunCoverage_withFailureAndExemptedFiles_generatesFinalCoverageReport() {
val exemptedFile = "TestExempted.kt"
val additionalData = "This file is exempted from having a test file; skipping coverage check."
val exemptionReason = "This file is exempted from having a test file; skipping coverage check."
val exemptionsReferenceNote = ">Refer [test_file_exemptions.textproto]" +
"(https://github.com/oppia/oppia-android/blob/develop/" +
"scripts/assets/test_file_exemptions.textproto) for the comprehensive " +
Expand Down Expand Up @@ -1223,8 +1230,11 @@ class RunCoverageTest {
)
append("\n")
append("### Exempted coverage\n")
append("<details><summary>Files exempted from coverage</summary> <br>")
append("${getFilenameAsDetailsSummary(filePathList.get(1), additionalData)}")
append("<details><summary>Files exempted from coverage</summary><br>")
append("\n\n")
append("| File | Exemption Reason |\n")
append("|------|------------------|\n")
append("| ${getFilenameAsDetailsSummary(filePathList.get(1))} | $exemptionReason |")
append("\n\n")
append(exemptionsReferenceNote)
append("</details>")
Expand All @@ -1236,7 +1246,7 @@ class RunCoverageTest {
@Test
fun testRunCoverage_withSuccessFailureAndExemptedFiles_generatesFinalCoverageReport() {
val exemptedFile = "TestExempted.kt"
val additionalData = "This file is exempted from having a test file; skipping coverage check."
val exemptionReason = "This file is exempted from having a test file; skipping coverage check."
val exemptionsReferenceNote = ">Refer [test_file_exemptions.textproto]" +
"(https://github.com/oppia/oppia-android/blob/develop/" +
"scripts/assets/test_file_exemptions.textproto) for the comprehensive " +
Expand Down Expand Up @@ -1315,8 +1325,11 @@ class RunCoverageTest {
)
append("</details>\n\n")
append("### Exempted coverage\n")
append("<details><summary>Files exempted from coverage</summary> <br>")
append("${getFilenameAsDetailsSummary(filePathList.get(2), additionalData)}")
append("<details><summary>Files exempted from coverage</summary><br>")
append("\n\n")
append("| File | Exemption Reason |\n")
append("|------|------------------|\n")
append("| ${getFilenameAsDetailsSummary(filePathList.get(2))} | $exemptionReason |")
append("\n\n")
append(exemptionsReferenceNote)
append("</details>")
Expand All @@ -1328,7 +1341,7 @@ class RunCoverageTest {
@Test
fun testRunCoverage_withSuccessFailureMissingTestAndExemptedFiles_generatesFinalReport() {
val exemptedFile = "TestExempted.kt"
val additionalData = "This file is exempted from having a test file; skipping coverage check."
val exemptionReason = "This file is exempted from having a test file; skipping coverage check."
val exemptionsReferenceNote = ">Refer [test_file_exemptions.textproto]" +
"(https://github.com/oppia/oppia-android/blob/develop/" +
"scripts/assets/test_file_exemptions.textproto) for the comprehensive " +
Expand Down Expand Up @@ -1417,8 +1430,11 @@ class RunCoverageTest {
)
append("</details>\n\n")
append("### Exempted coverage\n")
append("<details><summary>Files exempted from coverage</summary> <br>")
append("${getFilenameAsDetailsSummary(filePathList.get(2), additionalData)}")
append("<details><summary>Files exempted from coverage</summary><br>")
append("\n\n")
append("| File | Exemption Reason |\n")
append("|------|------------------|\n")
append("| ${getFilenameAsDetailsSummary(filePathList.get(2))} | $exemptionReason |")
append("\n\n")
append(exemptionsReferenceNote)
append("</details>")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ class CoverageReporterTest {
@Test
fun testGenerateMarkDownReport_withTestFileExemptionCoverageReport_generatesMarkdownTable() {
val testExemptedFilePath = "TestExempted.kt"
val additionalData = "This file is exempted from having a test file; skipping coverage check."
val exemptionReason = "This file is exempted from having a test file; skipping coverage check."
val exemptionsReferenceNote = ">Refer [test_file_exemptions.textproto]" +
"(https://github.com/oppia/oppia-android/blob/develop/" +
"scripts/assets/test_file_exemptions.textproto) for the comprehensive " +
Expand All @@ -178,7 +178,7 @@ class CoverageReporterTest {
.setExemption(
CoverageExemption.newBuilder()
.setFilePath(testExemptedFilePath)
.setExemptionReason(additionalData)
.setExemptionReason(exemptionReason)
.build()
).build()

Expand All @@ -201,8 +201,11 @@ class CoverageReporterTest {
append("Coverage Analysis: **PASS** :white_check_mark:\n")
append("##\n\n")
append("### Exempted coverage\n")
append("<details><summary>Files exempted from coverage</summary> <br>")
append("${getFilenameAsDetailsSummary(testExemptedFilePath, additionalData)}")
append("<details><summary>Files exempted from coverage</summary><br>")
append("\n\n")
append("| File | Exemption Reason |\n")
append("|------|------------------|\n")
append("| ${getFilenameAsDetailsSummary(testExemptedFilePath)} | $exemptionReason |")
append("\n\n")
append(exemptionsReferenceNote)
append("</details>")
Expand All @@ -214,7 +217,7 @@ class CoverageReporterTest {
@Test
fun testGenerateMarkDownReport_withSourceIncompatibilityExemption_generatesMarkdownTable() {
val testExemptedFilePath = "TestExempted.kt"
val additionalData = "This file is incompatible with code coverage tooling; " +
val exemptionReason = "This file is incompatible with code coverage tooling; " +
"skipping coverage check."
val exemptionsReferenceNote = ">Refer [test_file_exemptions.textproto]" +
"(https://github.com/oppia/oppia-android/blob/develop/" +
Expand All @@ -233,7 +236,7 @@ class CoverageReporterTest {
.setExemption(
CoverageExemption.newBuilder()
.setFilePath(testExemptedFilePath)
.setExemptionReason(additionalData)
.setExemptionReason(exemptionReason)
.build()
).build()

Expand All @@ -256,8 +259,11 @@ class CoverageReporterTest {
append("Coverage Analysis: **PASS** :white_check_mark:\n")
append("##\n\n")
append("### Exempted coverage\n")
append("<details><summary>Files exempted from coverage</summary> <br>")
append("${getFilenameAsDetailsSummary(testExemptedFilePath, additionalData)}")
append("<details><summary>Files exempted from coverage</summary><br>")
append("\n\n")
append("| File | Exemption Reason |\n")
append("|------|------------------|\n")
append("| ${getFilenameAsDetailsSummary(testExemptedFilePath)} | $exemptionReason |")
append("\n\n")
append(exemptionsReferenceNote)
append("</details>")
Expand Down Expand Up @@ -378,7 +384,7 @@ class CoverageReporterTest {
val successFileName = "SampleSuccessFile.kt"
val failureFileName = "SampleFailureFile.kt"
val testExemptedFilePath = "TestExempted.kt"
val additionalData = "This file is exempted from having a test file; skipping coverage check."
val exemptionReason = "This file is exempted from having a test file; skipping coverage check."
val exemptionsReferenceNote = ">Refer [test_file_exemptions.textproto]" +
"(https://github.com/oppia/oppia-android/blob/develop/" +
"scripts/assets/test_file_exemptions.textproto) for the comprehensive " +
Expand All @@ -396,7 +402,7 @@ class CoverageReporterTest {
.setExemption(
CoverageExemption.newBuilder()
.setFilePath(testExemptedFilePath)
.setExemptionReason(additionalData)
.setExemptionReason(exemptionReason)
.build()
).build()

Expand Down Expand Up @@ -469,8 +475,11 @@ class CoverageReporterTest {
)
append("</details>\n\n")
append("### Exempted coverage\n")
append("<details><summary>Files exempted from coverage</summary> <br>")
append("${getFilenameAsDetailsSummary(testExemptedFilePath, additionalData)}")
append("<details><summary>Files exempted from coverage</summary><br>")
append("\n\n")
append("| File | Exemption Reason |\n")
append("|------|------------------|\n")
append("| ${getFilenameAsDetailsSummary(testExemptedFilePath)} | $exemptionReason |")
append("\n\n")
append(exemptionsReferenceNote)
append("</details>")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,4 @@ class ConsoleLogger @Inject constructor(
blockingScope.launch { logDirectory.printWriter().use { out -> out.println(text) } }
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,4 @@ data class MathModel(
}
}
}

0 comments on commit 59091df

Please sign in to comment.