Skip to content
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
14 changes: 12 additions & 2 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,15 @@ on:
- main

jobs:
build:
test:
runs-on: ubuntu-latest
strategy:
matrix:
fess-version:
- fess_version: "14.19.2"
opensearch_version: "2.19.1"
- fess_version: "15.1.0"
opensearch_version: "3.1.0"

steps:
- uses: actions/checkout@v4
Expand All @@ -23,5 +30,8 @@ jobs:
run: pip install uv
- name: Install dependencies
run: uv sync --extra dev
- name: Run tests
- name: Run tests with Fess ${{ matrix.fess-version.fess_version }} & OpenSearch ${{ matrix.fess-version.opensearch_version }}
env:
FESS_VERSION: ${{ matrix.fess-version.fess_version }}
OPENSEARCH_VERSION: ${{ matrix.fess-version.opensearch_version }}
run: uv run pytest tests
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ venv/
ENV/
env.bak/
venv.bak/
.serena/

# Spyder project settings
.spyderproject
Expand Down
70 changes: 70 additions & 0 deletions tests/compose-fess14.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
services:
fessctl_fess01:
image: ghcr.io/codelibs/fess:${FESS_VERSION:-14.19.2}
container_name: fessctl_fess01
environment:
- "SEARCH_ENGINE_HTTP_URL=http://fessctl_search01:9200"
- "FESS_DICTIONARY_PATH=${FESS_DICTIONARY_PATH:-/usr/share/opensearch/config/dictionary/}"
# - "FESS_PLUGINS=fess-ds-csv:${FESS_VERSION:-14.19.2}"
volumes:
# - fessctl_fess01_plugin:/usr/share/fess/app/WEB-INF/plugin
- ./resources/access_token.bulk:/usr/share/fess/app/WEB-INF/classes/fess_indices/fess_config.access_token/access_token.bulk
ports:
- "8080:8080"
networks:
- fessctl_search_net
depends_on:
- fessctl_search01
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "5"
restart: unless-stopped

fessctl_search01:
image: ghcr.io/codelibs/fess-opensearch:${OPENSEARCH_VERSION:-2.19.1}
container_name: fessctl_search01
environment:
- node.name=fessctl_search01
- discovery.seed_hosts=fessctl_search01
- cluster.initial_cluster_manager_nodes=fessctl_search01
- cluster.name=fess-search
- bootstrap.memory_lock=true
- node.roles=cluster_manager,data,ingest,ml
- "OPENSEARCH_JAVA_OPTS=-Xms1g -Xmx1g"
- "DISABLE_INSTALL_DEMO_CONFIG=true"
- "DISABLE_SECURITY_PLUGIN=true"
- "FESS_DICTIONARY_PATH=/usr/share/opensearch/config/dictionary"
ulimits:
memlock:
soft: -1
hard: -1
nofile:
soft: 65535
hard: 65535
# volumes:
# - fessctl_search01_data:/usr/share/opensearch/data
# - fessctl_search01_dictionary:/usr/share/opensearch/config/dictionary
ports:
- 9200:9200
networks:
- fessctl_search_net
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "5"
restart: unless-stopped

#volumes:
# fessctl_fess01_plugin:
# driver: local
# fessctl_search01_data:
# driver: local
# fessctl_search01_dictionary:
# driver: local

networks:
fessctl_search_net:
driver: bridge
6 changes: 3 additions & 3 deletions tests/compose.yaml → tests/compose-fess15.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
services:
fessctl_fess01:
image: ghcr.io/codelibs/fess:14.19.2
image: ghcr.io/codelibs/fess:${FESS_VERSION:-15.1.0}
container_name: fessctl_fess01
environment:
- "SEARCH_ENGINE_HTTP_URL=http://fessctl_search01:9200"
- "FESS_DICTIONARY_PATH=${FESS_DICTIONARY_PATH:-/usr/share/opensearch/config/dictionary/}"
# - "FESS_PLUGINS=fess-ds-csv:14.19.2"
# - "FESS_PLUGINS=fess-ds-csv:${FESS_VERSION:-15.1.0}"
volumes:
# - fessctl_fess01_plugin:/usr/share/fess/app/WEB-INF/plugin
- ./resources/access_token.bulk:/usr/share/fess/app/WEB-INF/classes/fess_indices/fess_config.access_token/access_token.bulk
Expand All @@ -23,7 +23,7 @@ services:
restart: unless-stopped

fessctl_search01:
image: ghcr.io/codelibs/fess-opensearch:2.19.1
image: ghcr.io/codelibs/fess-opensearch:${OPENSEARCH_VERSION:-3.1.0}
container_name: fessctl_search01
environment:
- node.name=fessctl_search01
Expand Down
11 changes: 10 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,16 @@
def fess_service():
project_root = Path(__file__).resolve().parent
print(f"Project root: {project_root}")
compose = DockerCompose(str(project_root), "compose.yaml", pull=True)

# Determine which compose file to use based on FESS_VERSION
fess_version = os.getenv("FESS_VERSION", "15.1.0")
if fess_version.startswith("15."):
compose_file = "compose-fess15.yaml"
else:
compose_file = "compose-fess14.yaml"

print(f"Using compose file: {compose_file} for Fess version: {fess_version}")
compose = DockerCompose(str(project_root), compose_file, pull=True)
compose.start()

host = compose.get_service_host("fessctl_fess01", 8080)
Expand Down