mentorship-flutter
mentorship-flutter copied to clipboard
tests: add first Unit tests
Description
Units tests for flutter client :) . Not all atm tho, these tests are only for auth and login. Also added flutter test
in the gitthub ci/cd to have unit tests on each PR and build. Finally this also integreate codecov.io with which we can keep a check on the current code coverage as shown below.
Fixes #106
Flutter Channel:
- [x] I have used the Flutter Beta channel on my local machine
Type of Change:
Delete irrelevant options.
- Quality Assurance
Code/Quality Assurance Only
- New feature (non-breaking change which adds functionality pre-approved by mentors)
How Has This Been Tested?
Physical device, flutter test
screenshot below.
We also get a really good coverage for the part thats written, code conv screenshot below
Checklist:
Delete irrelevant options.
- [x] My PR follows the style guidelines of this project
- [x] I have performed a self-review of my own code or materials
- [x] I have commented my code or provided relevant documentation, particularly in hard-to-understand areas
- [x] I have made corresponding changes to the documentation
- [x] Any dependent changes have been merged
Code/Quality Assurance Only
- [x] My changes generate no new warnings
@anitab-org/qa-team Can someone test this? Nothing should be broken but just to be safe :) Only login had some changes, so if that works everything else will work like before .
shouldn't have pushed coverage :facepalm:
The current android test fails because we do not have the secret setup, will contact May on Zulip regarding this.
Codecov Report
exclamation No coverage uploaded for pull request base (
develop@48318c4
). Click here to learn what that means. The diff coverage isn/a
.@@ Coverage Diff @@ ## develop #104 +/- ## ========================================== Coverage ? 18.02% ========================================== Files ? 25 Lines ? 283 Branches ? 0 ========================================== Hits ? 51 Misses ? 232 Partials ? 0
Continue to review full report at Codecov.
Legend - Click here to learn more
Ξ = absolute <relative> (impact)
,ΓΈ = not affected
,? = missing data
Powered by Codecov. Last update 48318c4...cd953c5. Read the comment docs.
uwu :) base fix error will go once we merge atleast one codecov change to develop. @meenakshi-dhanani is this what you were suggesting on the product roadmap session?
Readme badge looks good too. Looks like travis is setup :) Will send final commit soon
Tested codecov reply here . There are 3 options for the codecov bot reply
default: update, if exists. Otherwise post new. once: update, if exists. Otherwise post new. Skip if deleted. new: delete old and post new.
@anitab-org/mentorship-flutter-maintainers Which one should we keep? Also there is a option available to only post this message when there is any change to code coverage. So should we enable this or not? cc: @anitab-org/mentorship-managers , @anitab-org/qa-team
@Techno-Disaster can we have for every PR a report generated for the code coverage? Does this PR do that? And another thing - let's say repo coverage now is 18 percent, then every PR must have a check that the code coverage doesn't fall below existing, 18.
I can see the coverage in the PR.
Can we have another test PR, that shows a check as not passed because coverage reduces?
@Techno-Disaster can we have for every PR a report generated for the code coverage? Does this PR do that? And another thing - let's say repo coverage now is 18 percent, then every PR must have a check that the code coverage doesn't fall below existing, 18.
I can see the coverage in the PR.
Can we have another test PR, that shows a check as not passed because coverage reduces?
@meenakshi-dhanani regarding your first question, yes the codecov will reply for every PR made on this repo, and for your 2nd doubt I updated the PR :) If the codecov falls below the existing percentage, it will give a failed check. PR with updated code here
cc: @anitab-org/mentorship-flutter-maintainers @anitab-org/qa-team
@bartekpacia @isabelcosta @meenakshi-dhanani Can you review this PR so i can add more tests?
I'm approving to unblock you from these unit tests. Please create issues related to improvements that can come from this merge. @Techno-Disaster thank you for writing these tests this will be very important for the product quality.
Thank you @isabelcosta . I will merge these once i get a reply from Bartek for the above comment. On hold till then :)
No problem @Techno-Disaster ! great work you are doing here π π π
Anyways i was able to fix this :facepalm: wasn't thinking straight earlier i guess. Could you give it a quick review @bartekpacia @isabelcosta
Are you doing the "run tests" step on GitHub Actions / TravisCI? @Techno-Disaster
Are you doing the "run tests" step on GitHub Actions / TravisCI? @Techno-Disaster
it's on travis @isabelcosta I know we have planned to move to GH actions, but can wr merge this first and move the CI/Cd in a different issue and PR?
@bartekpacia could you review this?
@anitab-org/mentorship-flutter-maintainers any update on this? I'm planning to write more tests today and send a PR, would like to see the new codecov bot working on it.
I already approved @Techno-Disaster Can you start creating the issues for each test you are thinking of creating, and leave some of them open for the community to take and use your tests as an example. 1 issue per feature you wish to test would be the best, so PRs as smaller and easier to review.
Status on hold, waiting for #117 to merge because bloc 6.0.1 has some breaking changes on bloc_test too. Once that gets merged I'll update this PR with bloc 6.0.1 too :)
@Techno-Disaster can you fix the merge conflicts and then I can approve and call out for more reviewers to get this to the finish line
@Techno-Disaster can you fix the merge conflicts and then I can approve and call out for more reviewers to get this to the finish line
done
Codecov Report
:exclamation: No coverage uploaded for pull request base (
develop@a4d58f2
). Click here to learn what that means. The diff coverage isn/a
.
@@ Coverage Diff @@
## develop #104 +/- ##
==========================================
Coverage ? 17.25%
==========================================
Files ? 25
Lines ? 284
Branches ? 0
==========================================
Hits ? 49
Misses ? 235
Partials ? 0
@Techno-Disaster where are you running these tests, in what github action? I don't see it.
@Techno-Disaster where are you running these tests, in what github action? I don't see it.
No, this is done on travis
@Techno-Disaster where are you running these tests, in what github action? I don't see it.
No, this is done on travis
got it, found it
@robotjellyzone can you please add a review to this again? We need one more to merge :)