From 3b6eaf52714cbcf05d1337724440cf98f6f4f0f7 Mon Sep 17 00:00:00 2001 From: Prajwol Amatya Date: Mon, 26 Aug 2024 16:37:50 +0545 Subject: [PATCH] change suite name to apiCollaboration --- .drone.star | 82 ++++++------------- tests/acceptance/config/behat.yml | 14 ++-- .../wopi.feature} | 6 +- tests/config/drone/app-registry.yaml | 4 +- 4 files changed, 35 insertions(+), 71 deletions(-) rename tests/acceptance/features/{apiAppProvider/appProvider.feature => apiCollaboration/wopi.feature} (86%) diff --git a/.drone.star b/.drone.star index bb4287ee79..657952abef 100644 --- a/.drone.star +++ b/.drone.star @@ -154,14 +154,9 @@ config = { "OCM_OCM_PROVIDER_AUTHORIZER_PROVIDERS_FILE": "%s" % dirs["ocmProviders"], }, }, - "cli": { + "apiWopi": { "suites": [ - "cliCommands", - ], - }, - "apiAppProvider": { - "suites": [ - "apiAppProvider", + "apiCollaboration", ], "skip": False, "collaborationServiceNeeded": True, @@ -173,6 +168,12 @@ config = { "GATEWAY_GRPC_ADDR": "0.0.0.0:9142", }, }, + "cli": { + "suites": [ + "cliCommands", + ], + "skip": False, + }, }, "apiTests": { "numberOfParts": 10, @@ -895,7 +896,7 @@ def localApiTestPipeline(ctx): (waitForClamavService() if params["antivirusNeeded"] else []) + (waitForEmailService() if params["emailNeeded"] else []) + (ocisServer(storage, params["accounts_hash_difficulty"], deploy_type = "federation", extra_server_environment = params["extraServerEnvironment"]) if params["federationServer"] else []) + - (collaborationService(extra_environment = params["extraCollaborationEnvironment"]) if params["collaborationServiceNeeded"] else []) + + (collaborationService(params["extraCollaborationEnvironment"]) if params["collaborationServiceNeeded"] else []) + localApiTests(suite, storage, params["extraEnvironment"]) + logRequests(), "services": emailService() if params["emailNeeded"] else [] + clamavService() if params["antivirusNeeded"] else [] + fakeOffice() if params["collaborationServiceNeeded"] else [], @@ -1003,38 +1004,25 @@ def wopiValidatorTests(ctx, storage, wopiServerType, accounts_hash_difficulty = "/app/wopiserver.py", ], }, + { + "name": "wait-for-wopi-server", + "image": OC_CI_WAIT_FOR, + "commands": [ + "wait-for -it wopiserver:9300 -t 300", + ], + }, ] else: extra_server_environment = { "OCIS_EXCLUDE_RUN_SERVICES": "app-provider", } - wopiServer = [ - { - "name": "wopiserver", - "image": OC_CI_GOLANG, - "detach": True, - "environment": { - "MICRO_REGISTRY": "nats-js-kv", - "MICRO_REGISTRY_ADDRESS": "ocis-server:9233", - "COLLABORATION_LOG_LEVEL": "debug", - "COLLABORATION_HTTP_ADDR": "0.0.0.0:9300", - "COLLABORATION_GRPC_ADDR": "0.0.0.0:9301", - # no proof keys available in the FakeOffice - "COLLABORATION_APP_PROOF_DISABLE": "true", - "COLLABORATION_APP_NAME": "FakeOffice", - "COLLABORATION_APP_ADDR": "http://fakeoffice:8080", - "COLLABORATION_APP_INSECURE": "true", - "COLLABORATION_WOPI_SRC": "http://wopiserver:9300", - "COLLABORATION_WOPI_SECRET": "some-wopi-secret", - "COLLABORATION_CS3API_DATAGATEWAY_INSECURE": "true", - "OCIS_JWT_SECRET": "some-ocis-jwt-secret", - }, - "commands": [ - "%s collaboration server" % ocis_bin, - ], - }, - ] + extra_environment = { + "COLLABORATION_APP_NAME": "FakeOffice", + "COLLABORATION_APP_ADDR": "http://fakeoffice:8080", + } + + wopiServer = collaborationService(extra_environment) wopiTestCases = dirs["base"] + "/tests/config/drone/wopiValidatorCustomTestCases.xml" for testgroup in testgroups: @@ -1079,34 +1067,10 @@ def wopiValidatorTests(ctx, storage, wopiServerType, accounts_hash_difficulty = }, "steps": skipIfUnchanged(ctx, "acceptance-tests") + restoreBuildArtifactCache(ctx, "ocis-binary-amd64", "ocis/bin") + - [ - { - "name": "fakeoffice", - "image": OC_CI_ALPINE, - "detach": True, - "environment": {}, - "commands": [ - "sh %s/tests/config/drone/serve-hosting-discovery.sh" % (dirs["base"]), - ], - }, - { - "name": "wait-for-fakeoffice", - "image": OC_CI_WAIT_FOR, - "commands": [ - "wait-for -it fakeoffice:8080 -t 300", - ], - }, - ] + + fakeOffice() + ocisServer(storage, accounts_hash_difficulty, deploy_type = "wopi_validator", extra_server_environment = extra_server_environment) + wopiServer + [ - { - "name": "wait-for-wopi-server", - "image": OC_CI_WAIT_FOR, - "commands": [ - "wait-for -it wopiserver:9300 -t 300", - ], - }, { "name": "prepare-test-file", "image": OC_CI_ALPINE, diff --git a/tests/acceptance/config/behat.yml b/tests/acceptance/config/behat.yml index 7bcecc6b35..930e5861a5 100644 --- a/tests/acceptance/config/behat.yml +++ b/tests/acceptance/config/behat.yml @@ -400,6 +400,13 @@ default: - SharingNgContext: - GraphContext: + apiCollaboration: + paths: + - "%paths.base%/../features/apiCollaboration" + context: *common_ldap_suite_context + contexts: + - FeatureContext: *common_feature_context_params + cliCommands: paths: - "%paths.base%/../features/cliCommands" @@ -414,13 +421,6 @@ default: - TagContext: - TrashbinContext: - apiAppProvider: - paths: - - "%paths.base%/../features/apiAppProvider" - context: *common_ldap_suite_context - contexts: - - FeatureContext: *common_feature_context_params - extensions: rdx\behatvars\BehatVariablesExtension: ~ diff --git a/tests/acceptance/features/apiAppProvider/appProvider.feature b/tests/acceptance/features/apiCollaboration/wopi.feature similarity index 86% rename from tests/acceptance/features/apiAppProvider/appProvider.feature rename to tests/acceptance/features/apiCollaboration/wopi.feature index 859d9fb74d..4584b52594 100644 --- a/tests/acceptance/features/apiAppProvider/appProvider.feature +++ b/tests/acceptance/features/apiCollaboration/wopi.feature @@ -1,10 +1,10 @@ -Feature: App Provider +Feature: collaboration (wopi) As a user I want to access files with collaboration service apps So that I can collaborate with other users - Scenario Outline: open file with .odt extension with collaboration app + Scenario Outline: open file with .odt extension Given user "Alice" has been created with default attributes and without skeleton files And user "Alice" has uploaded file "filesForUpload/simple.odt" to "simple.odt" And we save it into "FILEID" @@ -22,7 +22,7 @@ Feature: App Provider "properties": { "app_url": { "type": "string", - "pattern": "^https:\\/\\/(.*?)\\?WOPISrc=http%3A%2F%2F(.*?)%3A9300%2Fwopi%2Ffiles%2F[a-fA-F0-9]{64}$" + "pattern": "^.*\\?WOPISrc=.*wopi%2Ffiles%2F[a-fA-F0-9]{64}$" }, "method": { "const": "POST" diff --git a/tests/config/drone/app-registry.yaml b/tests/config/drone/app-registry.yaml index 674829a89c..a1042ec45f 100644 --- a/tests/config/drone/app-registry.yaml +++ b/tests/config/drone/app-registry.yaml @@ -2,8 +2,8 @@ app_registry: mimetypes: - mime_type: application/vnd.oasis.opendocument.text extension: odt - name: FakeOffice - description: FakeOffice text document + name: OpenDocument + description: OpenDocument text document icon: "" default_app: FakeOffice allow_creation: true