Skip to content

Commit e4bd2e2

Browse files
Publish pytest xml data (#2571)
#### Reference Issues/PRs Monday ticket ref: 9735825395 #### What does this implement or fix? Add a workflow that saves the pytest data into an ArcticDB db in S3. The workflow aggregates all of the pytest xmls (one for each execution) into a single csv and thus into a single data frame/symbol so they can be written in parallel to the DB. The CSVs/dataframe look like this: ``` csv python_version,test_type,test_name,status,time,message 3.8,unit,test_parallel_write_sort_merge[real_gcp_store_factory-False-10-1-1],skipped,0.000,Real GCP can be used only when persistent storage is enabled 3.8,unit,test_parallel_write_sort_merge[real_gcp_store_factory-False-None-None-None],skipped,0.000,Real GCP can be used only when persistent storage is enabled 3.8,unit,test_sort_merge_append[version_store_factory-EncodingVersion.V1-True],passed,0.050, 3.8,unit,test_sort_merge_append[version_store_factory-EncodingVersion.V1-False],passed,0.065, 3.8,unit,test_sort_merge_append[version_store_factory-EncodingVersion.V2-True],passed,0.048, 3.8,unit,test_sort_merge_append[version_store_factory-EncodingVersion.V2-False],passed,0.062, 3.8,unit,test_sort_merge_append[in_memory_store_factory-EncodingVersion.V1-True],passed,0.030, ``` I have also prepopulated the library [here](https://eu-west-1.console.aws.amazon.com/s3/buckets/arcticdb-ci-pytest-results?region=eu-west-1&bucketType=general&prefix=pytest_results/&showversions=false) with data from most of the runs from the past year. The [script](https://github.com/man-group/ArcticDB/pull/2571/files#diff-0356fc4ff5e79a810d9924232a2e09ce73a242efdd9abad9ca4467ad3d27ae37) used to save the pytest data can be run both for: - a single run - this is how it runs in the CI - multiple runs - this is how it can be run locally, it just needs the GH tool to be set up locally #### 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: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent 51b7fe3 commit e4bd2e2

File tree

4 files changed

+720
-2
lines changed

4 files changed

+720
-2
lines changed

.github/workflows/build.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,17 @@ jobs:
482482
DEBUG_ENABLED: ${{ needs.storage_type.outputs.DEBUG_ENABLED }}
483483
DEBUG_LOGGING_ENABLED: ${{ needs.storage_type.outputs.DEBUG_LOGGING_ENABLED }}
484484

485+
publish_pytest_data:
486+
needs: [common_config,build-python-wheels-linux, build-python-wheels-windows, build-python-wheels-macos]
487+
if: |
488+
always() &&
489+
!cancelled()
490+
uses: ./.github/workflows/publish_pytest_data.yml
491+
secrets: inherit
492+
permissions: {contents: write}
493+
with:
494+
environment: ${{needs.common_config.outputs.publish_env}}
495+
485496
can_merge:
486497
needs: [cpp-test-linux, cpp-test-windows, cpp-test-macos, build-python-wheels-linux, build-python-wheels-windows, build-python-wheels-macos, persistent_storage_verify_linux, persistent_storage_verify_windows]
487498
if: |

.github/workflows/build_steps.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,6 @@ jobs:
162162

163163
- name: Setup cmake
164164
uses: jwlawson/actions-setup-cmake@v2
165-
with:
166-
cmake-version: '3.31.6'
167165

168166
- name: Use cmake
169167
run: cmake --version
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Publish pytest data to S3
2+
on:
3+
workflow_call:
4+
inputs:
5+
environment: { type: string, required: true }
6+
workflow_dispatch:
7+
inputs:
8+
environment: { type: environment, required: true }
9+
run_id: { type: number, required: true }
10+
run-name: Publish ${{github.ref}} to arcticdb-pytest-data
11+
permissions:
12+
contents: read
13+
jobs:
14+
sync_pytest_xmls:
15+
runs-on: ubuntu-22.04
16+
container:
17+
image: ubuntu:22.04 # Native runner doesn't allow setting up the ca softlinks required below
18+
steps:
19+
- name: Select Python
20+
uses: actions/[email protected]
21+
with:
22+
python-version: "3.11"
23+
24+
- name: Setup env vars
25+
run: |
26+
# We are using an absolute path here because for some reason the upload-artifact action
27+
# does not work correctly with a relative path.
28+
echo "ARTEFACT_PATH=/tmp/${{ github.run_id }}" >> $GITHUB_ENV
29+
# get the current date and time in UTC
30+
echo "GITHUB_RUN_STARTED_AT=$(date -u +%Y-%m-%dT%H:%M:%SZ)" >> $GITHUB_ENV
31+
32+
- name: Gather pytest xmls from run ${{ github.run_id }}
33+
id: gather-pytest-xmls
34+
uses: actions/download-artifact@v4
35+
with:
36+
pattern: "pytest-*"
37+
run-id: ${{ github.run_id }}
38+
github-token: ${{github.token}}
39+
path: ${{ env.ARTEFACT_PATH }}
40+
41+
- name: Checkout
42+
uses: actions/[email protected]
43+
44+
- name: Install requirements
45+
run: |
46+
apt update
47+
apt install -y git
48+
python3 -m pip install arcticdb[Testing] click
49+
50+
- name: Setup softlink for SSL
51+
shell: bash -el {0}
52+
run: |
53+
mkdir -p /etc/pki/tls
54+
ln -s /usr/lib/ssl/certs /etc/pki/tls/certs
55+
ln -s /etc/ssl/certs/ca-certificates.crt /etc/pki/tls/certs/ca-bundle.crt
56+
57+
- name: Set persistent storage variables
58+
uses: ./.github/actions/set_persistent_storage_env_vars
59+
with:
60+
bucket: "arcticdb-ci-pytest-results"
61+
aws_access_key: "${{ secrets.AWS_S3_ACCESS_KEY }}"
62+
aws_secret_key: "${{ secrets.AWS_S3_SECRET_KEY }}"
63+
64+
- name: Process pytest xmls
65+
run: |
66+
ls -R ${{ env.ARTEFACT_PATH }}
67+
python3 build_tooling/process_pytest_artifacts.py --download-dir ${{ env.ARTEFACT_PATH }} --use-github-actions

0 commit comments

Comments
 (0)