[EPIC] Tests refactoring
Open
Nobody has claimed this yet.
Epic
QA
- Dominant language
- Kotlin
- Stars
- 4.2k
- Forks
- 3.1k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 7
Description
Current status of tests in ownCloud Android app
We're in the process of refactoring some of the tests or the way we test in the app. We have 2 types of tests in code: unit tests and UI tests.
Unit tests
We want to create unit tests for classes that on the one hand check that their methods return the expected result and on the other hand verify that their methods call the corresponding inner methods:
owncloudData module:
- Datasources classes: https://github.com/owncloud/android/issues/4063#issuecomment-1824472339
- Repository classes: https://github.com/owncloud/android/issues/4063#issuecomment-1825738561
Things to discuss
- Check migration tests and remove them if not useful
Answer: - Check why
authentication.datasources.implementationis instrumented
Answer: it needs the context, so we need the test to be instrumented to get it - Move providers to another package called
providers?
Answer: yes, they will be moved
UI tests
👷🏼♂️ (We'll discuss about this and update this section...)
Things to discuss
- Naming of the tests: which format should we follow?
testSomethingReturnsFooorsomething - ok - returns foo
Answer: for the moment, we decided to follow the convention:{name of the method} returns {foo} when {conditions or environment} - Are tests which expect exceptions necessary?
Answer: if they just make a mock throw an exception, without the method being tested catching it and doing something with it, they are not necessary since we're not testing real code
Related issues
- https://github.com/owncloud/android/issues/4070
- https://github.com/owncloud/android/issues/4071
- https://github.com/owncloud/android/issues/4072
- https://github.com/owncloud/android/issues/4073
- https://github.com/owncloud/android/issues/4232
- https://github.com/owncloud/android/issues/4233
- https://github.com/owncloud/android/issues/4234
- https://github.com/owncloud/android/issues/4235
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.