Skip to content

test NC16 #938

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

Closed
wants to merge 6 commits into from
Closed
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
110 changes: 103 additions & 7 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,103 @@ trigger:
---
kind: pipeline
type: docker
name: test-stable
name: test-stable-16

steps:
- name: test
image: ghcr.io/nextcloud/continuous-integration-android8:3
privileged: true
environment:
LOG_USERNAME:
from_secret: LOG_USERNAME
LOG_PASSWORD:
from_secret: LOG_PASSWORD
GIT_USERNAME:
from_secret: GIT_USERNAME
GIT_TOKEN:
from_secret: GIT_TOKEN
commands:
- emulator -avd android -no-snapshot -gpu swiftshader_indirect -no-window -no-audio -skin 500x833 &
- sed -i s"#https://server#http://server-oldest-stable#" gradle.properties
- sed -i s"#1#5#" ./library/src/androidTest/java/com/owncloud/android/RetryTestRule.kt
- ./gradlew assembleDebug
- ./scripts/wait_for_emulator.sh
- ./scripts/wait_for_server.sh server-stable-16
- scripts/deleteOutdatedComments.sh "stable16" "Unit" $DRONE_PULL_REQUEST $GIT_USERNAME $GIT_TOKEN
- scripts/deleteOutdatedComments.sh "stable16" "IT" $DRONE_PULL_REQUEST $GIT_USERNAME $GIT_TOKEN
- ./gradlew jacocoTestDebugUnitTestReport || scripts/uploadReport.sh $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER "stable16" "Unit" $DRONE_PULL_REQUEST $GIT_USERNAME $GIT_TOKEN
- ./gradlew installDebugAndroidTest
- ./gradlew createDebugCoverageReport || scripts/uploadReport.sh $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER "stable16" "IT" $DRONE_PULL_REQUEST $GIT_USERNAME $GIT_TOKEN
- ./gradlew combinedTestReport
- curl -Os https://uploader.codecov.io/latest/linux/codecov
- chmod +x codecov
- ./codecov -t 2eec98c3-ff20-4cad-9e08-463471a33431

- name: notify
image: drillster/drone-email
settings:
port: 587
from: [email protected]
recipients_only: true
username:
from_secret: EMAIL_USERNAME
password:
from_secret: EMAIL_PASSWORD
recipients:
from_secret: EMAIL_RECIPIENTS
host:
from_secret: EMAIL_HOST
when:
event:
- push
status:
- failure
branch:
- master
- stable-*

services:
- name: server-stable-16
image: nextcloudci/server:server-13
environment:
SERVER_VERSION: stable16
BRANCH: stable16
commands:
- /initnc.sh
- su www-data -c "php /var/www/html/occ log:manage --level warning"
- su www-data -c "OC_PASS=user1 php /var/www/html/occ user:add --password-from-env --display-name='User One' user1"
- su www-data -c "OC_PASS=user2 php /var/www/html/occ user:add --password-from-env --display-name='User Two' user2"
- su www-data -c "OC_PASS=user3 php /var/www/html/occ user:add --password-from-env --display-name='User Three' user3"
- su www-data -c "OC_PASS=test php /var/www/html/occ user:add --password-from-env --display-name='Test@Test' test@test"
- su www-data -c "OC_PASS=test php /var/www/html/occ user:add --password-from-env --display-name='Test Spaces' 'test test'"
- su www-data -c "php /var/www/html/occ user:setting user2 files quota 1G"
- su www-data -c "php /var/www/html/occ group:add users"
- su www-data -c "php /var/www/html/occ group:adduser users user1"
- su www-data -c "php /var/www/html/occ group:adduser users user2"
- su www-data -c "git clone -b $SERVER_VERSION https://github.com/nextcloud/activity.git /var/www/html/apps/activity/"
- su www-data -c "php /var/www/html/occ app:enable activity"
- su www-data -c "git clone -b $SERVER_VERSION https://github.com/nextcloud/text.git /var/www/html/apps/text/"
- su www-data -c "php /var/www/html/occ app:enable text"
- su www-data -c "git clone -b $SERVER_VERSION https://github.com/nextcloud/end_to_end_encryption.git /var/www/html/apps/end_to_end_encryption/"
- su www-data -c "php /var/www/html/occ app:enable end_to_end_encryption"
- su www-data -c "git clone -b $SERVER_VERSION https://github.com/nextcloud/password_policy.git /var/www/html/apps/password_policy/"
- su www-data -c "php /var/www/html/occ app:enable password_policy"
- su www-data -c "git clone -b $SERVER_VERSION https://github.com/nextcloud/external.git /var/www/html/apps/external/"
- su www-data -c 'php /var/www/html/occ config:app:set external sites --value="{\"1\":{\"id\":1,\"name\":\"Nextcloud\",\"url\":\"https:\/\/www.nextcloud.com\",\"lang\":\"\",\"type\":\"link\",\"device\":\"\",\"icon\":\"external.svg\",\"groups\":[],\"redirect\":false},\"2\":{\"id\":2,\"name\":\"Forum\",\"url\":\"https:\/\/help.nextcloud.com\",\"lang\":\"\",\"type\":\"link\",\"device\":\"\",\"icon\":\"external.svg\",\"groups\":[],\"redirect\":false}}"'
- su www-data -c "php /var/www/html/occ app:enable external"
- su www-data -c "php /var/www/html/occ notification:generate test test"
- /run.sh

trigger:
branch:
- master
event:
- push
- pull_request
---
kind: pipeline
type: docker
name: test-stable-27

steps:
- name: test
Expand All @@ -142,12 +238,12 @@ steps:
- sed -i s"#1#5#" ./library/src/androidTest/java/com/owncloud/android/RetryTestRule.kt
- ./gradlew assembleDebug
- ./scripts/wait_for_emulator.sh
- ./scripts/wait_for_server.sh server-stable
- scripts/deleteOutdatedComments.sh "stable" "Unit" $DRONE_PULL_REQUEST $GIT_USERNAME $GIT_TOKEN
- scripts/deleteOutdatedComments.sh "stable" "IT" $DRONE_PULL_REQUEST $GIT_USERNAME $GIT_TOKEN
- ./gradlew jacocoTestDebugUnitTestReport || scripts/uploadReport.sh $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER "stable" "Unit" $DRONE_PULL_REQUEST $GIT_USERNAME $GIT_TOKEN
- ./scripts/wait_for_server.sh server-stable-27
- scripts/deleteOutdatedComments.sh "stable25" "Unit" $DRONE_PULL_REQUEST $GIT_USERNAME $GIT_TOKEN
- scripts/deleteOutdatedComments.sh "stable25" "IT" $DRONE_PULL_REQUEST $GIT_USERNAME $GIT_TOKEN
- ./gradlew jacocoTestDebugUnitTestReport || scripts/uploadReport.sh $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER "stable25" "Unit" $DRONE_PULL_REQUEST $GIT_USERNAME $GIT_TOKEN
- ./gradlew installDebugAndroidTest
- ./gradlew createDebugCoverageReport || scripts/uploadReport.sh $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER "stable" "IT" $DRONE_PULL_REQUEST $GIT_USERNAME $GIT_TOKEN
- ./gradlew createDebugCoverageReport || scripts/uploadReport.sh $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER "stable25" "IT" $DRONE_PULL_REQUEST $GIT_USERNAME $GIT_TOKEN
- ./gradlew combinedTestReport
- curl -Os https://uploader.codecov.io/latest/linux/codecov
- chmod +x codecov
Expand Down Expand Up @@ -177,7 +273,7 @@ steps:
- stable-*

services:
- name: server-stable
- name: server-stable-27
image: ghcr.io/nextcloud/continuous-integration-shallow-server:latest
environment:
SERVER_VERSION: stable27
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,17 @@ import com.owncloud.android.lib.resources.shares.OCShare
import com.owncloud.android.lib.resources.shares.ShareType
import com.owncloud.android.lib.resources.status.NextcloudVersion
import org.junit.Assert.assertTrue
import org.junit.Before
import org.junit.Test

class DashboardGetWidgetItemsRemoteOperationIT : AbstractIT() {
@Before
fun before() {
requireServerVersion(NextcloudVersion.nextcloud_25)
}

@Test
fun getItems() {
// only on NC25+
testOnlyOnServer(NextcloudVersion.nextcloud_25)

// create folder to have some content
assertTrue(CreateFolderRemoteOperation("/testFolder", false).execute(client2).isSuccess)
assertTrue(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class DashboardListWidgetsRemoteOperationIT : AbstractIT() {
@Test
fun list() {
// only on NC25+
testOnlyOnServer(NextcloudVersion.nextcloud_25)
requireServerVersion(NextcloudVersion.nextcloud_25)

val result = DashboardListWidgetsRemoteOperation().execute(nextcloudClient)
assertTrue(result.isSuccess)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,17 @@

import com.owncloud.android.AbstractIT;
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.resources.status.OwnCloudVersion;

import org.junit.BeforeClass;
import org.junit.Test;

public class DirectEditingCreateFileRemoteOperationIT extends AbstractIT {
@BeforeClass
public static void beforeClass() {
requireServerVersion(OwnCloudVersion.nextcloud_18);
}

@Test
public void createEmptyFile() {
RemoteOperationResult<String> result = new DirectEditingCreateFileRemoteOperation("/test.md",
Expand All @@ -32,9 +39,9 @@ public void createEmptyFile() {
@Test
public void createFileFromTemplate() {
RemoteOperationResult<String> result = new DirectEditingCreateFileRemoteOperation("/test.md",
"text",
"textdocument",
"1")
"text",
"textdocument",
"1")
.execute(client);
assertTrue(result.isSuccess());

Expand All @@ -46,9 +53,9 @@ public void createFileFromTemplate() {
@Test
public void createFileWithSpecialCharacterFromTemplate() {
RemoteOperationResult<String> result = new DirectEditingCreateFileRemoteOperation("/あ.md",
"text",
"textdocument",
"1")
"text",
"textdocument",
"1")
.execute(client);
assertTrue(result.isSuccess());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,16 @@
import com.owncloud.android.AbstractIT;
import com.owncloud.android.lib.common.TemplateList;
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.resources.status.OwnCloudVersion;

import org.junit.BeforeClass;
import org.junit.Test;

public class DirectEditingObtainListOfTemplatesRemoteOperationIT extends AbstractIT {
@BeforeClass
public static void beforeClass() {
requireServerVersion(OwnCloudVersion.nextcloud_18);
}

@Test
public void testGetAll() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,20 @@
package com.nextcloud.android.lib.resources.directediting

import com.owncloud.android.AbstractIT
import com.owncloud.android.lib.resources.status.OwnCloudVersion
import junit.framework.Assert.assertEquals
import junit.framework.Assert.assertFalse
import junit.framework.Assert.assertNotNull
import junit.framework.Assert.assertTrue
import org.junit.Before
import org.junit.Test

class DirectEditingObtainRemoteOperationIT : AbstractIT() {
@Before
fun before() {
requireServerVersion(OwnCloudVersion.nextcloud_18)
}

@Test
fun testGetAll() {
val result = DirectEditingObtainRemoteOperation().execute(client)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,21 @@
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.resources.files.ReadFileRemoteOperation;
import com.owncloud.android.lib.resources.files.UploadFileRemoteOperation;
import com.owncloud.android.lib.resources.status.OwnCloudVersion;

import junit.framework.TestCase;

import org.junit.BeforeClass;
import org.junit.Test;

import java.io.IOException;

public class DirectEditingOpenFileRemoteOperationIT extends AbstractIT {
@BeforeClass
public static void beforeClass() {
requireServerVersion(OwnCloudVersion.nextcloud_18);
}

@Test
public void openFile() throws IOException {
// create file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class ToggleFileLockRemoteOperationIT : AbstractIT() {
@Test
fun lockUnlockFile() {
// only on >= NC24
testOnlyOnServer(nextcloud_24)
requireServerVersion(nextcloud_24)

// create file
val filePath: String = createFile("text")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
package com.nextcloud.android.lib.resources.profile

import com.owncloud.android.AbstractIT
import com.owncloud.android.lib.resources.status.NextcloudVersion
import com.owncloud.android.lib.resources.status.NextcloudVersion.Companion.nextcloud_23
import org.junit.Assert.assertEquals
import org.junit.Assert.assertTrue
import org.junit.Before
Expand All @@ -17,7 +17,7 @@ import org.junit.Test
class GetHoverCardRemoteOperationIT : AbstractIT() {
@Before
fun before() {
testOnlyOnServer(NextcloudVersion.nextcloud_23)
requireServerVersion(nextcloud_23)
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,19 @@
package com.nextcloud.android.lib.resources.search

import com.owncloud.android.AbstractIT
import com.owncloud.android.lib.resources.status.GetCapabilitiesRemoteOperation
import com.owncloud.android.lib.resources.status.OCCapability
import com.owncloud.android.lib.resources.status.OwnCloudVersion
import org.junit.Assert.assertFalse
import com.owncloud.android.lib.resources.status.OCCapability
import com.owncloud.android.lib.resources.status.GetCapabilitiesRemoteOperation
import org.junit.Assert.assertNotNull
import org.junit.Assert.assertNull
import org.junit.Assert.assertTrue
import org.junit.Assert.assertFalse
import org.junit.Assume.assumeTrue
import org.junit.Test

class SearchProvidersRemoteOperationIT : AbstractIT() {
@Test
fun getSearchProviders() {
// only on NC20+
testOnlyOnServer(OwnCloudVersion.nextcloud_20)

val result = nextcloudClient.execute(UnifiedSearchProvidersRemoteOperation())
assertTrue(result.isSuccess)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ import com.owncloud.android.AbstractIT
import com.owncloud.android.lib.resources.files.CreateFolderRemoteOperation
import com.owncloud.android.lib.resources.files.ReadFileRemoteOperation
import com.owncloud.android.lib.resources.files.model.RemoteFile
import com.owncloud.android.lib.resources.status.OwnCloudVersion
import org.junit.Assert.assertEquals
import org.junit.Assert.assertFalse
import org.junit.Assert.assertNotNull
import org.junit.Assert.assertTrue
import org.junit.BeforeClass
import org.junit.Test

class UnifiedSearchRemoteOperationIT : AbstractIT() {
Expand Down Expand Up @@ -76,4 +78,12 @@ class UnifiedSearchRemoteOperationIT : AbstractIT() {
assertTrue(data.entries.isNotEmpty())
assertNotNull(data.entries.find { it.title == "test Folder" })
}

companion object {
@BeforeClass
@JvmStatic
fun before() {
requireServerVersion(OwnCloudVersion.nextcloud_20)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,19 @@
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.resources.files.CreateFolderRemoteOperation;
import com.owncloud.android.lib.resources.files.UploadFileRemoteOperation;
import com.owncloud.android.lib.resources.status.OwnCloudVersion;

import org.junit.BeforeClass;
import org.junit.Test;

import java.io.File;
import java.io.IOException;

public class RichWorkspaceDirectEditingRemoteOperationIT extends AbstractIT {
@BeforeClass
public static void beforeClass() {
requireServerVersion(OwnCloudVersion.nextcloud_18);
}

@Test
public void getEditLinkForRoot() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ protected void longSleep() {
}
}

protected void testOnlyOnServer(OwnCloudVersion version) {
public static void requireServerVersion(OwnCloudVersion version) {
OCCapability ocCapability = (OCCapability) new GetCapabilitiesRemoteOperation()
.execute(nextcloudClient)
.getSingleData();
Expand Down
Loading