Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #5486 & part of #5343: Introducing new wiki page for code coverage usage and limitations #5483

Merged
merged 67 commits into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
5ad95d0
Introducing new wiki page for code coverage
Rd4dev Aug 10, 2024
dae2add
How to use code coverage tool - wiki additions
Rd4dev Aug 12, 2024
a2966e8
Limitations section code coverage
Rd4dev Aug 12, 2024
c6ebcff
Adding page for Writing test with good behavioural coverage
Rd4dev Aug 13, 2024
51393a4
Rewrote Writing tests with good behavioural coverage wiki page
Rd4dev Aug 14, 2024
161c7fd
Merge with develop after merge of upload comments pr
Rd4dev Aug 14, 2024
9630d7f
Updates as per reviews part 1
Rd4dev Aug 14, 2024
3f34443
Trying to fix the failure of accessing evaluate job if files are skipped
Rd4dev Aug 14, 2024
fd3675d
Check coverage status pass with skip files present
Rd4dev Aug 14, 2024
e97b1ab
Updates as per reviews part 2 with addition to coverage summary, unit…
Rd4dev Aug 14, 2024
15e1033
Testing from forked repo to see if permissions work
Rd4dev Aug 14, 2024
1cad5c6
Replacing pull request with pull request target
Rd4dev Aug 14, 2024
f9b4b0d
On pull request target with opened, synchronize and reopened
Rd4dev Aug 14, 2024
6ec1790
Trying to fix syntax error with workflow
Rd4dev Aug 14, 2024
a6ce375
Remove comments
Rd4dev Aug 14, 2024
195e34d
With just pr target set
Rd4dev Aug 14, 2024
3bc2729
Only on push
Rd4dev Aug 14, 2024
3f9ee1e
Reverting to the pull_request
Rd4dev Aug 14, 2024
5c993dc
With just pr target
Rd4dev Aug 14, 2024
a11422f
Pull request target
Rd4dev Aug 15, 2024
65345ee
Adding push trigger
Rd4dev Aug 15, 2024
f9455dc
Moving the nested pull
Rd4dev Aug 15, 2024
dad7858
Pull Request target labels
Rd4dev Aug 15, 2024
d6ed539
Removing push trigger
Rd4dev Aug 15, 2024
bf845b7
Adding Permissions to write
Rd4dev Aug 15, 2024
b8ca56b
To try with manual triggers
Rd4dev Aug 15, 2024
8c67fff
Do versions make any changes
Rd4dev Aug 15, 2024
813ff66
Manually providing the issue number
Rd4dev Aug 15, 2024
a5aeb12
Pull Request target
Rd4dev Aug 15, 2024
b58db86
Addressing Review part 1 - Exception messages and fixes
Rd4dev Aug 16, 2024
1c1531d
Addressing reviews part 2 - Structuring Test Functionalities
Rd4dev Aug 17, 2024
f7552b3
Includes minor changes and removal of pull_request_target triggers to…
Rd4dev Aug 17, 2024
b1a5bd7
Addressed 2nd Pass of review - API Testing, Quality
Rd4dev Aug 17, 2024
fba4b86
Split code coverage workflow to 2 operations to handle analysis, eval…
Rd4dev Aug 17, 2024
1770f0a
Reverting the new line change in CoverageReporter - introduced for te…
Rd4dev Aug 17, 2024
41cda2a
Added a reference footnote to the Oppia Android Code Coverage Wiki page
Rd4dev Aug 18, 2024
de40692
Evaluation job moved to the coverage report workflow to aid in skip j…
Rd4dev Aug 18, 2024
6989c6c
Code Coverage Status Check on pb file presence, Lint fixes
Rd4dev Aug 18, 2024
a2e2c7a
Removed empty pb file output variable
Rd4dev Aug 19, 2024
1ae73a2
Removed concurrency as it fails every concurrent run of the workflow …
Rd4dev Aug 19, 2024
e04cd2b
Indentation fix
Rd4dev Aug 19, 2024
ef924f1
Fixed concurrency issues with uploading comments
Rd4dev Aug 19, 2024
a4c48d6
Added missed hasMessageThat() assertion chain
Rd4dev Aug 20, 2024
f8da0f5
Test changes
Rd4dev Aug 20, 2024
251cfd2
Dropping unnecessary changes committed with wrong branch refernce
Rd4dev Aug 20, 2024
c6ed248
Structuring test bodies, isEqualTo()
Rd4dev Aug 20, 2024
8dd0eb2
Removed sh highlighting on illustrations and replaced strings with co…
Rd4dev Aug 20, 2024
c102d7f
A public api, permalink, a bank account
Rd4dev Aug 20, 2024
e575034
Replaced textual illustration with mermaid blocks
Rd4dev Aug 20, 2024
89f9d9b
Replaced textual representation of procedure to test public api proce…
Rd4dev Aug 20, 2024
489a08b
Represent Structuring and mapping with mermaid graphs
Rd4dev Aug 20, 2024
509e3c3
Common color codes for all graph illustrations
Rd4dev Aug 20, 2024
d67e4d0
Added code coverage analysis to the review process
Rd4dev Aug 20, 2024
8f25484
Standard usage of behavior
Rd4dev Aug 20, 2024
dab4faa
Updted test name with multiple conditions, specific use of words
Rd4dev Aug 20, 2024
38c0a5c
Moved @Test annotation and function to its own line
Rd4dev Aug 21, 2024
bcfc30f
Updating the helper function example to use log file utility case
Rd4dev Aug 21, 2024
3e8a57c
Added source file changes to helper function changes
Rd4dev Aug 21, 2024
e4eb862
Setting the text color for the graphs to black as they weren't visibl…
Rd4dev Aug 21, 2024
c9a6df7
Updated the side bar info too to align with contents
Rd4dev Aug 21, 2024
13d566e
Added missed comma on parameter declaration
Rd4dev Aug 21, 2024
a56c40a
Added missed permalink for FractionParser
Rd4dev Aug 21, 2024
6c29802
Copy pasted the exact code for code coverage and coverage report from…
Rd4dev Aug 21, 2024
9bfd4c2
Fix remaining nits with punctuations, plural forms and empty check
Rd4dev Aug 21, 2024
98587f3
Moved the evaluation and check status back to their original workflow…
Rd4dev Aug 23, 2024
1ac4b7c
Merge with develop branch
Rd4dev Aug 23, 2024
e6710b3
Merge branch 'develop' into code_coverage_wiki_instruction
BenHenning Aug 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/coverage_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Find CI workflow ru for PR
- name: Find CI workflow run for PR
id: find-workflow-run
uses: actions/github-script@v7
continue-on-error: true
Expand Down
28 changes: 14 additions & 14 deletions wiki/Oppia-Android-Code-Coverage.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ import org.junit.Test
import com.google.common.truth.Truth.assertThat

class checkSignTest {
@Test
fun testCheckSign_withPositiveInteger_returnsPositive() {
assertThat(checkSign(4)).isEqualTo("Positive")
}
@Test
fun testCheckSign_withPositiveInteger_returnsPositive() {
assertThat(checkSign(4)).isEqualTo("Positive")
}
}
```

Expand All @@ -57,15 +57,15 @@ import org.junit.Test
import com.google.common.truth.Truth.assertThat

class checkSignTest {
@Test
fun testCheckSign_withPositiveInteger_returnsPositive() {
assertThat(checkSign(4)).isEqualTo("Positive")
}

+ @Test
+ fun testCheckSign_withNegativeInteger_returnsNegative() {
+ assertThat(checkSign(-7)).isEqualTo("Negative")
+ }
@Test
fun testCheckSign_withPositiveInteger_returnsPositive() {
assertThat(checkSign(4)).isEqualTo("Positive")
}

+ @Test
+ fun testCheckSign_withNegativeInteger_returnsNegative() {
+ assertThat(checkSign(-7)).isEqualTo("Negative")
+ }
}
```

Expand Down Expand Up @@ -374,7 +374,7 @@ These generated html reports are be used to identify areas of your code that may

To improve code coverage, start by identifying which lines are covered and which are not. To effectively increase coverage, trace the uncovered lines back to their calling functions, and ensure these are executed and tested in your test suites. The corresponding test files for the source code are usually located in the same package within the test directories. Add tests that cover all relevant behavioral scenarios for the uncovered lines to achieve comprehensive testing.

For more guidance on best practices, refer to the [Writing Tests with Good Behavioural Coverage](https://github.com/oppia/oppia-android/wiki/Writing-Tests-With-Good-Behavioural-Coverage) wiki page.
For more guidance on best practices, refer to the [Writing Tests with Good Behavioral Coverage](https://github.com/oppia/oppia-android/wiki/Writing-Tests-With-Good-Behavioral-Coverage) wiki page.

Note: Some files in the app module may have multiple test files, located in the sharedTest and test packages, all testing a single source file. For example: [StateFragment.kt](https://github.com/oppia/oppia-android/blob/develop/app/src/main/java/org/oppia/android/app/player/state/StateFragment.kt) has 2 test files [StateFragmentTest.kt](https://github.com/oppia/oppia-android/blob/develop/app/src/sharedTest/java/org/oppia/android/app/player/state/StateFragmentTest.kt) under ``app/src/sharedTest`` and [StateFragmentLocalTest.kt](https://github.com/oppia/oppia-android/blob/develop/app/src/test/java/org/oppia/android/app/player/state/StateFragmentLocalTest.kt) under ``app/src/test``.

Expand Down
Loading
Loading