diff --git a/.github/workflows/acceptance-tests.yml b/.github/workflows/acceptance-tests.yml index a73f91d94e1..0b0e10d8a5c 100644 --- a/.github/workflows/acceptance-tests.yml +++ b/.github/workflows/acceptance-tests.yml @@ -132,7 +132,7 @@ jobs: # antivirus (needs ClamAV) - apiAntivirus # federation (needs email + federation ocis) - # - apiOcm + - apiOcm # collaboration (needs WOPI) - apiCollaboration steps: @@ -450,7 +450,7 @@ jobs: run: python3 tests/acceptance/run-wopi.py --type cs3 all-acceptance-tests: - needs: [local-api-tests, cli-tests, wopi-cs3] # [local-api-tests, cli-tests, core-api-tests, litmus, cs3api, wopi-builtin, wopi-cs3, e2e-tests] + needs: [local-api-tests, cli-tests, core-api-tests, litmus, cs3api, wopi-builtin, wopi-cs3, e2e-tests] runs-on: ubuntu-latest if: always() steps: diff --git a/docs/ocis/development/testing.md b/docs/ocis/development/testing.md index dfaad89ec16..2e1523bb43a 100644 --- a/docs/ocis/development/testing.md +++ b/docs/ocis/development/testing.md @@ -549,7 +549,7 @@ From the `Run and Debug` panel of VSCode, select `Fed oCIS Server` and start the source tests/config/local/.env-federation && ocis/bin/ocis init # run oCIS -ocis/bin/ocis server +source tests/config/local/.env-federation && ocis/bin/ocis server ``` The second oCIS instance should be available at: @@ -567,7 +567,7 @@ Run the acceptance test with the following command: ```bash TEST_SERVER_URL="https://localhost:9200" \ TEST_SERVER_FED_URL="https://localhost:10200" \ -BEHAT_FEATURE="tests/acceptance/features/apiOcm/ocm.feature" \ +BEHAT_SUITE=apiOcm \ make test-acceptance-api ``` diff --git a/tests/acceptance/run-github.py b/tests/acceptance/run-github.py index 4b6b96b9e88..a4b43304c0a 100755 --- a/tests/acceptance/run-github.py +++ b/tests/acceptance/run-github.py @@ -119,6 +119,7 @@ "NOTIFICATIONS_SMTP_PORT": EMAIL_SMTP_PORT, "NOTIFICATIONS_SMTP_INSECURE": "true", "NOTIFICATIONS_SMTP_SENDER": EMAIL_SMTP_SENDER, + "NOTIFICATIONS_DEBUG_ADDR": "0.0.0.0:9174", }, }, "authApp": { @@ -211,6 +212,7 @@ def base_server_env(repo_root: Path, ocis_url: str, ocis_config_dir: str) -> dic "OCIS_EVENTS_ENABLE_TLS": "false", "NATS_NATS_HOST": "0.0.0.0", "NATS_NATS_PORT": "9233", + "MICRO_REGISTRY_ADDRESS": "127.0.0.1:9233", "OCIS_JWT_SECRET": "some-ocis-jwt-secret", "EVENTHISTORY_STORE": "memory", "OCIS_TRANSLATION_PATH": str(repo_root / "tests/config/translations"), @@ -325,6 +327,20 @@ def clamav_healthy() -> bool: +def load_env_file(path: Path) -> dict: + """Parse a bash-style env file (export KEY=value) into a dict.""" + env = {} + for line in path.read_text().splitlines(): + line = line.strip() + if not line or line.startswith("#") or line.startswith("!"): + continue + line = line.removeprefix("export ").strip() + if "=" in line: + k, v = line.split("=", 1) + env[k.strip()] = v.strip() + return env + + def run(cmd: list, env: dict = None, check: bool = True): e = {**os.environ, **(env or {})} return subprocess.run(cmd, env=e, check=check) @@ -460,14 +476,15 @@ def main() -> int: fed_env = {**os.environ} fed_env.update(base_server_env(repo_root, ocis_fed_url, str(fed_config_dir))) fed_env.update(cfg["extraServerEnvironment"]) + # load federation port mappings from canonical env file (single source of truth) + fed_env.update(load_env_file(repo_root / "tests/config/local/.env-federation")) + # CI-specific overrides fed_env.update({ "OCIS_URL": ocis_fed_url, - "PROXY_HTTP_ADDR": "0.0.0.0:10200", "OCIS_BASE_DATA_PATH": str(fed_data_dir), - # use different ports to avoid conflicts with primary - "GATEWAY_GRPC_ADDR": "0.0.0.0:10142", - "NATS_NATS_PORT": "10233", - "NATS_NATS_HOST": "0.0.0.0", + "OCIS_CONFIG_DIR": str(fed_config_dir), + "OCIS_RUNTIME_PORT": "10250", + "MICRO_REGISTRY_ADDRESS": "127.0.0.1:10233", }) # init federation ocis with separate config diff --git a/tests/config/local/.env-federation b/tests/config/local/.env-federation index 1f35ad0322c..fa6596e84df 100644 --- a/tests/config/local/.env-federation +++ b/tests/config/local/.env-federation @@ -89,14 +89,17 @@ export WEB_DEBUG_ADDR=localhost:10104 export WEB_HTTP_ADDR=localhost:10100 export WEBDAV_DEBUG_ADDR=127.0.0.1:10119 export WEBDAV_HTTP_ADDR=127.0.0.1:10115 +export NOTIFICATIONS_DEBUG_ADDR=127.0.0.1:10174 export WEBFINGER_DEBUG_ADDR=127.0.0.1:10279 export WEBFINGER_HTTP_ADDR=127.0.0.1:10275 -export OCIS_SERVICE_ACCOUNT_ID=serviceaccount -export OCIS_SERVICE_ACCOUNT_SECRET=serviceaccountsecret +export OCIS_SERVICE_ACCOUNT_ID=service-account-id +export OCIS_SERVICE_ACCOUNT_SECRET=service-account-secret export OCIS_DECOMPOSEDFS_PROPAGATOR=async export STORAGE_USERS_ASYNC_PROPAGATOR_PROPAGATION_DELAY=10s export TLS_INSECURE=true export OCIS_INSECURE=true +export LDAP_GROUP_SUBSCRIPTION_FILTER_TYPE=any +export LDAP_USER_SUBSCRIPTION_FILTER_TYPE=any export IDP_ACCESS_TOKEN_EXPIRATION=9000 export GATEWAY_STORAGE_USERS_MOUNT_ID=storage-users-1 export STORAGE_USERS_MOUNT_ID=storage-users-1 @@ -106,6 +109,13 @@ export OCIS_LOG_LEVEL=info export OCIS_LOG_PRETTY=true export OCIS_LOG_COLOR=true export PROXY_ENABLE_BASIC_AUTH=true +export FRONTEND_SEARCH_MIN_LENGTH=2 +export FRONTEND_CONFIGURABLE_NOTIFICATIONS=true +export GRAPH_AVAILABLE_ROLES=b1e2218d-eef8-4d4c-b82d-0f1a1b48f3b5,a8d5fe5e-96e3-418d-825b-534dbdf22b99,fb6c3e19-e378-47e5-b277-9732f9de6e21,58c63c02-1d89-4572-916a-870abc5a1b7d,2d00ce52-1fc2-4dbc-8b95-a73b73395f5a,1c996275-f1c9-4e71-abdf-a42f6495e960,312c0871-5ef7-4b3a-85b6-0e4074c64049,aa97fe03-7980-45ac-9e50-b325749fd7e6,63e64e19-8d43-42ec-a738-2b6af2610efa +export COLLABORATION_WOPIAPP_SECRET=some-wopi-secret +export SEARCH_EXTRACTOR_TYPE=tika +export SEARCH_EXTRACTOR_TIKA_TIKA_URL=http://localhost:9998 +export SEARCH_EXTRACTOR_CS3SOURCE_INSECURE=true export IDM_CREATE_DEMO_USERS=true export OCIS_ADMIN_USER_ID=some-admin-user-id-0000-000000000000 export IDM_ADMIN_PASSWORD=admin @@ -122,4 +132,4 @@ export USERS_LDAP_BIND_PASSWORD=some-ldap-reva-password export AUTH_BASIC_LDAP_BIND_PASSWORD=some-ldap-reva-password export IDM_IDPSVC_PASSWORD=some-ldap-idp-password export IDP_LDAP_BIND_PASSWORD=some-ldap-idp-password -export GRAPH_APPLICATION_ID=application-1export +export GRAPH_APPLICATION_ID=application-1