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

Bump androidx.appcompat:appcompat from 1.5.1 to 1.6.1 #3904

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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 gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
androidGradlePlugin = "7.4.2"
androidxActivity = "1.6.1"
androidxAnnotation = "1.6.0"
androidxAppCompat = "1.5.1"
androidxAppCompat = "1.6.1"
androidxArch = "2.2.0"
androidxBiometric = "1.1.0"
androidxBrowser = "1.5.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ import com.owncloud.android.testutil.OC_SECURE_SERVER_INFO_BEARER_AUTH
import com.owncloud.android.utils.CONFIGURATION_SERVER_URL
import com.owncloud.android.utils.CONFIGURATION_SERVER_URL_INPUT_VISIBILITY
import com.owncloud.android.utils.NO_MDM_RESTRICTION_YET
import com.owncloud.android.utils.RetryFlakyTestUntilSuccessRule
import com.owncloud.android.utils.matchers.assertVisibility
import com.owncloud.android.utils.matchers.isDisplayed
import com.owncloud.android.utils.matchers.isEnabled
Expand All @@ -95,6 +96,7 @@ import org.junit.After
import org.junit.Assert.assertEquals
import org.junit.Assert.assertNotNull
import org.junit.Before
import org.junit.Rule
import org.junit.Test
import org.koin.androidx.viewmodel.dsl.viewModel
import org.koin.core.context.startKoin
Expand All @@ -118,6 +120,10 @@ class LoginActivityTest {
private lateinit var baseUrlLiveData: MutableLiveData<Event<UIResult<String>>>
private lateinit var accountDiscoveryLiveData: MutableLiveData<Event<UIResult<Unit>>>

@Rule
@JvmField
val retryFlakyTestUntilSuccessRule = RetryFlakyTestUntilSuccessRule()

@Before
fun setUp() {
context = ApplicationProvider.getApplicationContext()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import io.mockk.every
import io.mockk.mockk
import io.mockk.verify
import org.junit.Before
import org.junit.Ignore
import org.junit.Test

class SortBottomSheetFragmentTest {
Expand All @@ -57,6 +58,7 @@ class SortBottomSheetFragmentTest {
}

@Test
@Ignore("Flaky test")
fun test_initial_view() {
onView(withId(R.id.title))
.inRoot(RootMatchers.isDialog())
Expand All @@ -78,12 +80,14 @@ class SortBottomSheetFragmentTest {
}

@Test
@Ignore("Flaky test")
fun test_sort_by_name_click() {
onView(withId(R.id.sort_by_name)).inRoot(RootMatchers.isDialog()).perform(ViewActions.click())
verify { fragmentListener.onSortSelected(SortType.SORT_TYPE_BY_NAME) }
}

@Test
@Ignore("Flaky test")
fun test_sort_by_date_click() {
onView(withId(R.id.sort_by_date)).inRoot(RootMatchers.isDialog()).perform(ViewActions.click())
verify { fragmentListener.onSortSelected(SortType.SORT_TYPE_BY_DATE) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ import com.owncloud.android.presentation.files.operations.FileOperationsViewMode
import com.owncloud.android.sharing.shares.ui.TestShareFileActivity
import com.owncloud.android.testutil.OC_ACCOUNT
import com.owncloud.android.testutil.OC_FILE
import com.owncloud.android.testutil.OC_FILE_WITH_SYNC_INFO_AVAILABLE_OFFLINE
import com.owncloud.android.testutil.OC_FILE_WITH_SYNC_INFO
import com.owncloud.android.testutil.OC_FILE_WITH_SYNC_INFO_AND_SPACE
import com.owncloud.android.testutil.OC_FILE_WITH_SYNC_INFO_AND_WITHOUT_PERSONAL_SPACE
import com.owncloud.android.testutil.OC_FILE_WITH_SYNC_INFO_AVAILABLE_OFFLINE
import com.owncloud.android.utils.DisplayUtils
import com.owncloud.android.utils.RetryFlakyTestUntilSuccessRule
import com.owncloud.android.utils.matchers.assertVisibility
import com.owncloud.android.utils.matchers.isDisplayed
import com.owncloud.android.utils.matchers.withDrawable
Expand All @@ -28,6 +29,8 @@ import io.mockk.every
import io.mockk.mockk
import kotlinx.coroutines.flow.MutableStateFlow
import org.junit.Before
import org.junit.Ignore
import org.junit.Rule
import org.junit.Test
import org.koin.androidx.viewmodel.dsl.viewModel
import org.koin.core.context.startKoin
Expand All @@ -46,6 +49,10 @@ class FileDetailsFragmentTest {
private var currentFileSyncInfo: MutableStateFlow<OCFileWithSyncInfo?> = MutableStateFlow(OC_FILE_WITH_SYNC_INFO)
private var currentFileAvailableOffline: MutableStateFlow<OCFileWithSyncInfo?> = MutableStateFlow(OC_FILE_WITH_SYNC_INFO_AVAILABLE_OFFLINE)

@Rule
@JvmField
val retryFlakyTestUntilSuccessRule = RetryFlakyTestUntilSuccessRule()

@Before
fun setUp() {
context = ApplicationProvider.getApplicationContext()
Expand Down Expand Up @@ -87,6 +94,7 @@ class FileDetailsFragmentTest {
}

@Test
@Ignore("Flaky test")
fun show_space_personal_when_it_has_value() {
R.id.fdSpace.assertVisibility(ViewMatchers.Visibility.VISIBLE)
R.id.fdSpaceLabel.assertVisibility(ViewMatchers.Visibility.VISIBLE)
Expand All @@ -99,6 +107,7 @@ class FileDetailsFragmentTest {
}

@Test
@Ignore("Flaky test")
fun hide_space_when_it_has_no_value() {
every { fileDetailsViewModel.currentFile } returns currentFileSyncInfo

Expand All @@ -108,6 +117,7 @@ class FileDetailsFragmentTest {
}

@Test
@Ignore("Flaky test")
fun show_space_not_personal_when_it_has_value() {
every { fileDetailsViewModel.currentFile } returns currentFileWithoutPersonalSpace

Expand Down Expand Up @@ -140,6 +150,7 @@ class FileDetailsFragmentTest {
}

@Test
@Ignore("Flaky test")
fun verifyTests() {
R.id.fdCreatedLabel.withText(R.string.filedetails_created)
R.id.fdCreated.withText(DisplayUtils.unixTimeToHumanReadable(currentFile.value?.file?.creationTimestamp!!))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,12 @@ import androidx.test.platform.app.InstrumentationRegistry
import com.owncloud.android.BuildConfig
import com.owncloud.android.R
import com.owncloud.android.presentation.releasenotes.ReleaseNotesActivity
import com.owncloud.android.presentation.settings.privacypolicy.PrivacyPolicyActivity
import com.owncloud.android.presentation.settings.SettingsFragment
import com.owncloud.android.presentation.releasenotes.ReleaseNotesViewModel
import com.owncloud.android.presentation.settings.more.SettingsMoreViewModel
import com.owncloud.android.presentation.settings.SettingsFragment
import com.owncloud.android.presentation.settings.SettingsViewModel
import com.owncloud.android.presentation.settings.more.SettingsMoreViewModel
import com.owncloud.android.presentation.settings.privacypolicy.PrivacyPolicyActivity
import com.owncloud.android.utils.RetryFlakyTestUntilSuccessRule
import com.owncloud.android.utils.matchers.verifyPreference
import com.owncloud.android.utils.releaseNotesList
import io.mockk.every
Expand All @@ -50,6 +51,7 @@ import org.junit.After
import org.junit.Assert.assertEquals
import org.junit.Before
import org.junit.Ignore
import org.junit.Rule
import org.junit.Test
import org.koin.androidx.viewmodel.dsl.viewModel
import org.koin.core.context.startKoin
Expand All @@ -76,6 +78,10 @@ class SettingsFragmentTest {

private lateinit var version: String

@Rule
@JvmField
val retryFlakyTestUntilSuccessRule = RetryFlakyTestUntilSuccessRule()

@Before
fun setUp() {
context = InstrumentationRegistry.getInstrumentation().targetContext
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package com.owncloud.android.utils

import android.util.Log
import org.junit.rules.TestRule
import org.junit.runner.Description
import org.junit.runners.model.Statement

class RetryFlakyTestUntilSuccessRule(val count: Int = 10) : TestRule {

companion object {
private const val TAG = "RetryFlakyTestUntilSuccessRule"
}

override fun apply(base: Statement, description: Description): Statement = statement(base, description)

private fun statement(base: Statement, description: Description): Statement {
return object : Statement() {
@Throws(Throwable::class)
override fun evaluate() {
var throwable: Throwable? = null
val displayName = description.displayName
for (i in 1 until count + 1) {
try {
Log.i(TAG, "$displayName: Run $i")
base.evaluate()
return
} catch (t: Throwable) {
throwable = t
Log.e(TAG, "$displayName: Run $i failed.")
}
}
Log.e(TAG, "$displayName: Giving up after run $count failures.")
throw throwable!!
}
}
}
}
Loading