Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PYTHON-5047 Improve testing of publish workflows #105

Merged
merged 7 commits into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .evergreen/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,14 @@ dos2unix -q .venv/Scripts/activate
pip install "./mongo-python-driver[test]"
pip install -e ./src

export CLIENT_PEM="$DRIVERS_TOOLS/.evergreen/x509gen/client.pem"
export CA_PEM="$DRIVERS_TOOLS/.evergreen/x509gen/ca.pem"
export GSSAPI_PASS=${SASL_PASS}
export GSSAPI_CANONICALIZE="true"
export GSSAPI_HOST=${SASL_HOST}
export GSSAPI_PORT=${SASL_PORT}
export GSSAPI_PRINCIPAL=${PRINCIPAL}
pushd ./mongo-python-driver
TEST_ENTERPRISE_AUTH=1 bash ./.evergreen/run-tests.sh
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was this calling into itself previously?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, that was the script in pymongo. We'll eventually want to make it easier to run integ tests, but for now I'm doing it manually since the alternative would be to inject this library into the uv environment, which requires changes in pymongo.

pytest -W default -m auth
popd
popd
24 changes: 18 additions & 6 deletions .github/workflows/release-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,19 @@ on:
description: "Dry Run?"
default: false
type: boolean
schedule:
- cron: '30 5 * * *'

env:
# Changes per repo
PRODUCT_NAME: WinKerberos
# Changes per branch
SILK_ASSET_GROUP: winkerberos
EVERGREEN_PROJECT: winkerberos
# Constant
DRY_RUN: ${{ github.event_name == 'workflow_dispatch' && inputs.dry_run || 'true' }}
FOLLOWING_VERSION: ${{ inputs.following_version || '' }}
VERSION: ${{ inputs.version || '10.10.10.10' }}

defaults:
run:
Expand Down Expand Up @@ -48,9 +54,9 @@ jobs:
- uses: mongodb-labs/drivers-github-tools/python/pre-publish@v2
id: pre-publish
with:
version: ${{ inputs.version }}
version: ${{ env.VERSION }}
version_bump_script: ./.github/scripts/bump-version.sh
dry_run: ${{ inputs.dry_run }}
dry_run: ${{ env.DRY_RUN }}

build-dist:
needs: [pre-publish]
Expand All @@ -77,8 +83,14 @@ jobs:
with:
name: all-dist-${{ github.run_id }}
path: dist/
- name: Publish package distributions to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
skip-existing: true
attestations: ${{ env.DRY_RUN }}
- name: Publish package distributions to PyPI
if: startsWith(inputs.dry_run, 'false')
if: startsWith(env.DRY_RUN, 'false')
uses: pypa/gh-action-pypi-publish@release/v1

post-publish:
Expand All @@ -103,11 +115,11 @@ jobs:
artifactory_username: ${{ vars.ARTIFACTORY_USERNAME }}
- uses: mongodb-labs/drivers-github-tools/python/post-publish@v2
with:
version: ${{ inputs.version }}
version: ${{ env.VERSION }}
version_bump_script: ./.github/scripts/bump-version.sh
following_version: ${{ inputs.following_version }}
following_version: ${{ env.FOLLOWING_VERSION }}
product_name: ${{ env.PRODUCT_NAME }}
silk_asset_group: ${{ env.SILK_ASSET_GROUP }}
evergreen_project: ${{ env.EVERGREEN_PROJECT }}
token: ${{ github.token }}
dry_run: ${{ inputs.dry_run }}
dry_run: ${{ env.DRY_RUN }}
Loading