Skip to content

Commit

Permalink
Add CI wrapper tests against SDK changes (#8687)
Browse files Browse the repository at this point in the history
* Add CI wrapper tests against SDK changes

* CR Fixes
  • Loading branch information
N-o-Z authored Feb 18, 2025
1 parent 80c0945 commit f2847ad
Show file tree
Hide file tree
Showing 2 changed files with 131 additions and 6 deletions.
80 changes: 80 additions & 0 deletions .github/workflows/esti.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,19 @@ permissions:
pull-requests: write

jobs:
paths-filter:
runs-on: ubuntu-22.04
outputs:
python-sdk-change: ${{ steps.filter.outputs.python-sdk == 'true' }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
python-sdk:
- 'clients/python/**'
check-secrets:
name: Check if secrets are available.
outputs:
Expand Down Expand Up @@ -1143,6 +1156,73 @@ jobs:
click-to-expand: true
report-title: 'Python Wrapper System Tests Report'

python-wrapper-new-sdk:
needs: [deploy-image, login-to-amazon-ecr, paths-filter]
if: ${{ needs.paths-filter.outputs.python-sdk-change == 'true' }}
name: Test changes in SDK against the python wrapper
runs-on: ubuntu-22.04
env:
TAG: ${{ needs.deploy-image.outputs.tag }}
REGISTRY: ${{ needs.login-to-amazon-ecr.outputs.registry }}
LAKEFS_INSTALLATION_ACCESS_KEY_ID: AKIAIOSFDNN7EXAMPLEQ
LAKEFS_INSTALLATION_SECRET_ACCESS_KEY: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY

services:
lakefs:
image: ${{ needs.login-to-amazon-ecr.outputs.registry }}/lakefs:${{ needs.deploy-image.outputs.tag }}
credentials:
username: ${{ needs.login-to-amazon-ecr.outputs.docker_username }}
password: ${{ needs.login-to-amazon-ecr.outputs.docker_password }}
ports:
- '8000:8000'
env:
LAKEFS_DATABASE_TYPE: local
LAKEFS_BLOCKSTORE_TYPE: s3
LAKEFS_BLOCKSTORE_S3_CREDENTIALS_ACCESS_KEY_ID: ${{ secrets.ESTI_AWS_ACCESS_KEY_ID }}
LAKEFS_BLOCKSTORE_S3_CREDENTIALS_SECRET_ACCESS_KEY: ${{ secrets.ESTI_AWS_SECRET_ACCESS_KEY }}
LAKEFS_INSTALLATION_USER_NAME: admin
LAKEFS_INSTALLATION_ACCESS_KEY_ID: ${{ env.LAKEFS_INSTALLATION_ACCESS_KEY_ID }}
LAKEFS_INSTALLATION_SECRET_ACCESS_KEY: ${{env.LAKEFS_INSTALLATION_SECRET_ACCESS_KEY }}
LAKEFS_AUTH_ENCRYPT_SECRET_KEY: some random secret string
LAKEFS_STATS_ENABLED: false

steps:
- name: Check-out code
uses: actions/checkout@v4

- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9

- name: Install dependencies
working-directory: ./clients/python-wrapper
run: pip install -r requirements.txt pytest pytest-md pytest-emoji

- name: build and install lakeFS Python SDK
run: |
PACKAGE_VERSION=0.0.0-dev make sdk-python
pip install ./clients/python
- name: Generate uniquifying value
id: unique
run: echo "value=$RANDOM" >> $GITHUB_OUTPUT

- name: Run Python Wrapper Tests
uses: pavelzw/pytest-action@v2
env:
LAKECTL_CREDENTIALS_ACCESS_KEY_ID: ${{ env.LAKEFS_INSTALLATION_ACCESS_KEY_ID }}
LAKECTL_CREDENTIALS_SECRET_ACCESS_KEY: ${{env.LAKEFS_INSTALLATION_SECRET_ACCESS_KEY }}
LAKECTL_SERVER_ENDPOINT_URL: http://localhost:8000
STORAGE_NAMESPACE: s3://esti-system-testing/${{ github.run_number }}-python-wrapper/${{ steps.unique.outputs.value }}
with:
verbose: true
emoji: true
job-summary: true
custom-arguments: './clients/python-wrapper/tests/integration -rP -We'
click-to-expand: true
report-title: 'Python Wrapper System Tests SDK Changes Report'

# e2e-<db type>-<block adapter type>
e2e-ddb-local-local:
name: E2E - DynamoDB Local - Local Block Adapter
Expand Down
57 changes: 51 additions & 6 deletions .github/workflows/python-wrapper-unit-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,23 @@ jobs:
paths-filter:
runs-on: ubuntu-22.04
outputs:
client-change: ${{ steps.filter.outputs.client == 'true' }}
wrapper-change: ${{ steps.filter.outputs.wrapper == 'true' }}
sdk-change: ${{ steps.filter.outputs.sdk == 'true' }}
steps:
- uses: actions/checkout@v3
- uses: dorny/paths-filter@v2
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
client:
wrapper:
- 'clients/python-wrapper/**'
- '.github/workflows/python-wrapper-unit-tests.yaml'
sdk:
- 'clients/python/**'
always-succeed:
needs: paths-filter
if: ${{ needs.paths-filter.outputs.client-change != 'true' }}
if: ${{ needs.paths-filter.outputs.wrapper-change != 'true' }}
name: Unit Test Python SDK Wrapper
runs-on: ubuntu-22.04
steps:
Expand All @@ -31,7 +34,7 @@ jobs:

unit-tests:
needs: paths-filter
if: ${{ needs.paths-filter.outputs.client-change == 'true' }}
if: ${{ needs.paths-filter.outputs.wrapper-change == 'true' }}
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -74,3 +77,45 @@ jobs:
custom-arguments: './clients/python-wrapper/tests/utests -q -We'
click-to-expand: true
report-title: 'Python Wrapper Unit Tests Report'

unit-tests-new-sdk:
needs: paths-filter
if: ${{ needs.paths-filter.outputs.sdk-change == 'true' }}
strategy:
fail-fast: false
matrix:
pydantic_v1: [ true, false ]
name: Unit Test Python SDK Wrapper - SDK Changes
runs-on: ubuntu-22.04
steps:
- name: Check out code
uses: actions/checkout@v4

- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9

# When installed it will skip the installation of pydantic in the next step which will install the latest > 2
- name: Install pydantic V1
if: matrix.pydantic_v1
run: pip install pydantic==1.10.6

- name: Install dependencies
working-directory: ./clients/python-wrapper
run: pip install -r requirements.txt pylint pytest pytest-md pytest-emoji

- name: build and install lakeFS Python SDK
run: |
PACKAGE_VERSION=0.0.0-dev make sdk-python
pip install ./clients/python
- name: Run Unit Tests
uses: pavelzw/pytest-action@v2
with:
verbose: true
emoji: true
job-summary: true
custom-arguments: './clients/python-wrapper/tests/utests -q -We'
click-to-expand: true
report-title: 'Python Wrapper Unit Tests SDK Changes Report'

0 comments on commit f2847ad

Please sign in to comment.