Skip to content

Commit 0876bf2

Browse files
authored
Customizable Run conda tests workflow (#2386)
#### Reference Issues/PRs <!--Example: Fixes #1234. See also #3456.--> #### What does this implement or fix? Idea is same as with #2379 The actual PR is also for "test_diff_long_stream_descriptor_mismatch" test on MacOS which used to be flaky. No more such evidences. But to prove that we need also MacOS builds that allow tests for flakyness The new workflow gives option to run or not cpp tests as well as to pass aditional arguments to pytest or completely rewrite pytest command to be able to achieve repetitions to test for flakyness. Example: ``` pytest -n auto -v --count=100 -x python/tests/integration/arcticdb/test_storage_lock.py ``` ---------------------------- Test on MacOS Test: python/tests/integration/arcticdb/version_store/test_basic_version_store.py::test_diff_long_stream_descriptor_mismatch Command: pytest -n 10 -v --count=1000 -x python/tests/integration/arcticdb/version_store/test_basic_version_store.py::test_diff_long_stream_descriptor_mismatch Log: https://github.com/man-group/ArcticDB/actions/runs/15462578452 Analysis: the test executed ok on mac_os without any errors More advanced test: Command: pytest -n auto -v --count=2000 -x python/tests/integration/arcticdb/version_store/test_basic_version_store.py::test_diff_long_stream_descriptor_mismatch Log: https://github.com/man-group/ArcticDB/actions/runs/15530261173/job/43717520944 #### 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>
1 parent 6dd7f84 commit 0876bf2

File tree

2 files changed

+36
-5
lines changed

2 files changed

+36
-5
lines changed

.github/workflows/build_with_conda.yml

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,16 @@ on:
1717
type: boolean
1818
required: false
1919
default: false
20+
run_cpp_tests:
21+
description: 'Run C++ tests'
22+
type: boolean
23+
required: true
24+
default: true
25+
run_custom_pytest_command:
26+
description: 'Run custom pytest command (curdir is project root). Or pass additional arguments to default command'
27+
type: string
28+
required: false
29+
default: ""
2030

2131
jobs:
2232

@@ -59,13 +69,15 @@ jobs:
5969
ARCTICDB_BUILD_CPP_TESTS: 1
6070

6171
- name: Build C++ Tests
72+
if: ${{ inputs.run_cpp_tests == true || github.event_name != 'workflow_dispatch' }}
6273
shell: bash -l {0}
6374
run: |
6475
cd cpp/out/linux-conda-release-build/
6576
make -j ${{ steps.cpu-cores.outputs.count }} arcticdb_rapidcheck_tests
6677
make -j ${{ steps.cpu-cores.outputs.count }} test_unit_arcticdb
6778
6879
- name: Run C++ Tests
80+
if: ${{ inputs.run_cpp_tests == true || github.event_name != 'workflow_dispatch' }}
6981
shell: bash -l {0}
7082
run: |
7183
cd cpp/out/linux-conda-release-build/
@@ -95,13 +107,23 @@ jobs:
95107
- name: Test with pytest
96108
shell: bash -l {0}
97109
run: |
98-
cd python
99110
export ARCTICDB_RAND_SEED=$RANDOM
100-
python -m pytest --timeout=3600 -n ${{ steps.cpu-cores.outputs.count }} -v tests
111+
if [[ "$(echo "$ARCTICDB_PYTEST_ARGS" | xargs)" == *pytest* ]]; then
112+
command="python -m $ARCTICDB_PYTEST_ARGS"
113+
python -m pip install pytest-repeat
114+
python -m pip install setuptools
115+
python -m pip install wheel
116+
echo "Run custom pytest command: $command"
117+
eval "$command"
118+
else
119+
cd python
120+
python -m pytest --timeout=3600 -n ${{ steps.cpu-cores.outputs.count }} -v tests $ARCTICDB_PYTEST_ARGS
121+
fi
101122
env:
102123
ARCTICDB_USING_CONDA: 1
103124
# Use the Mongo created in the service container above to test against
104125
CI_MONGO_HOST: mongodb
126+
ARCTICDB_PYTEST_ARGS: ${{ inputs.run_custom_pytest_command }}
105127

106128

107129
macos:
@@ -144,13 +166,15 @@ jobs:
144166
ARCTICDB_BUILD_CPP_TESTS: 1
145167

146168
- name: Build C++ Tests
169+
if: ${{ inputs.run_cpp_tests == true || github.event_name != 'workflow_dispatch' }}
147170
shell: bash -l {0}
148171
run: |
149172
cd cpp/out/darwin-conda-release-build/
150173
make -j ${{ steps.cpu-cores.outputs.count }} arcticdb_rapidcheck_tests
151174
make -j ${{ steps.cpu-cores.outputs.count }} test_unit_arcticdb
152175
153176
- name: Run C++ Tests
177+
if: ${{ inputs.run_cpp_tests == true|| github.event_name != 'workflow_dispatch' }}
154178
shell: bash -l {0}
155179
run: |
156180
cd cpp/out/darwin-conda-release-build/
@@ -169,9 +193,17 @@ jobs:
169193
- name: Test with pytest
170194
shell: bash -l {0}
171195
run: |
172-
cd python
173196
export ARCTICDB_RAND_SEED=$RANDOM
174-
python -m pytest --timeout=3600 -n ${{ steps.cpu-cores.outputs.count }} tests
197+
if [[ "$(echo "$ARCTICDB_PYTEST_ARGS" | xargs)" == pytest* ]]; then
198+
command="python -m $ARCTICDB_PYTEST_ARGS"
199+
echo "Run custom pytest command: $command"
200+
python -m pip install pytest-repeat
201+
eval "$command"
202+
else
203+
cd python
204+
python -m pytest --timeout=3600 -n ${{ steps.cpu-cores.outputs.count }} tests $ARCTICDB_PYTEST_ARGS
205+
fi
175206
env:
176207
ARCTICDB_USING_CONDA: 1
208+
ARCTICDB_PYTEST_ARGS: ${{ inputs.run_custom_pytest_command }}
177209

python/tests/integration/arcticdb/version_store/test_basic_version_store.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2468,7 +2468,6 @@ def do(op, start, n):
24682468
pytest.skip(str(e))
24692469

24702470

2471-
@pytest.mark.skipif(sys.platform == "darwin", reason="Test broken on MacOS (issue #692)")
24722471
@pytest.mark.parametrize("method", ("append", "update"))
24732472
@pytest.mark.parametrize("num", (5, 50, 1001))
24742473
@pytest.mark.storage

0 commit comments

Comments
 (0)