15
15
timeout-minutes : 20
16
16
17
17
services :
18
-
19
18
elasticsearch_8_svc :
20
19
image : docker.elastic.co/elasticsearch/elasticsearch:8.11.0
21
20
env :
@@ -63,22 +62,31 @@ jobs:
63
62
OPENSEARCH_JAVA_OPTS : -Xms512m -Xmx512m
64
63
ports :
65
64
- 9202:9202
65
+
66
66
strategy :
67
67
matrix :
68
68
python-version : [ "3.8", "3.9", "3.10", "3.11", "3.12"]
69
+ backend : [ "elasticsearch7", "elasticsearch8", "opensearch"]
69
70
70
- name : Python ${{ matrix.python-version }} testing
71
+ name : Python ${{ matrix.python-version }} testing with ${{ matrix.backend }}
71
72
72
73
steps :
73
74
- name : Check out repository code
74
75
uses : actions/checkout@v4
75
76
76
- # Setup Python (faster than using Python container)
77
77
- name : Setup Python
78
78
uses : actions/setup-python@v5
79
79
with :
80
80
python-version : ${{ matrix.python-version }}
81
81
82
+ - name : Cache pipenv packages
83
+ uses : actions/cache@v3
84
+ with :
85
+ path : ~/.cache/pip
86
+ key : ${{ runner.os }}-pip-${{ hashFiles('**/Pipfile.lock') }}
87
+ restore-keys : |
88
+ ${{ runner.os }}-pip-
89
+
82
90
- name : Lint code
83
91
if : ${{ matrix.python-version == 3.11 }}
84
92
run : |
@@ -101,35 +109,17 @@ jobs:
101
109
run : |
102
110
pip install ./stac_fastapi/opensearch[dev,server]
103
111
104
- - name : Run test suite against Elasticsearch 7.x
105
- run : |
106
- pipenv run pytest -svvv
107
- env :
108
- ENVIRONMENT : testing
109
- ES_PORT : 9400
110
- ES_HOST : 172.17.0.1
111
- ES_USE_SSL : false
112
- ES_VERIFY_CERTS : false
113
- BACKEND : elasticsearch
114
-
115
- - name : Run test suite against Elasticsearch 8.x
112
+ - name : Install pytest-timeout
116
113
run : |
117
- pipenv run pytest -svvv
118
- env :
119
- ENVIRONMENT : testing
120
- ES_PORT : 9200
121
- ES_HOST : 172.17.0.1
122
- ES_USE_SSL : false
123
- ES_VERIFY_CERTS : false
124
- BACKEND : elasticsearch
114
+ pip install pytest-timeout
125
115
126
- - name : Run test suite against OpenSearch 2.11.1
116
+ - name : Run test suite
127
117
run : |
128
- pipenv run pytest -svvv
118
+ pipenv run pytest -svvv --timeout=300
129
119
env :
130
120
ENVIRONMENT : testing
131
- ES_PORT : 9202
121
+ ES_PORT : ${{ matrix.backend == 'elasticsearch7' && '9400' || matrix.backend == 'elasticsearch8' && '9200' || ' 9202' }}
132
122
ES_HOST : 172.17.0.1
133
123
ES_USE_SSL : false
134
124
ES_VERIFY_CERTS : false
135
- BACKEND : opensearch
125
+ BACKEND : ${{ matrix.backend == 'elasticsearch7' && 'elasticsearch' || matrix.backend == 'elasticsearch8' && 'elasticsearch' || ' opensearch' }}
0 commit comments