Skip to content

Upload tests #2086

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

Merged
merged 5 commits into from
Dec 10, 2018
Merged

Upload tests #2086

merged 5 commits into from
Dec 10, 2018

Conversation

maskaravivek
Copy link
Member

@maskaravivek maskaravivek commented Dec 7, 2018

Description (required)

Fixes Part of #705

What changes did you make and why?

Added unit tests.

Have added test cases for whatever code flows could be tested with no or minor refactoring. Haven't taken up major refactoring to accommodate more test cases.

  • FileProcessor cannot be tested currently as it creates instances of GPSExtractor and File which makes it impossible to mock.
  • GPSExtractor again cannot be tested as it is creating instances of ExifInterface

Tests performed (required)

Tests pass. If both the checks for this PR pass, then it can be merged to master. No functionality has been changed.

@codecov-io
Copy link

codecov-io commented Dec 7, 2018

Codecov Report

Merging #2086 into master will increase coverage by 1.59%.
The diff coverage is 60%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #2086      +/-   ##
=========================================
+ Coverage    4.02%   5.61%   +1.59%     
=========================================
  Files         226     225       -1     
  Lines       11467   11371      -96     
  Branches     1064    1063       -1     
=========================================
+ Hits          461     638     +177     
+ Misses      10972   10681     -291     
- Partials       34      52      +18
Impacted Files Coverage Δ
.../nrw/commons/widget/HeightLimitedRecyclerView.java 0% <ø> (ø)
...a/fr/free/nrw/commons/upload/FileUtilsWrapper.java 0% <0%> (ø)
...ain/java/fr/free/nrw/commons/upload/FileUtils.java 2.23% <0%> (-0.02%) ⬇️
...java/fr/free/nrw/commons/upload/UploadService.java 0% <0%> (ø) ⬆️
.../java/fr/free/nrw/commons/upload/GPSExtractor.java 4.83% <25%> (+4.83%) ⬆️
...n/java/fr/free/nrw/commons/CommonsApplication.java 44.57% <50%> (+0.67%) ⬆️
...a/fr/free/nrw/commons/upload/UploadController.java 27.9% <50%> (+27.9%) ⬆️
...java/fr/free/nrw/commons/upload/FileProcessor.java 3.94% <66.66%> (+3.94%) ⬆️
...n/java/fr/free/nrw/commons/upload/UploadModel.java 58.29% <95%> (+58.29%) ⬆️
... and 8 more

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 1070137...36e9f5a. Read the comment docs.

@maskaravivek maskaravivek changed the title [WIP] Upload tests Upload tests Dec 10, 2018
@commons-app commons-app deleted a comment Dec 10, 2018
class GPSExtractorTest {

@Test
fun getCoords() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should these empty tests be removed?

@misaochan
Copy link
Member

Looks good to me. Happy to merge after the empty tests for GPSExtractor are cleaned up. :)

@maskaravivek
Copy link
Member Author

@misaochan Have just updated the PR addressing the comment.

@misaochan
Copy link
Member

Thanks @maskaravivek !

@misaochan misaochan merged commit f3a90c0 into commons-app:master Dec 10, 2018
@domdomegg domdomegg mentioned this pull request Mar 17, 2019
@maskaravivek maskaravivek deleted the uploadTests branch March 23, 2019 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants