Compare commits

..

1 Commits

Author SHA1 Message Date
68a3aa085a ci: Instrumentation tests coverage in ci.
Some checks failed
PR / translations (pull_request) Successful in 39s
PR / PR (pull_request) Successful in 42s
PR / build (pull_request) Successful in 21m52s
PR test / integrationTests (pull_request) Failing after 44m8s
2025-03-30 15:18:37 +02:00
11 changed files with 32 additions and 88 deletions

View File

@ -11,7 +11,7 @@ jobs:
fetch-depth: 0
- name: "Check android app changes"
id: check-android-changes
uses: tj-actions/changed-files@v46
uses: tj-actions/changed-files@v45
with:
files: |
androidApp/src/**

View File

@ -31,9 +31,8 @@ jobs:
fetch-depth: 0
- name: "Check translations changes"
id: check-translations-changes
uses: tj-actions/changed-files@v46
uses: tj-actions/changed-files@v45
with:
base_sha: ${{ github.event.pull_request.base.sha }}
files: |
androidApp/src/main/res/values/strings.xml
- name: upload translation sources

View File

@ -31,6 +31,9 @@ jobs:
- name: Change url until I find a better way to do it
run: |
sed -i "s/const val DEFAULT_URL = \"http:\/\/10\.0\.2\.2\:8888\"/const val DEFAULT_URL = \"http:\/\/172\.17\.0\.1\:8888\"/g" ./androidApp/src/androidTest/kotlin/bou/amine/apps/readerforselfossv2/android/CommonTests.kt
echo '-----------'
cat ./androidApp/src/androidTest/kotlin/bou/amine/apps/readerforselfossv2/android/CommonTests.kt
echo '-----------'
- name: Tests
uses: reactivecircus/android-emulator-runner@v2
with:

View File

@ -1,30 +1,3 @@
**v125040991
- fix: Connectivity toast message was causing issues.
- Changelog for v125030901
--------------------------------------------------------------------
**v125030901
- Merge pull request 'fix-reload' (#195) from fix-reload into master
- fix: Infinite scroll needs loading stats.
- fix: do not reload items on resume.
- Merge pull request 'tests' (#193) from tests into master
- ci: Instrumentation tests coverage in ci.
- ci: Instrumentation tests coverage in ci.
- ci: Instrumentation tests coverage in ci.
- chore: better handling of coroutine dispatchers.
- ci: Instrumentation tests coverage in ci.
- chore: comment robolectric tests for now.
- fix: Fixed source deletion test.
- Merge pull request 'Fix alignment changes resetting reader article position' (#190) from davidoskky/ReaderForSelfoss-multiplatform:alignment into master
- Refactor star icon handling
- Don't restart activity changing alignment
- Changelog for v125030711
--------------------------------------------------------------------
**v125030711
- Merge pull request 'fix: initial status loading issues.' (#192) from connectivity into master

View File

@ -120,7 +120,6 @@ class HomeActivity :
binding.swipeRefreshLayout.setOnRefreshListener {
repository.offlineOverride = false
lastFetchDone = false
items.clear()
getElementsAccordingToTab()
binding.swipeRefreshLayout.isRefreshing = false
}
@ -387,7 +386,6 @@ class HomeActivity :
lastFetchDone = false
elementsShown = ItemType.fromInt(position + 1)
items = ArrayList()
getElementsAccordingToTab()
binding.recyclerView.scrollToPosition(0)
@ -460,28 +458,23 @@ class HomeActivity :
appendResults: Boolean,
itemType: ItemType,
) {
@Suppress("detekt:ComplexCondition")
if ((appendResults && items.size > 0) || (!appendResults && items.size == 0)) {
CountingIdlingResourceSingleton.increment()
binding.swipeRefreshLayout.isRefreshing = true
CoroutineScope(Dispatchers.IO).launch {
repository.displayedItems = itemType
items =
if (appendResults) {
repository.getOlderItems()
} else {
repository.getNewerItems()
}
CountingIdlingResourceSingleton.increment()
launch(Dispatchers.Main) {
binding.swipeRefreshLayout.isRefreshing = false
handleListResult()
CountingIdlingResourceSingleton.decrement()
CountingIdlingResourceSingleton.increment()
binding.swipeRefreshLayout.isRefreshing = true
CoroutineScope(Dispatchers.IO).launch {
repository.displayedItems = itemType
items =
if (appendResults) {
repository.getOlderItems()
} else {
repository.getNewerItems()
}
CountingIdlingResourceSingleton.increment()
launch(Dispatchers.Main) {
binding.swipeRefreshLayout.isRefreshing = false
handleListResult()
CountingIdlingResourceSingleton.decrement()
}
} else {
handleListResult()
CountingIdlingResourceSingleton.decrement()
}
}
@ -541,10 +534,7 @@ class HomeActivity :
}
private fun reloadBadges() {
if (appSettingsService.isInfiniteLoadingEnabled() ||
appSettingsService.isDisplayUnreadCountEnabled() ||
appSettingsService.isDisplayAllCountEnabled()
) {
if (appSettingsService.isDisplayUnreadCountEnabled() || appSettingsService.isDisplayAllCountEnabled()) {
CountingIdlingResourceSingleton.increment()
CoroutineScope(Dispatchers.IO).launch {
repository.reloadBadges()

View File

@ -82,14 +82,13 @@ class MyApp :
} else {
R.string.network_connectivity_lost
}
launch(Dispatchers.Main) {
Toast
.makeText(
applicationContext,
toastMessage,
Toast.LENGTH_SHORT,
).show()
}
Toast
.makeText(
applicationContext,
toastMessage,
Toast.LENGTH_SHORT,
).show()
}
}
}

View File

@ -30,7 +30,7 @@ import org.kodein.di.instance
class ItemCardAdapter(
override val app: Activity,
override var items: ArrayList<SelfossModel.Item>,
override val items: ArrayList<SelfossModel.Item>,
override val updateHomeItems: (ArrayList<SelfossModel.Item>) -> Unit,
) : ItemsAdapter<ItemCardAdapter.ViewHolder>() {
override lateinit var binding: CardItemBinding

View File

@ -21,7 +21,7 @@ import org.kodein.di.instance
class ItemListAdapter(
override val app: Activity,
override var items: ArrayList<SelfossModel.Item>,
override val items: ArrayList<SelfossModel.Item>,
override val updateHomeItems: (ArrayList<SelfossModel.Item>) -> Unit,
) : ItemsAdapter<ItemListAdapter.ViewHolder>() {
override lateinit var binding: ListItemBinding

View File

@ -21,7 +21,7 @@ import org.kodein.di.DIAware
abstract class ItemsAdapter<VH : RecyclerView.ViewHolder?> :
RecyclerView.Adapter<VH>(),
DIAware {
abstract var items: ArrayList<SelfossModel.Item>
abstract val items: ArrayList<SelfossModel.Item>
abstract val repository: Repository
abstract val binding: ViewBinding
abstract val appSettingsService: AppSettingsService
@ -31,7 +31,8 @@ abstract class ItemsAdapter<VH : RecyclerView.ViewHolder?> :
protected val c: Context get() = app.baseContext
fun updateAllItems(items: ArrayList<SelfossModel.Item>) {
this.items = items
this.items.clear()
this.items.addAll(items)
updateHomeItems(items)
notifyDataSetChanged()
}

View File

@ -1,17 +0,0 @@
**v125030901**
- Merge pull request 'fix-reload' (#195) from fix-reload into master
- fix: Infinite scroll needs loading stats.
- fix: do not reload items on resume.
- Merge pull request 'tests' (#193) from tests into master
- ci: Instrumentation tests coverage in ci.
- ci: Instrumentation tests coverage in ci.
- ci: Instrumentation tests coverage in ci.
- chore: better handling of coroutine dispatchers.
- ci: Instrumentation tests coverage in ci.
- chore: comment robolectric tests for now.
- fix: Fixed source deletion test.
- Merge pull request 'Fix alignment changes resetting reader article position' (#190) from davidoskky/ReaderForSelfoss-multiplatform:alignment into master
- Refactor star icon handling
- Don't restart activity changing alignment
- Changelog for v125030711

View File

@ -1,4 +0,0 @@
**v125040991**
- fix: Connectivity toast message was causing issues.
- Changelog for v125030901