From 89d92d7b1dc37f56ccc64ed51d7db2ec574075e6 Mon Sep 17 00:00:00 2001 From: Sawjan Gurung Date: Fri, 19 May 2023 18:03:55 +0545 Subject: [PATCH] [docs-only] Add email service to the docker-compose setup for tests (#6347) * add email docker compose for running tests * update docs to run email tests in docker compose setup * fix typo --- docs/ocis/development/testing.md | 11 +++++++++++ tests/acceptance/docker/Makefile | 5 +++++ tests/acceptance/docker/src/acceptance.yml | 3 +++ tests/acceptance/docker/src/email.yml | 8 ++++++++ tests/acceptance/docker/src/ocis-base.yml | 4 ++++ 5 files changed, 31 insertions(+) create mode 100644 tests/acceptance/docker/src/email.yml diff --git a/docs/ocis/development/testing.md b/docs/ocis/development/testing.md index 036a406442..ee4063d247 100644 --- a/docs/ocis/development/testing.md +++ b/docs/ocis/development/testing.md @@ -69,6 +69,17 @@ make -C tests/acceptance/docker test-ocis-feature-ocis-storage But some test suites that are tagged with `@env-config` require the oCIS server to be run with ociswrapper. So, running those tests require `WITH_WRAPPER=true` (default setting). {{< /hint >}} +{{< hint info >}} +To run the tests that require an email server (tests tagged with `@email`), you need to provide `START_EMAIL=true` while running the tests. + +```bash +START_EMAIL=true \ +BEHAT_FEATURE='tests/acceptance/features/apiEmailNotification/emailNotification.feature' \ +make -C tests/acceptance/docker test-ocis-feature-ocis-storage +``` + +{{< /hint >}} + #### Tests Transferred From ownCloud Core (prefix `coreApi`) Command `make -C tests/acceptance/docker Core-API-Tests-ocis-storage-3` runs the same tests as the `Core-API-Tests-ocis-storage-3` CI pipeline, which runs the third (out of ten) test suite groups transferred from ownCloud core against the oCIS server with ocis storage. diff --git a/tests/acceptance/docker/Makefile b/tests/acceptance/docker/Makefile index 35fd108ea5..eddf0f2314 100644 --- a/tests/acceptance/docker/Makefile +++ b/tests/acceptance/docker/Makefile @@ -181,6 +181,11 @@ testSuite: $(OCIS_WRAPPER) build-dev-image clean-docker-container COMPOSE_FILE=src/ceph.yml \ docker-compose run start_ceph; \ fi; \ + if [ "${START_EMAIL}" == "true" ]; then \ + COMPOSE_PROJECT_NAME=$(COMPOSE_PROJECT_NAME) \ + COMPOSE_FILE=src/email.yml \ + docker-compose run start_email; \ + fi; \ COMPOSE_PROJECT_NAME=$(COMPOSE_PROJECT_NAME) \ COMPOSE_FILE=$(COMPOSE_FILE) \ STORAGE_DRIVER=$(STORAGE_DRIVER) \ diff --git a/tests/acceptance/docker/src/acceptance.yml b/tests/acceptance/docker/src/acceptance.yml index fc6f8db5fb..2f1cb18cea 100644 --- a/tests/acceptance/docker/src/acceptance.yml +++ b/tests/acceptance/docker/src/acceptance.yml @@ -16,6 +16,9 @@ services: BEHAT_FEATURE: ${BEHAT_FEATURE:-} DIVIDE_INTO_NUM_PARTS: $DIVIDE_INTO_NUM_PARTS RUN_PART: $RUN_PART + # email + EMAIL_HOST: email + EMAIL_PORT: 9000 env_file: - ../../../../.drone.env volumes: diff --git a/tests/acceptance/docker/src/email.yml b/tests/acceptance/docker/src/email.yml new file mode 100644 index 0000000000..330af38bd1 --- /dev/null +++ b/tests/acceptance/docker/src/email.yml @@ -0,0 +1,8 @@ +services: + start_email: + image: dadarek/wait-for-dependencies + depends_on: + - email + command: email:9000 + email: + image: inbucket/inbucket diff --git a/tests/acceptance/docker/src/ocis-base.yml b/tests/acceptance/docker/src/ocis-base.yml index ed6a5b2e3c..d6716720df 100644 --- a/tests/acceptance/docker/src/ocis-base.yml +++ b/tests/acceptance/docker/src/ocis-base.yml @@ -28,6 +28,10 @@ services: STORAGE_USERS_S3NG_ACCESS_KEY: test STORAGE_USERS_S3NG_SECRET_KEY: test STORAGE_USERS_S3NG_BUCKET: test + # email + NOTIFICATIONS_SMTP_HOST: email + NOTIFICATIONS_SMTP_PORT: 2500 + NOTIFICATIONS_SMTP_INSECURE: "true" volumes: - ../../../config:/drone/src/tests/config - ../../../ociswrapper/bin/ociswrapper:/usr/bin/ociswrapper