From 15cc11e0be417818cd21999c49bd42284636625d Mon Sep 17 00:00:00 2001 From: pradip Date: Thu, 18 Sep 2025 14:13:01 +0545 Subject: [PATCH 1/4] test: make tests inside apiSpaces run over k8s --- .drone.star | 269 +------------------ tests/acceptance/TestHelpers/GraphHelper.php | 3 + tests/acceptance/bootstrap/SpacesContext.php | 5 +- tests/config/drone/k3s/values.yaml | 3 + 4 files changed, 16 insertions(+), 264 deletions(-) diff --git a/.drone.star b/.drone.star index 11a07a34b2a..3888e9f3d1b 100644 --- a/.drone.star +++ b/.drone.star @@ -93,273 +93,12 @@ config = { "skip": False, }, "localApiTests": { - "contractAndLock": { - "suites": [ - "apiContract", - "apiLocks", - ], - "skip": False, - "k8s": True, - }, - "settingsAndNotification": { - "suites": [ - "apiSettings", - "apiNotification", - "apiCors", - ], - "skip": False, - "withRemotePhp": [True], - "emailNeeded": True, - "extraEnvironment": { - "EMAIL_HOST": EMAIL_SMTP_HOST, - "EMAIL_PORT": EMAIL_PORT, - }, - "extraServerEnvironment": { - "OCIS_ADD_RUN_SERVICES": "notifications", - "NOTIFICATIONS_SMTP_HOST": EMAIL_SMTP_HOST, - "NOTIFICATIONS_SMTP_PORT": EMAIL_SMTP_PORT, - "NOTIFICATIONS_SMTP_INSECURE": "true", - "NOTIFICATIONS_SMTP_SENDER": EMAIL_SMTP_SENDER, - "NOTIFICATIONS_DEBUG_ADDR": "0.0.0.0:9174", - }, - }, - "graphUser": { - "suites": [ - "apiGraphUser", - ], - "skip": False, - "withRemotePhp": [True], - }, "spaces": { "suites": [ "apiSpaces", ], "skip": False, - }, - "spacesShares": { - "suites": [ - "apiSpacesShares", - ], - "skip": False, - "k8s": True, - }, - "davOperations": { - "suites": [ - "apiSpacesDavOperation", - "apiDownloads", - "apiAsyncUpload", - "apiDepthInfinity", - "apiArchiver", - "apiActivities", - ], - "skip": False, - }, - "groupAndSearch1": { - "suites": [ - "apiSearch1", - "apiGraph", - "apiGraphGroup", - "apiServiceAvailability", - ], - "skip": False, - "k8s": False, - }, - "search2": { - "suites": [ - "apiSearch2", - "apiSearchContent", - ], - "tikaNeeded": True, - "skip": False, - "k8s": False, - }, - "sharingNg1": { - "suites": [ - "apiSharingNgShares", - "apiReshare", - "apiSharingNgPermissions", - ], - "skip": False, - "withRemotePhp": [True], - }, - "sharingNgAdditionalShareRole": { - "suites": [ - "apiSharingNgAdditionalShareRole", - ], - "skip": False, - "k8s": True, - "withRemotePhp": [True], - }, - "sharingNgShareInvitation": { - "suites": [ - "apiSharingNgDriveInvitation", - "apiSharingNgItemInvitation", - ], - "skip": False, - "withRemotePhp": [True], - }, - "sharingNgLinkShare": { - "suites": [ - "apiSharingNgDriveLinkShare", - "apiSharingNgItemLinkShare", - "apiSharingNgLinkShareManagement", - ], - "skip": False, - "withRemotePhp": [True], - }, - "antivirus": { - "suites": [ - "apiAntivirus", - ], - "skip": False, - "antivirusNeeded": True, - "extraServerEnvironment": { - "ANTIVIRUS_SCANNER_TYPE": "clamav", - "ANTIVIRUS_CLAMAV_SOCKET": "tcp://clamav:3310", - "POSTPROCESSING_STEPS": "virusscan", - "OCIS_ADD_RUN_SERVICES": "antivirus", - "ANTIVIRUS_DEBUG_ADDR": "0.0.0.0:9297", - }, - }, - "ocmAndAuthApp": { - "suites": [ - "apiOcm", - "apiAuthApp", - ], - "skip": False, - "withRemotePhp": [True], - "federationServer": True, - "emailNeeded": True, - "extraEnvironment": { - "EMAIL_HOST": EMAIL_SMTP_HOST, - "EMAIL_PORT": EMAIL_PORT, - }, - "extraServerEnvironment": { - "OCIS_ADD_RUN_SERVICES": "ocm,notifications,auth-app", - "OCIS_ENABLE_OCM": True, - "OCM_OCM_INVITE_MANAGER_INSECURE": True, - "OCM_OCM_SHARE_PROVIDER_INSECURE": True, - "OCM_OCM_STORAGE_PROVIDER_INSECURE": True, - "OCM_OCM_PROVIDER_AUTHORIZER_PROVIDERS_FILE": "%s" % dirs["ocmProviders"], - # mail notifications - "NOTIFICATIONS_SMTP_HOST": EMAIL_SMTP_HOST, - "NOTIFICATIONS_SMTP_PORT": EMAIL_SMTP_PORT, - "NOTIFICATIONS_SMTP_INSECURE": "true", - "NOTIFICATIONS_SMTP_SENDER": EMAIL_SMTP_SENDER, - # auth-app - "PROXY_ENABLE_APP_AUTH": True, - }, - }, - "wopi": { - "suites": [ - "apiCollaboration", - ], - "skip": False, - "withRemotePhp": [True], - "collaborationServiceNeeded": True, - "extraServerEnvironment": { - "GATEWAY_GRPC_ADDR": "0.0.0.0:9142", - }, - }, - "cliCommands": { - "suites": [ - "cliCommands", - ], - "skip": False, - "withRemotePhp": [True], - "antivirusNeeded": True, - "emailNeeded": True, - "extraEnvironment": { - "EMAIL_HOST": EMAIL_SMTP_HOST, - "EMAIL_PORT": EMAIL_PORT, - }, - "extraServerEnvironment": { - "NOTIFICATIONS_SMTP_HOST": EMAIL_SMTP_HOST, - "NOTIFICATIONS_SMTP_PORT": EMAIL_SMTP_PORT, - "NOTIFICATIONS_SMTP_INSECURE": "true", - "NOTIFICATIONS_SMTP_SENDER": EMAIL_SMTP_SENDER, - "NOTIFICATIONS_DEBUG_ADDR": "0.0.0.0:9174", - "ANTIVIRUS_SCANNER_TYPE": "clamav", - "ANTIVIRUS_CLAMAV_SOCKET": "tcp://clamav:3310", - "OCIS_ADD_RUN_SERVICES": "antivirus,notifications", - }, - }, - }, - "coreApiTests": { - "1": { - "suites": [ - "coreApiAuth", - "coreApiCapabilities", - "coreApiFavorites", - "coreApiMain", - "coreApiVersions", - ], - "skip": False, - "withRemotePhp": [True], - }, - "2": { - "suites": [ - "coreApiShareManagementBasicToShares", - "coreApiShareManagementToShares", - ], - "skip": False, "k8s": True, - "withRemotePhp": [True], - }, - "3": { - "suites": [ - "coreApiSharees", - "coreApiSharePublicLink2", - ], - "skip": False, - "withRemotePhp": [True], - }, - "4": { - "suites": [ - "coreApiShareOperationsToShares1", - "coreApiShareOperationsToShares2", - "coreApiSharePublicLink1", - "coreApiShareCreateSpecialToShares1", - "coreApiShareCreateSpecialToShares2", - "coreApiShareUpdateToShares", - ], - "skip": False, - "k8s": True, - "withRemotePhp": [True], - }, - "5": { - "suites": [ - "coreApiTrashbin", - "coreApiTrashbinRestore", - "coreApiWebdavEtagPropagation1", - "coreApiWebdavEtagPropagation2", - ], - "skip": False, - "k8s": True, - }, - "6": { - "suites": [ - "coreApiWebdavDelete", - "coreApiWebdavOperations", - "coreApiWebdavMove2", - ], - "skip": False, - }, - "7": { - "suites": [ - "coreApiWebdavProperties", - ], - "skip": False, - "k8s": True, - }, - "8": { - "suites": [ - "coreApiWebdavMove1", - "coreApiWebdavPreviews", - "coreApiWebdavUpload", - "coreApiWebdavUploadTUS", - ], - "skip": False, }, }, "e2eTests": { @@ -1087,7 +826,7 @@ def localApiTestPipeline(ctx): params[item] = matrix[item] if item in matrix else defaults[item] for storage in params["storages"]: for run_with_remote_php in params["withRemotePhp"]: - run_on_k8s = params["k8s"] and ctx.build.event == "cron" + run_on_k8s = params["k8s"] ocis_url = OCIS_URL if run_on_k8s: ocis_url = "https://%s" % OCIS_SERVER_NAME @@ -1389,7 +1128,7 @@ def coreApiTestPipeline(ctx): for run_with_remote_php in params["withRemotePhp"]: filter_tags = "~@skipOnGraph&&~@skipOnOcis-%s-Storage" % ("OC" if storage == "owncloud" else "OCIS") expected_failures_file = "%s/expected-failures-API-on-%s-storage.md" % (test_dir, storage.upper()) - run_on_k8s = params["k8s"] and ctx.build.event == "cron" + run_on_k8s = params["k8s"] ocis_url = OCIS_URL if run_on_k8s: ocis_url = "https://%s" % OCIS_SERVER_NAME @@ -3815,6 +3554,7 @@ def deployOcis(): "commands": [ "make -C %s build" % dirs["ocisWrapper"], "mv %s/tests/config/drone/k3s/values.yaml %s/ocis-charts/charts/ocis/ci/deployment-values.yaml" % (dirs["base"], dirs["base"]), + "cat %s/ocis-charts/charts/ocis/ci/deployment-values.yaml" % dirs["base"], "cp -r %s/tests/config/drone/k3s/authbasic %s/ocis-charts/charts/ocis/templates/" % (dirs["base"], dirs["base"]), "cd %s/ocis-charts" % dirs["base"], "sed -i '/{{- define \"ocis.basicServiceTemplates\" -}}/a\\\\ {{- $_ := set .scope \"appNameAuthBasic\" \"authbasic\" -}}' ./charts/ocis/templates/_common/_tplvalues.tpl", @@ -3825,6 +3565,7 @@ def deployOcis(): "sed -i '/name: SHARING_PASSWORD_POLICY_BANNED_PASSWORDS_LIST/,+1d' %s/ocis-charts/charts/ocis/templates/sharing/deployment.yaml" % dirs["base"], "export KUBECONFIG=%s/kubeconfig-$${DRONE_BUILD_NUMBER}.yaml" % dirs["base"], "make helm-install-atomic", + "curl -kv -X 'POST' 'https://ocis-server/graph/v1.0/drives' -H 'Authorization: Basic YWRtaW46YWRtaW4=' -d '{\"name\":\"Space Nameklkj\"}'", ], "volumes": [ { @@ -3844,6 +3585,8 @@ def ociswrapper(): "until test -f $${KUBECONFIG}; do sleep 1s; done", "kubectl get pods -A", "kubectl get ingress -A", + "POD_NAME=$(kubectl get pods -n ocis --no-headers | grep graph | awk '{print $1}')", + "kubectl describe pod $POD_NAME -n ocis", "%s/bin/ociswrapper serve --url https://ocis-server --admin-username admin --admin-password admin --skip-ocis-run" % dirs["ocisWrapper"], ], "detach": True, diff --git a/tests/acceptance/TestHelpers/GraphHelper.php b/tests/acceptance/TestHelpers/GraphHelper.php index 91fc25b4926..4307a520c9e 100644 --- a/tests/acceptance/TestHelpers/GraphHelper.php +++ b/tests/acceptance/TestHelpers/GraphHelper.php @@ -312,6 +312,7 @@ public static function editUser( $accountEnabled, ); $url = self::getFullUrl($baseUrl, 'users/' . $userId); + var_dump($url, $payload); return HttpRequestHelper::sendRequest( $url, $method, @@ -982,6 +983,8 @@ public static function getMySpaces( $urlArguments = $urlArguments ? "?$urlArguments" : ""; $url = self::getFullUrl($baseUrl, "me/drives" . $urlArguments); + var_dump("urllllll", $url); + return HttpRequestHelper::get($url, $user, $password, $headers, $body); } diff --git a/tests/acceptance/bootstrap/SpacesContext.php b/tests/acceptance/bootstrap/SpacesContext.php index 938d5be09ab..d9af1e1d8a0 100644 --- a/tests/acceptance/bootstrap/SpacesContext.php +++ b/tests/acceptance/bootstrap/SpacesContext.php @@ -653,7 +653,7 @@ public function listAllMySpaces( string $query = '', array $headers = [], ): ResponseInterface { - return GraphHelper::getMySpaces( + $response = GraphHelper::getMySpaces( $this->featureContext->getBaseUrl(), $user, $this->featureContext->getPasswordForUser($user), @@ -661,6 +661,7 @@ public function listAllMySpaces( [], $headers, ); + return $response; } /** @@ -1846,6 +1847,8 @@ public function theUserHasCreatedASpaceByDefaultUsingTheGraphApi( string $spaceName, ): void { $space = ["name" => $spaceName]; + $spaces = $this->listAllMySpaces($user); + var_dump($spaces->getBody()->getContents()); $response = $this->createSpace($user, $space); $this->featureContext->theHTTPStatusCodeShouldBe( 201, diff --git a/tests/config/drone/k3s/values.yaml b/tests/config/drone/k3s/values.yaml index db6025a34f8..c898803ef8e 100644 --- a/tests/config/drone/k3s/values.yaml +++ b/tests/config/drone/k3s/values.yaml @@ -30,6 +30,9 @@ features: - "12345678" - "ownCloud" - "owncloud-1" + quotas: + default: "1000000000" + max: "0" http: cors: From 87ac70814f4819fb28536409e1052f8c1268223e Mon Sep 17 00:00:00 2001 From: pradip Date: Wed, 24 Sep 2025 11:40:24 +0545 Subject: [PATCH 2/4] test: update env for storageusers service --- tests/acceptance/TestHelpers/GraphHelper.php | 3 --- tests/acceptance/bootstrap/SpacesContext.php | 2 -- tests/acceptance/features/apiSpaces/quota.feature | 4 ++-- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/tests/acceptance/TestHelpers/GraphHelper.php b/tests/acceptance/TestHelpers/GraphHelper.php index 4307a520c9e..91fc25b4926 100644 --- a/tests/acceptance/TestHelpers/GraphHelper.php +++ b/tests/acceptance/TestHelpers/GraphHelper.php @@ -312,7 +312,6 @@ public static function editUser( $accountEnabled, ); $url = self::getFullUrl($baseUrl, 'users/' . $userId); - var_dump($url, $payload); return HttpRequestHelper::sendRequest( $url, $method, @@ -983,8 +982,6 @@ public static function getMySpaces( $urlArguments = $urlArguments ? "?$urlArguments" : ""; $url = self::getFullUrl($baseUrl, "me/drives" . $urlArguments); - var_dump("urllllll", $url); - return HttpRequestHelper::get($url, $user, $password, $headers, $body); } diff --git a/tests/acceptance/bootstrap/SpacesContext.php b/tests/acceptance/bootstrap/SpacesContext.php index d9af1e1d8a0..884fd80137c 100644 --- a/tests/acceptance/bootstrap/SpacesContext.php +++ b/tests/acceptance/bootstrap/SpacesContext.php @@ -1847,8 +1847,6 @@ public function theUserHasCreatedASpaceByDefaultUsingTheGraphApi( string $spaceName, ): void { $space = ["name" => $spaceName]; - $spaces = $this->listAllMySpaces($user); - var_dump($spaces->getBody()->getContents()); $response = $this->createSpace($user, $space); $this->featureContext->theHTTPStatusCodeShouldBe( 201, diff --git a/tests/acceptance/features/apiSpaces/quota.feature b/tests/acceptance/features/apiSpaces/quota.feature index 160414f9722..55ab397ff91 100644 --- a/tests/acceptance/features/apiSpaces/quota.feature +++ b/tests/acceptance/features/apiSpaces/quota.feature @@ -122,14 +122,14 @@ Feature: State of the quota @env-config Scenario: upload a file by setting OCIS spaces max quota - Given the config "OCIS_SPACES_MAX_QUOTA" has been set to "10" for "storageusers" service + Given the config "STORAGE_USERS_OCIS_MAX_QUOTA" has been set to "10" for "storageusers" service And user "Brian" has been created with default attributes When user "Brian" uploads file with content "more than 10 bytes content" to "lorem.txt" using the WebDAV API Then the HTTP status code should be "507" @env-config Scenario: try to create a space with quota greater than OCIS spaces max quota - Given the config "OCIS_SPACES_MAX_QUOTA" has been set to "50" for "storageusers" service + Given the config "STORAGE_USERS_OCIS_MAX_QUOTA" has been set to "50" for "storageusers" service And user "Brian" has been created with default attributes And the administrator has assigned the role "Space Admin" to user "Brian" using the Graph API When user "Brian" tries to create a space "new space" of type "project" with quota "51" using the Graph API From 3d4842537b01a4e62a682843ce33e85a14c44689 Mon Sep 17 00:00:00 2001 From: pradip Date: Wed, 24 Sep 2025 12:18:59 +0545 Subject: [PATCH 3/4] test: include rollback function --- tests/acceptance/bootstrap/OcisConfigContext.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/acceptance/bootstrap/OcisConfigContext.php b/tests/acceptance/bootstrap/OcisConfigContext.php index 69d1c91013c..fb4893c2edb 100644 --- a/tests/acceptance/bootstrap/OcisConfigContext.php +++ b/tests/acceptance/bootstrap/OcisConfigContext.php @@ -318,6 +318,7 @@ public function theAdministratorHasStartedServiceSeparatelyWithTheFollowingConfi */ public function rollback(): void { if (\getenv('K8S') === "true") { + $this->rollbackK8sServices(); return; } $this->rollbackServices(); @@ -349,4 +350,18 @@ public function rollbackServices(): void { "Failed to rollback services.", ); } + + /** + * @return void + * @throws GuzzleException + */ + public function rollbackK8sServices(): void { + $url = OcisConfigHelper::getWrapperUrl() . "/k8s/rollback"; + $response = OcisConfigHelper::sendRequest($url, "DELETE"); + Assert::assertEquals( + 200, + $response->getStatusCode(), + "Failed to rollback services.", + ); + } } From 9ebedfb06cf00d277a0ecbcb328ad1611d64312f Mon Sep 17 00:00:00 2001 From: pradip Date: Wed, 24 Sep 2025 13:08:17 +0545 Subject: [PATCH 4/4] test: cleanup --- .drone.star | 270 ++++++++++++++++++- tests/acceptance/bootstrap/SpacesContext.php | 3 +- 2 files changed, 265 insertions(+), 8 deletions(-) diff --git a/.drone.star b/.drone.star index 3888e9f3d1b..59a89178478 100644 --- a/.drone.star +++ b/.drone.star @@ -93,6 +93,43 @@ config = { "skip": False, }, "localApiTests": { + "contractAndLock": { + "suites": [ + "apiContract", + "apiLocks", + ], + "skip": False, + "k8s": True, + }, + "settingsAndNotification": { + "suites": [ + "apiSettings", + "apiNotification", + "apiCors", + ], + "skip": False, + "withRemotePhp": [True], + "emailNeeded": True, + "extraEnvironment": { + "EMAIL_HOST": EMAIL_SMTP_HOST, + "EMAIL_PORT": EMAIL_PORT, + }, + "extraServerEnvironment": { + "OCIS_ADD_RUN_SERVICES": "notifications", + "NOTIFICATIONS_SMTP_HOST": EMAIL_SMTP_HOST, + "NOTIFICATIONS_SMTP_PORT": EMAIL_SMTP_PORT, + "NOTIFICATIONS_SMTP_INSECURE": "true", + "NOTIFICATIONS_SMTP_SENDER": EMAIL_SMTP_SENDER, + "NOTIFICATIONS_DEBUG_ADDR": "0.0.0.0:9174", + }, + }, + "graphUser": { + "suites": [ + "apiGraphUser", + ], + "skip": False, + "withRemotePhp": [True], + }, "spaces": { "suites": [ "apiSpaces", @@ -100,6 +137,231 @@ config = { "skip": False, "k8s": True, }, + "spacesShares": { + "suites": [ + "apiSpacesShares", + ], + "skip": False, + "k8s": True, + }, + "davOperations": { + "suites": [ + "apiSpacesDavOperation", + "apiDownloads", + "apiAsyncUpload", + "apiDepthInfinity", + "apiArchiver", + "apiActivities", + ], + "skip": False, + }, + "groupAndSearch1": { + "suites": [ + "apiSearch1", + "apiGraph", + "apiGraphGroup", + "apiServiceAvailability", + ], + "skip": False, + "k8s": False, + }, + "search2": { + "suites": [ + "apiSearch2", + "apiSearchContent", + ], + "tikaNeeded": True, + "skip": False, + "k8s": False, + }, + "sharingNg1": { + "suites": [ + "apiSharingNgShares", + "apiReshare", + "apiSharingNgPermissions", + ], + "skip": False, + "withRemotePhp": [True], + }, + "sharingNgAdditionalShareRole": { + "suites": [ + "apiSharingNgAdditionalShareRole", + ], + "skip": False, + "k8s": True, + "withRemotePhp": [True], + }, + "sharingNgShareInvitation": { + "suites": [ + "apiSharingNgDriveInvitation", + "apiSharingNgItemInvitation", + ], + "skip": False, + "withRemotePhp": [True], + }, + "sharingNgLinkShare": { + "suites": [ + "apiSharingNgDriveLinkShare", + "apiSharingNgItemLinkShare", + "apiSharingNgLinkShareManagement", + ], + "skip": False, + "withRemotePhp": [True], + }, + "antivirus": { + "suites": [ + "apiAntivirus", + ], + "skip": False, + "antivirusNeeded": True, + "extraServerEnvironment": { + "ANTIVIRUS_SCANNER_TYPE": "clamav", + "ANTIVIRUS_CLAMAV_SOCKET": "tcp://clamav:3310", + "POSTPROCESSING_STEPS": "virusscan", + "OCIS_ADD_RUN_SERVICES": "antivirus", + "ANTIVIRUS_DEBUG_ADDR": "0.0.0.0:9297", + }, + }, + "ocmAndAuthApp": { + "suites": [ + "apiOcm", + "apiAuthApp", + ], + "skip": False, + "withRemotePhp": [True], + "federationServer": True, + "emailNeeded": True, + "extraEnvironment": { + "EMAIL_HOST": EMAIL_SMTP_HOST, + "EMAIL_PORT": EMAIL_PORT, + }, + "extraServerEnvironment": { + "OCIS_ADD_RUN_SERVICES": "ocm,notifications,auth-app", + "OCIS_ENABLE_OCM": True, + "OCM_OCM_INVITE_MANAGER_INSECURE": True, + "OCM_OCM_SHARE_PROVIDER_INSECURE": True, + "OCM_OCM_STORAGE_PROVIDER_INSECURE": True, + "OCM_OCM_PROVIDER_AUTHORIZER_PROVIDERS_FILE": "%s" % dirs["ocmProviders"], + # mail notifications + "NOTIFICATIONS_SMTP_HOST": EMAIL_SMTP_HOST, + "NOTIFICATIONS_SMTP_PORT": EMAIL_SMTP_PORT, + "NOTIFICATIONS_SMTP_INSECURE": "true", + "NOTIFICATIONS_SMTP_SENDER": EMAIL_SMTP_SENDER, + # auth-app + "PROXY_ENABLE_APP_AUTH": True, + }, + }, + "wopi": { + "suites": [ + "apiCollaboration", + ], + "skip": False, + "withRemotePhp": [True], + "collaborationServiceNeeded": True, + "extraServerEnvironment": { + "GATEWAY_GRPC_ADDR": "0.0.0.0:9142", + }, + }, + "cliCommands": { + "suites": [ + "cliCommands", + ], + "skip": False, + "withRemotePhp": [True], + "antivirusNeeded": True, + "emailNeeded": True, + "extraEnvironment": { + "EMAIL_HOST": EMAIL_SMTP_HOST, + "EMAIL_PORT": EMAIL_PORT, + }, + "extraServerEnvironment": { + "NOTIFICATIONS_SMTP_HOST": EMAIL_SMTP_HOST, + "NOTIFICATIONS_SMTP_PORT": EMAIL_SMTP_PORT, + "NOTIFICATIONS_SMTP_INSECURE": "true", + "NOTIFICATIONS_SMTP_SENDER": EMAIL_SMTP_SENDER, + "NOTIFICATIONS_DEBUG_ADDR": "0.0.0.0:9174", + "ANTIVIRUS_SCANNER_TYPE": "clamav", + "ANTIVIRUS_CLAMAV_SOCKET": "tcp://clamav:3310", + "OCIS_ADD_RUN_SERVICES": "antivirus,notifications", + }, + }, + }, + "coreApiTests": { + "1": { + "suites": [ + "coreApiAuth", + "coreApiCapabilities", + "coreApiFavorites", + "coreApiMain", + "coreApiVersions", + ], + "skip": False, + "withRemotePhp": [True], + }, + "2": { + "suites": [ + "coreApiShareManagementBasicToShares", + "coreApiShareManagementToShares", + ], + "skip": False, + "k8s": True, + "withRemotePhp": [True], + }, + "3": { + "suites": [ + "coreApiSharees", + "coreApiSharePublicLink2", + ], + "skip": False, + "withRemotePhp": [True], + }, + "4": { + "suites": [ + "coreApiShareOperationsToShares1", + "coreApiShareOperationsToShares2", + "coreApiSharePublicLink1", + "coreApiShareCreateSpecialToShares1", + "coreApiShareCreateSpecialToShares2", + "coreApiShareUpdateToShares", + ], + "skip": False, + "k8s": True, + "withRemotePhp": [True], + }, + "5": { + "suites": [ + "coreApiTrashbin", + "coreApiTrashbinRestore", + "coreApiWebdavEtagPropagation1", + "coreApiWebdavEtagPropagation2", + ], + "skip": False, + "k8s": True, + }, + "6": { + "suites": [ + "coreApiWebdavDelete", + "coreApiWebdavOperations", + "coreApiWebdavMove2", + ], + "skip": False, + }, + "7": { + "suites": [ + "coreApiWebdavProperties", + ], + "skip": False, + "k8s": True, + }, + "8": { + "suites": [ + "coreApiWebdavMove1", + "coreApiWebdavPreviews", + "coreApiWebdavUpload", + "coreApiWebdavUploadTUS", + ], + "skip": False, + }, }, "e2eTests": { "part": { @@ -826,7 +1088,7 @@ def localApiTestPipeline(ctx): params[item] = matrix[item] if item in matrix else defaults[item] for storage in params["storages"]: for run_with_remote_php in params["withRemotePhp"]: - run_on_k8s = params["k8s"] + run_on_k8s = params["k8s"] and ctx.build.event == "cron" ocis_url = OCIS_URL if run_on_k8s: ocis_url = "https://%s" % OCIS_SERVER_NAME @@ -1128,7 +1390,7 @@ def coreApiTestPipeline(ctx): for run_with_remote_php in params["withRemotePhp"]: filter_tags = "~@skipOnGraph&&~@skipOnOcis-%s-Storage" % ("OC" if storage == "owncloud" else "OCIS") expected_failures_file = "%s/expected-failures-API-on-%s-storage.md" % (test_dir, storage.upper()) - run_on_k8s = params["k8s"] + run_on_k8s = params["k8s"] and ctx.build.event == "cron" ocis_url = OCIS_URL if run_on_k8s: ocis_url = "https://%s" % OCIS_SERVER_NAME @@ -3554,7 +3816,6 @@ def deployOcis(): "commands": [ "make -C %s build" % dirs["ocisWrapper"], "mv %s/tests/config/drone/k3s/values.yaml %s/ocis-charts/charts/ocis/ci/deployment-values.yaml" % (dirs["base"], dirs["base"]), - "cat %s/ocis-charts/charts/ocis/ci/deployment-values.yaml" % dirs["base"], "cp -r %s/tests/config/drone/k3s/authbasic %s/ocis-charts/charts/ocis/templates/" % (dirs["base"], dirs["base"]), "cd %s/ocis-charts" % dirs["base"], "sed -i '/{{- define \"ocis.basicServiceTemplates\" -}}/a\\\\ {{- $_ := set .scope \"appNameAuthBasic\" \"authbasic\" -}}' ./charts/ocis/templates/_common/_tplvalues.tpl", @@ -3565,7 +3826,6 @@ def deployOcis(): "sed -i '/name: SHARING_PASSWORD_POLICY_BANNED_PASSWORDS_LIST/,+1d' %s/ocis-charts/charts/ocis/templates/sharing/deployment.yaml" % dirs["base"], "export KUBECONFIG=%s/kubeconfig-$${DRONE_BUILD_NUMBER}.yaml" % dirs["base"], "make helm-install-atomic", - "curl -kv -X 'POST' 'https://ocis-server/graph/v1.0/drives' -H 'Authorization: Basic YWRtaW46YWRtaW4=' -d '{\"name\":\"Space Nameklkj\"}'", ], "volumes": [ { @@ -3585,8 +3845,6 @@ def ociswrapper(): "until test -f $${KUBECONFIG}; do sleep 1s; done", "kubectl get pods -A", "kubectl get ingress -A", - "POD_NAME=$(kubectl get pods -n ocis --no-headers | grep graph | awk '{print $1}')", - "kubectl describe pod $POD_NAME -n ocis", "%s/bin/ociswrapper serve --url https://ocis-server --admin-username admin --admin-password admin --skip-ocis-run" % dirs["ocisWrapper"], ], "detach": True, diff --git a/tests/acceptance/bootstrap/SpacesContext.php b/tests/acceptance/bootstrap/SpacesContext.php index 884fd80137c..938d5be09ab 100644 --- a/tests/acceptance/bootstrap/SpacesContext.php +++ b/tests/acceptance/bootstrap/SpacesContext.php @@ -653,7 +653,7 @@ public function listAllMySpaces( string $query = '', array $headers = [], ): ResponseInterface { - $response = GraphHelper::getMySpaces( + return GraphHelper::getMySpaces( $this->featureContext->getBaseUrl(), $user, $this->featureContext->getPasswordForUser($user), @@ -661,7 +661,6 @@ public function listAllMySpaces( [], $headers, ); - return $response; } /**