Skip to content
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

[tests-only][full-ci]Added documentation to run tika service related tests #7295

Merged
merged 3 commits into from
Sep 25, 2023
Merged
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
55 changes: 54 additions & 1 deletion docs/ocis/development/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,17 @@ make -C tests/acceptance/docker test-ocis-feature-ocis-storage

{{< /hint >}}

{{< hint info >}}
To run the tests that require tika service (tests tagged with `@tikaServiceNeeded`), you need to provide `START_TIKA=true` while running the tests.

```bash
START_TIKA=true \
BEHAT_FEATURE='tests/acceptance/features/apiSearch/contentSearch.feature' \
make -C tests/acceptance/docker test-ocis-feature-ocis-storage
```

{{< /hint >}}

{{< hint info >}}
To run the tests that require an antivirus service (tests tagged with `@antivirus`), you need to provide the following environment variables while running the tests.

Expand Down Expand Up @@ -376,6 +387,48 @@ BEHAT_FEATURE="tests/acceptance/features/apiNotification/emailNotification.featu
make test-acceptance-api
```

## Running Test Suite With Tika Service (@tikaServiceNeeded)
SagarGi marked this conversation as resolved.
Show resolved Hide resolved

Test suites that are tagged with `@tikaServiceNeeded` require tika service.

### Setup Tika Service

Run the following docker command to setup tika service

```bash
docker run -d -p 127.0.0.1:9998:9998 apache/tika
```

### Run oCIS

Documentation related to the content based search and tika extractor can be found [here](https://doc.owncloud.com/ocis/next/deployment/services/s-list/search.html#content-extraction)

```bash
# init oCIS
IDM_ADMIN_PASSWORD=admin \
ocis/bin/ocis init --insecure true

# run oCIS
PROXY_ENABLE_BASIC_AUTH=true \
OCIS_INSECURE=true \
SEARCH_EXTRACTOR_TYPE=tika \
SEARCH_EXTRACTOR_TIKA_TIKA_URL=http://localhost:9998 \
SEARCH_EXTRACTOR_CS3SOURCE_INSECURE=true \
SagarGi marked this conversation as resolved.
Show resolved Hide resolved
ocis/bin/ocis server
```

### Run the Acceptance Test

Run the acceptance test with the following command:

```bash
TEST_WITH_GRAPH_API=true \
TEST_OCIS=true \
SagarGi marked this conversation as resolved.
Show resolved Hide resolved
TEST_SERVER_URL="https://localhost:9200" \
BEHAT_FEATURE="tests/acceptance/features/apiSearch/contentSearch.feature" \
make test-acceptance-api
```

## Running Tests for Parallel Deployment

### Setup the Parallel Deployment Environment
Expand Down Expand Up @@ -450,7 +503,7 @@ The commands are ubuntu specific and may differ according to your system. You ca

##### Mac OS user
Install ClamAV using [here](https://gist.github.com/mendozao/3ea393b91f23a813650baab9964425b9)
Start ClamAV daemon
Start ClamAV daemon
```bash
/your/location/to/brew/Cellar/clamav/1.1.0/sbin/clamd
```
Expand Down
17 changes: 17 additions & 0 deletions tests/acceptance/docker/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,17 @@ OCIS_IMAGE_TAG ?= dev
WITH_WRAPPER ?= true
OCIS_WRAPPER := ../../ociswrapper/bin/ociswrapper

ifdef START_TIKA
ifeq ($(START_TIKA),true)
COMPOSE_FILE := $(COMPOSE_FILE):src/tika.yml
SEARCH_EXTRACTOR_TYPE := tika
else
SEARCH_EXTRACTOR_TYPE := basic
endif
else
SEARCH_EXTRACTOR_TYPE := basic
endif

# static
DIVIDE_INTO_NUM_PARTS := 10
PARTS = 1 2 3 4 5 6 7 8 9 10
Expand Down Expand Up @@ -190,6 +201,11 @@ testSuite: $(OCIS_WRAPPER) build-dev-image clean-docker-container
COMPOSE_PROJECT_NAME=$(COMPOSE_PROJECT_NAME) \
COMPOSE_FILE=src/antivirus.yml \
docker-compose run start_antivirus; \
fi; \
if [ "${START_TIKA}" == "true" ]; then \
COMPOSE_PROJECT_NAME=$(COMPOSE_PROJECT_NAME) \
COMPOSE_FILE=src/tika.yml \
docker-compose run tika-service; \
fi; \
COMPOSE_PROJECT_NAME=$(COMPOSE_PROJECT_NAME) \
COMPOSE_FILE=$(COMPOSE_FILE) \
Expand All @@ -199,6 +215,7 @@ testSuite: $(OCIS_WRAPPER) build-dev-image clean-docker-container
OCIS_ASYNC_UPLOADS=$(OCIS_ASYNC_UPLOADS) \
OCIS_ADD_RUN_SERVICES=$(OCIS_ADD_RUN_SERVICES) \
POSTPROCESSING_STEPS=$(POSTPROCESSING_STEPS) \
SEARCH_EXTRACTOR_TYPE=$(SEARCH_EXTRACTOR_TYPE) \
OCIS_IMAGE_TAG=$(OCIS_IMAGE_TAG) \
BEHAT_SUITE=$(BEHAT_SUITE) \
BEHAT_FEATURE=$(BEHAT_FEATURE) \
Expand Down
5 changes: 5 additions & 0 deletions tests/acceptance/docker/src/ocis-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ services:
# postprocessing step
POSTPROCESSING_STEPS: $POSTPROCESSING_STEPS

# tika
SEARCH_EXTRACTOR_TYPE: $SEARCH_EXTRACTOR_TYPE
SEARCH_EXTRACTOR_TIKA_TIKA_URL: "http://tika:9998"
SEARCH_EXTRACTOR_CS3SOURCE_INSECURE: "true"

# fonts map for txt thumbnails (including unicode support)
THUMBNAILS_TXT_FONTMAP_FILE: "/drone/src/tests/config/drone/fontsMap.json"
volumes:
Expand Down
8 changes: 8 additions & 0 deletions tests/acceptance/docker/src/tika.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
services:
tika-service:
image: dadarek/wait-for-dependencies
depends_on:
- tika
command: tika:9998
tika:
image: apache/tika:2.8.0.0