Skip to content

Commit 696d509

Browse files
authored
Add matrix testing for multiple Fess/OpenSearch versions and dynamic Docker Compose selection (#19)
1 parent 5443094 commit 696d509

5 files changed

Lines changed: 96 additions & 6 deletions

File tree

.github/workflows/run-tests.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,15 @@ on:
99
- main
1010

1111
jobs:
12-
build:
12+
test:
1313
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
fess-version:
17+
- fess_version: "14.19.2"
18+
opensearch_version: "2.19.1"
19+
- fess_version: "15.1.0"
20+
opensearch_version: "3.1.0"
1421

1522
steps:
1623
- uses: actions/checkout@v4
@@ -23,5 +30,8 @@ jobs:
2330
run: pip install uv
2431
- name: Install dependencies
2532
run: uv sync --extra dev
26-
- name: Run tests
33+
- name: Run tests with Fess ${{ matrix.fess-version.fess_version }} & OpenSearch ${{ matrix.fess-version.opensearch_version }}
34+
env:
35+
FESS_VERSION: ${{ matrix.fess-version.fess_version }}
36+
OPENSEARCH_VERSION: ${{ matrix.fess-version.opensearch_version }}
2737
run: uv run pytest tests

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ venv/
135135
ENV/
136136
env.bak/
137137
venv.bak/
138+
.serena/
138139

139140
# Spyder project settings
140141
.spyderproject

tests/compose-fess14.yaml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
services:
2+
fessctl_fess01:
3+
image: ghcr.io/codelibs/fess:${FESS_VERSION:-14.19.2}
4+
container_name: fessctl_fess01
5+
environment:
6+
- "SEARCH_ENGINE_HTTP_URL=http://fessctl_search01:9200"
7+
- "FESS_DICTIONARY_PATH=${FESS_DICTIONARY_PATH:-/usr/share/opensearch/config/dictionary/}"
8+
# - "FESS_PLUGINS=fess-ds-csv:${FESS_VERSION:-14.19.2}"
9+
volumes:
10+
# - fessctl_fess01_plugin:/usr/share/fess/app/WEB-INF/plugin
11+
- ./resources/access_token.bulk:/usr/share/fess/app/WEB-INF/classes/fess_indices/fess_config.access_token/access_token.bulk
12+
ports:
13+
- "8080:8080"
14+
networks:
15+
- fessctl_search_net
16+
depends_on:
17+
- fessctl_search01
18+
logging:
19+
driver: "json-file"
20+
options:
21+
max-size: "10m"
22+
max-file: "5"
23+
restart: unless-stopped
24+
25+
fessctl_search01:
26+
image: ghcr.io/codelibs/fess-opensearch:${OPENSEARCH_VERSION:-2.19.1}
27+
container_name: fessctl_search01
28+
environment:
29+
- node.name=fessctl_search01
30+
- discovery.seed_hosts=fessctl_search01
31+
- cluster.initial_cluster_manager_nodes=fessctl_search01
32+
- cluster.name=fess-search
33+
- bootstrap.memory_lock=true
34+
- node.roles=cluster_manager,data,ingest,ml
35+
- "OPENSEARCH_JAVA_OPTS=-Xms1g -Xmx1g"
36+
- "DISABLE_INSTALL_DEMO_CONFIG=true"
37+
- "DISABLE_SECURITY_PLUGIN=true"
38+
- "FESS_DICTIONARY_PATH=/usr/share/opensearch/config/dictionary"
39+
ulimits:
40+
memlock:
41+
soft: -1
42+
hard: -1
43+
nofile:
44+
soft: 65535
45+
hard: 65535
46+
# volumes:
47+
# - fessctl_search01_data:/usr/share/opensearch/data
48+
# - fessctl_search01_dictionary:/usr/share/opensearch/config/dictionary
49+
ports:
50+
- 9200:9200
51+
networks:
52+
- fessctl_search_net
53+
logging:
54+
driver: "json-file"
55+
options:
56+
max-size: "10m"
57+
max-file: "5"
58+
restart: unless-stopped
59+
60+
#volumes:
61+
# fessctl_fess01_plugin:
62+
# driver: local
63+
# fessctl_search01_data:
64+
# driver: local
65+
# fessctl_search01_dictionary:
66+
# driver: local
67+
68+
networks:
69+
fessctl_search_net:
70+
driver: bridge
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
services:
22
fessctl_fess01:
3-
image: ghcr.io/codelibs/fess:14.19.2
3+
image: ghcr.io/codelibs/fess:${FESS_VERSION:-15.1.0}
44
container_name: fessctl_fess01
55
environment:
66
- "SEARCH_ENGINE_HTTP_URL=http://fessctl_search01:9200"
77
- "FESS_DICTIONARY_PATH=${FESS_DICTIONARY_PATH:-/usr/share/opensearch/config/dictionary/}"
8-
# - "FESS_PLUGINS=fess-ds-csv:14.19.2"
8+
# - "FESS_PLUGINS=fess-ds-csv:${FESS_VERSION:-15.1.0}"
99
volumes:
1010
# - fessctl_fess01_plugin:/usr/share/fess/app/WEB-INF/plugin
1111
- ./resources/access_token.bulk:/usr/share/fess/app/WEB-INF/classes/fess_indices/fess_config.access_token/access_token.bulk
@@ -23,7 +23,7 @@ services:
2323
restart: unless-stopped
2424

2525
fessctl_search01:
26-
image: ghcr.io/codelibs/fess-opensearch:2.19.1
26+
image: ghcr.io/codelibs/fess-opensearch:${OPENSEARCH_VERSION:-3.1.0}
2727
container_name: fessctl_search01
2828
environment:
2929
- node.name=fessctl_search01

tests/conftest.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,16 @@
1111
def fess_service():
1212
project_root = Path(__file__).resolve().parent
1313
print(f"Project root: {project_root}")
14-
compose = DockerCompose(str(project_root), "compose.yaml", pull=True)
14+
15+
# Determine which compose file to use based on FESS_VERSION
16+
fess_version = os.getenv("FESS_VERSION", "15.1.0")
17+
if fess_version.startswith("15."):
18+
compose_file = "compose-fess15.yaml"
19+
else:
20+
compose_file = "compose-fess14.yaml"
21+
22+
print(f"Using compose file: {compose_file} for Fess version: {fess_version}")
23+
compose = DockerCompose(str(project_root), compose_file, pull=True)
1524
compose.start()
1625

1726
host = compose.get_service_host("fessctl_fess01", 8080)

0 commit comments

Comments
 (0)