Skip to content

Commit

Permalink
[tests-only][full-ci]Added documentation to run tika service related …
Browse files Browse the repository at this point in the history
…tests (#7295)

* Added documentation to run tika service related tests

* Added documentation for docker compose as well

* Make tika service run only for tika
  • Loading branch information
SagarGi authored Sep 25, 2023
1 parent ad7c180 commit b930e0f
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 1 deletion.
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)

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 \
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 \
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

0 comments on commit b930e0f

Please sign in to comment.