Skip to content

Commit 9e544da

Browse files
Installation tests v4 (#2339)
#### Reference Issues/PRs <!--Example: Fixes #1234. See also #3456.--> #### What does this implement or fix? Successful execution 5.2.6: https://github.com/man-group/ArcticDB/actions/runs/14641126753/job/41083591802 5.1.2: https://github.com/man-group/ArcticDB/actions/runs/14637571996 4.5.1: https://github.com/man-group/ArcticDB/actions/runs/14639124835/job/41077126258 1.6.2: https://github.com/man-group/ArcticDB/actions/runs/14701046721/job/41250511273 The PR contains workflow definition to execute tests on installed arcticdb it is combination of approaches: #2330 #2316 Installation tests are now in separate folder (python/installation_tests) not part of tests. They have their own fixtures, making them independent from rest of code base The tests are direct copy from originals with one modified to user ver 2 API. Otherwise now if there are changes in API each test in installation set can be addapted. As tests run very fast no need to use simulators, instead directly using S3 real storage The tests are executed by a workflow. Currently each test is executed against LMDB and real S3. The moto simulated version is not available in this moment due to tight coupling with protobufs which differ for ach version as well as tight coupling with whole existing test code. The workflow have 2 triggers: - manual trigger - allowing tests to be executed manually on demand - on schedule - the schedule execution is overnight. Each arcticdb version tests are executed within 1hr difference from the other. Thats is due to fact that executing all at once is likely to generate errors with real storages #### Any other comments? #### Checklist <details> <summary> Checklist for code changes... </summary> - [ ] Have you updated the relevant docstrings, documentation and copyright notice? - [ ] Is this contribution tested against [all ArcticDB's features](../docs/mkdocs/docs/technical/contributing.md)? - [ ] Do all exceptions introduced raise appropriate [error messages](https://docs.arcticdb.io/error_messages/)? - [ ] Are API changes highlighted in the PR description? - [ ] Is the PR labelled as enhancement or bug so it appears in autogenerated release notes? </details> <!-- Thanks for contributing a Pull Request to ArcticDB! Please ensure you have taken a look at: - ArcticDB's Code of Conduct: https://github.com/man-group/ArcticDB/blob/master/CODE_OF_CONDUCT.md - ArcticDB's Contribution Licensing: https://github.com/man-group/ArcticDB/blob/master/docs/mkdocs/docs/technical/contributing.md#contribution-licensing --> --------- Co-authored-by: Georgi Rusev <Georgi Rusev> Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent 2612fb4 commit 9e544da

17 files changed

+1066
-10
lines changed

.github/workflows/failure_notification.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Check for master failure
22
on:
33
workflow_run:
4-
workflows: ["Build and Test", "Build with conda", "Build with analysis tools", "Coverity Static Analysis"]
4+
workflows: ["Build and Test", "Build with conda", "Build with analysis tools", "Coverity Static Analysis", "Installation Tests Execution"]
55
types: [completed]
66
branches: [master]
77

Lines changed: 252 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,252 @@
1+
name: Installation Tests Execution
2+
permissions:
3+
contents: read
4+
5+
on:
6+
push:
7+
branches:
8+
- installation_tests_v4
9+
schedule:
10+
# Execution overnight for each version of the arcticdb happens on
11+
# dedicated hour for each version (see later step "When on schedule ...")
12+
- cron: "0 1 * * *"
13+
- cron: "0 2 * * *"
14+
- cron: "0 3 * * *"
15+
- cron: "0 4 * * *"
16+
- cron: "0 5 * * *"
17+
workflow_dispatch:
18+
inputs:
19+
os:
20+
description: 'Operating System to test'
21+
required: false
22+
default: 'ubuntu-22.04'
23+
type: choice
24+
options:
25+
- all
26+
- ubuntu-22.04
27+
- windows-latest
28+
- macos-latest
29+
python:
30+
description: 'Python Version to test'
31+
required: false
32+
default: '3.13'
33+
type: choice
34+
options:
35+
- "3.7"
36+
- "3.8"
37+
- "3.9"
38+
- "3.10"
39+
- "3.11"
40+
- "3.12"
41+
- "3.13"
42+
arcticdb_version:
43+
# NOTE that for all versions listed here there must be pip and conda
44+
# requirements files at python/tests/compat folder!
45+
description: 'ArcticDB version to test'
46+
required: true
47+
default: 'latest'
48+
type: choice
49+
options:
50+
- "latest"
51+
- "5.2.6"
52+
- "5.1.2"
53+
- "4.5.1"
54+
- "1.6.2"
55+
use_conda:
56+
description: 'Use conda (default PyPi will be used)'
57+
required: false
58+
default: 'no'
59+
type: choice
60+
options:
61+
- "no"
62+
- "yes"
63+
run_on_lmdb:
64+
description: 'Execute tests on LMDB'
65+
required: true
66+
default: '1'
67+
type: choice
68+
options:
69+
- "1"
70+
- "0"
71+
run_on_real_s3:
72+
description: 'Execute tests on Amazon S3'
73+
required: true
74+
default: '0'
75+
type: choice
76+
options:
77+
- "1"
78+
- "0"
79+
80+
81+
jobs:
82+
83+
installation_test:
84+
runs-on: ${{ inputs.os || matrix.os }}
85+
strategy:
86+
matrix:
87+
# This matrix strategy will run limited set of combinations
88+
# for each python version we support, matching it with combination of:
89+
# OS amd either pypi or conda
90+
# This way we cover all python versions, OS-es and installation repos
91+
# in just 8 combinations
92+
include:
93+
- os: ubuntu-22.04
94+
python: "3.7"
95+
use_conda: "no"
96+
- os: windows-latest
97+
python: "3.8"
98+
use_conda: "no"
99+
- os: macos-latest
100+
python: "3.9"
101+
use_conda: "yes"
102+
- os: windows-latest
103+
python: "3.10"
104+
use_conda: "no"
105+
- os: macos-latest
106+
python: "3.11"
107+
use_conda: "yes"
108+
- os: ubuntu-22.04
109+
python: "3.12"
110+
use_conda: "yes"
111+
- os: ubuntu-22.04
112+
use_conda: "no"
113+
python: "3.13"
114+
fail-fast: false
115+
env:
116+
install_tests_folder: "python/tests/compat"
117+
conda_file: "environment_unix.yml"
118+
arcticdb_version: ${{ inputs.arcticdb_version || '1.6.2' }}
119+
lmdb: ${{ inputs.run_on_lmdb || '1' }}
120+
real_s3: ${{ inputs.run_on_real_s3 || '0' }}
121+
122+
steps:
123+
124+
- name: Check Unsupported Versions
125+
shell: bash
126+
run: |
127+
echo "Check for not supported arcticdb-python versions"
128+
129+
UNSUPPORTED_COMBINATIONS=(
130+
"3.13-5.1.2"
131+
"3.13-5.0.0"
132+
"3.13-4.5.1"
133+
"3.13-1.6.2"
134+
)
135+
136+
CURRENT_COMBINATION="${{ matrix.python || inputs.python}}-${{ env.arcticdb_version }}"
137+
echo "Check for combination $CURRENT_COMBINATION"
138+
if [[ " ${UNSUPPORTED_COMBINATIONS[*]} " == *"$CURRENT_COMBINATION"* ]]; then
139+
echo "Skipping unsupported combination: $CURRENT_COMBINATION"
140+
echo "SKIP_JOB=true" >> $GITHUB_ENV
141+
fi
142+
143+
- name: When On Schedule - Override the arcticdb version based on hour of execution
144+
# Only when executed on schedule this step will be triggered
145+
# Based on the hour of execution a specific version will be assigned
146+
# Only this version will be executed at that hour
147+
# Make sure this step is synchronized with the job schedule
148+
if: github.event_name == 'schedule'
149+
run: |
150+
hour=$(date -u +"%H")
151+
case $hour in
152+
"01") echo "arcticdb_version='1.6.2'" >> $GITHUB_ENV;;
153+
"02") echo "arcticdb_version='4.5.1'" >> $GITHUB_ENV;;
154+
"03") echo "arcticdb_version='5.1.2'" >> $GITHUB_ENV;;
155+
"04") echo "arcticdb_version='5.2.6'" >> $GITHUB_ENV;;
156+
"05") echo "arcticdb_version='latest'" >> $GITHUB_ENV;;
157+
esac
158+
159+
- name: Checkout code
160+
if: ${{ env.SKIP_JOB != 'true' }}
161+
uses: actions/checkout@v3
162+
163+
- name: Set up Python
164+
if: ${{ env.SKIP_JOB != 'true' }}
165+
uses: actions/setup-python@v4
166+
with:
167+
python-version: ${{ inputs.python || matrix.python}}
168+
169+
- name: Set environment variables
170+
if: ${{ env.SKIP_JOB != 'true' }}
171+
shell: bash -l {0}
172+
run: |
173+
echo "ARCTICDB_LOCAL_STORAGE_TESTS_ENABLED=0" >> $GITHUB_ENV
174+
echo "ARCTICDB_STORAGE_LMDB=${{ env.lmdb }}" >> $GITHUB_ENV
175+
echo "USE_CONDA=${{ inputs.use_conda || matrix.use_conda }}" >> $GITHUB_ENV
176+
177+
- name: (pypi) Install arcticdb from requirements files
178+
if: ${{ (env.SKIP_JOB != 'true') && (!contains(env.USE_CONDA, 'yes'))}}
179+
run: |
180+
pip install -r "${{ env.install_tests_folder }}/requirements-${{ env.arcticdb_version }}.txt"
181+
182+
- name: (pypi) Install other prerequisites
183+
if: ${{ (env.SKIP_JOB != 'true') && (!contains(env.USE_CONDA, 'yes'))}}
184+
shell: bash -l {0}
185+
run: |
186+
python -m pip install --upgrade pip
187+
188+
pip install wheel
189+
pip install setuptools
190+
pip install pytest
191+
pip install pytest-xdist
192+
193+
# Install conda environment
194+
- name: (conda) Install arcticdb from conda-forge
195+
uses: mamba-org/[email protected]
196+
if: ${{ (env.SKIP_JOB != 'true') && (contains(env.USE_CONDA, 'yes'))}}
197+
with:
198+
environment-file: "${{ env.install_tests_folder }}/requirements-${{ env.arcticdb_version }}.yml"
199+
environment-name: arcticdb
200+
init-shell: >-
201+
bash
202+
cache-environment: true
203+
post-cleanup: 'all'
204+
205+
- name: (conda) Install other dependencies ${{ env.conda_file }}
206+
if: ${{ (env.SKIP_JOB != 'true') && (contains(env.USE_CONDA, 'yes'))}}
207+
shell: bash -l {0}
208+
run: |
209+
micromamba activate arcticdb
210+
micromamba install --no-pin --file "${{ env.install_tests_folder }}/${{ env.conda_file }}"
211+
212+
- name: Set persistent storage variables
213+
if: ${{ env.SKIP_JOB != 'true' }}
214+
uses: ./.github/actions/set_persistent_storage_env_vars
215+
with:
216+
aws_access_key: "${{ secrets.AWS_S3_ACCESS_KEY }}"
217+
aws_secret_key: "${{ secrets.AWS_S3_SECRET_KEY }}"
218+
gcp_access_key: "${{ secrets.GCP_S3_ACCESS_KEY }}"
219+
gcp_secret_key: "${{ secrets.GCP_S3_SECRET_KEY }}"
220+
persistent_storage: "true"
221+
222+
- name: Set environment variables
223+
if: ${{ env.SKIP_JOB != 'true' }}
224+
shell: bash -l {0}
225+
run: |
226+
echo "ARCTICDB_LOCAL_STORAGE_TESTS_ENABLED=0" >> $GITHUB_ENV
227+
echo "ARCTICDB_STORAGE_LMDB=${{ env.lmdb }}" >> $GITHUB_ENV
228+
echo "ARCTICDB_STORAGE_AWS_S3=${{ env.real_s3 }}" >> $GITHUB_ENV
229+
echo "ARCTICDB_STORAGE_GCP=0" >> $GITHUB_ENV
230+
echo "ARCTICDB_PERSISTENT_STORAGE_TESTS=1" >> $GITHUB_ENV
231+
232+
- name: Run tests
233+
if: ${{ env.SKIP_JOB != 'true' }}
234+
shell: bash -l {0}
235+
run: |
236+
echo $pwd
237+
echo "Running tests against arcticdb version: ${{ env.arcticdb_version }}"
238+
pytest -v --log-file="tests.log" -n auto python/installation_tests/test_installation.py
239+
240+
## For testing
241+
#pytest -v --log-file="tests.log" python/tests/integration/arcticdb/test_arctic.py::test_append_prune_previous_versions
242+
243+
- name: Upload the logs
244+
if: ${{ env.SKIP_JOB != 'true' }}
245+
uses: actions/upload-artifact@v4
246+
with:
247+
name: logs-${{ matrix.os || inputs.os }}-${{ matrix.python || inputs.python}}
248+
path: |
249+
./*test*
250+
251+
252+

0 commit comments

Comments
 (0)