Skip to content

Commit

Permalink
fix remaining CI tests
Browse files Browse the repository at this point in the history
Signed-off-by: tobiasKaminsky <[email protected]>
  • Loading branch information
tobiasKaminsky committed Oct 13, 2023
1 parent e6cc819 commit c410fbb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 26 deletions.
28 changes: 2 additions & 26 deletions app/src/androidTest/java/com/owncloud/android/UploadIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
import com.owncloud.android.operations.UploadFileOperation;
import com.owncloud.android.utils.FileStorageUtils;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

Expand Down Expand Up @@ -106,29 +105,6 @@ public void before() throws IOException {
createDummyFiles();
}

@After
public void after() {
RemoteOperationResult result = new RefreshFolderOperation(getStorageManager().getFileByPath("/"),
System.currentTimeMillis() / 1000L,
false,
true,
getStorageManager(),
user,
targetContext)
.execute(client);

// cleanup only if folder exists
if (result.isSuccess() && getStorageManager().getFileByDecryptedRemotePath(FOLDER) != null) {
new RemoveFileOperation(getStorageManager().getFileByDecryptedRemotePath(FOLDER),
false,
user,
false,
targetContext,
getStorageManager())
.execute(client);
}
}

@Test
public void testEmptyUpload() {
OCUpload ocUpload = new OCUpload(FileStorageUtils.getTemporalPath(account.name) + "/empty.txt",
Expand Down Expand Up @@ -529,8 +505,8 @@ public void testMetadata() throws IOException, AccountUtils.AccountNotFoundExcep

assertNotNull(ocFile);
assertEquals(remotePath, ocFile.getRemotePath());
assertEquals(new ImageDimension(451f, 529f), ocFile.getImageDimension());
assertEquals(new GeoLocation(49.99679166666667, 8.67198611111111), ocFile.getGeoLocation());
assertEquals(new ImageDimension(300f, 200f), ocFile.getImageDimension());
assertEquals(new GeoLocation(64, -46), ocFile.getGeoLocation());
}

private void verifyStoragePath(OCFile file) {
Expand Down
8 changes: 8 additions & 0 deletions app/src/androidTest/java/com/owncloud/android/ui/LoginIT.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
*/
package com.owncloud.android.ui

import android.os.Build
import androidx.test.core.app.ActivityScenario
import androidx.test.espresso.Espresso
import androidx.test.espresso.action.ViewActions
Expand All @@ -28,6 +29,7 @@ import androidx.test.espresso.web.sugar.Web
import androidx.test.espresso.web.webdriver.DriverAtoms
import androidx.test.espresso.web.webdriver.Locator
import androidx.test.filters.LargeTest
import androidx.test.filters.SdkSuppress
import androidx.test.platform.app.InstrumentationRegistry
import com.nextcloud.client.account.UserAccountManager
import com.nextcloud.client.account.UserAccountManagerImpl
Expand Down Expand Up @@ -59,6 +61,12 @@ class LoginIT : AbstractIT() {
@Test
@Throws(InterruptedException::class)
@Suppress("MagicNumber", "SwallowedException")

/**
* The CI/CD pipeline is encountering issues related to the Android version for this functionality.
* Therefore the test will only be executed on Android versions 10 and above.
*/
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.Q)
fun login() {
val arguments = InstrumentationRegistry.getArguments()
val baseUrl = arguments.getString("TEST_SERVER_URL")!!
Expand Down

0 comments on commit c410fbb

Please sign in to comment.