diff --git a/.github/workflows/python-build.yml b/.github/workflows/python-build.yml index ad534552c4e0..95fdf159670a 100644 --- a/.github/workflows/python-build.yml +++ b/.github/workflows/python-build.yml @@ -23,7 +23,7 @@ jobs: cache-suffix: ${{ runner.os }}-${{ matrix.python-version }} - name: Check version run: | - echo "Building and uploading Python package version: ${{ github.event.release.tag_name }}" + echo "Building and uploading Python package version: ${{ github.event.release.tag_name }}" - name: Build the package run: cd python && make build - name: Release diff --git a/.github/workflows/python-integration-tests.yml b/.github/workflows/python-integration-tests.yml index 632a7978f621..96e41a495371 100644 --- a/.github/workflows/python-integration-tests.yml +++ b/.github/workflows/python-integration-tests.yml @@ -160,18 +160,7 @@ jobs: timeout-minutes: 25 shell: bash run: | - uv run pytest -n logical --dist loadfile --dist worksteal -v --junitxml=pytest-completions.xml ./tests/integration/completions ./tests/integration/embeddings ./tests/samples ./tests/integration/cross_language - - name: Surface failing tests - if: always() - uses: pmeier/pytest-results-action@main - with: - path: python/pytest-completions.xml - summary: true - display-options: fEX - fail-on-empty: true - title: Test results - - name: Minimize uv cache - run: uv cache prune --ci + uv run pytest -v -n logical --dist loadfile --dist worksteal ./tests/integration/completions ./tests/integration/embeddings ./tests/samples ./tests/integration/cross_language python-merge-gate-memory: name: Python Pre-Merge Integration Tests - Memory (incl samples using those) @@ -228,18 +217,7 @@ jobs: timeout-minutes: 10 shell: bash run: | - uv run pytest -n logical --dist loadfile --dist worksteal -v --junitxml=pytest-memory.xml ./tests/integration/memory ./tests/samples - - name: Surface failing tests - if: always() - uses: pmeier/pytest-results-action@main - with: - path: python/pytest-memory.xml - summary: true - display-options: fEX - fail-on-empty: true - title: Test results - - name: Minimize uv cache - run: uv cache prune --ci + uv run pytest -v -n logical --dist loadfile --dist worksteal ./tests/integration/memory ./tests/samples python-integration-tests: name: Python Integration Tests - Scheduled run @@ -260,6 +238,20 @@ jobs: UV_PYTHON: ${{ matrix.python-version }} MEMORY_CONCEPT_SAMPLE: "true" COMPLETIONS_CONCEPT_SAMPLE: "true" + # Service containers to run with for the memory connectors, this only works on Ubuntu + services: + # Label used to access the service container + redis: + # Docker Hub image + image: redis/redis-stack-server:latest + ports: + # Opens tcp port 6379 on the host and service container + - 6379:6379 + weaviate: + image: cr.weaviate.io/semitechnologies/weaviate:1.26.6 + ports: + - 8080:8080 + - 50051:50051 steps: - uses: actions/checkout@v4 - name: Set up uv @@ -299,12 +291,6 @@ jobs: aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} aws-region: ${{ vars.AWS_REGION }} - - name: Setup Redis Stack Server - if: matrix.os == 'ubuntu-latest' - run: docker run -d --name redis-stack-server -p 6379:6379 redis/redis-stack-server:latest - - name: Setup Weaviate docker deployment - if: matrix.os == 'ubuntu-latest' - run: docker run -d -p 8080:8080 -p 50051:50051 cr.weaviate.io/semitechnologies/weaviate:1.26.6 - name: Start Azure Cosmos DB emulator if: matrix.os == 'windows-latest' run: | @@ -323,48 +309,36 @@ jobs: timeout-minutes: 10 shell: bash run: | - uv run pytest -n logical --dist loadfile --dist worksteal ./tests/integration/completions -v --junitxml=pytest-completions.xml + uv run pytest -v -n logical --dist loadfile --dist worksteal ./tests/integration/completions - name: Run Integration Tests - Embeddings id: run_tests_embeddings timeout-minutes: 5 shell: bash run: | - uv run pytest -n logical --dist loadfile --dist worksteal ./tests/integration/embeddings -v --junitxml=pytest-embeddings.xml + uv run pytest -v -n logical --dist loadfile --dist worksteal ./tests/integration/embeddings - name: Run Integration Tests - Memory id: run_tests_memory timeout-minutes: 5 shell: bash run: | - uv run pytest -n logical --dist loadfile --dist worksteal ./tests/integration/memory -v --junitxml=pytest-memory.xml - - name: Run Integration Tests - Cross Language + uv run pytest -v -n logical --dist loadfile --dist worksteal ./tests/integration/memory id: run_tests_cross_language timeout-minutes: 5 shell: bash run: | - uv run pytest -n logical --dist loadfile --dist worksteal ./tests/integration/cross_language -v --junitxml=pytest-cross.xml + uv run pytest -v -n logical --dist loadfile --dist worksteal ./tests/integration/cross_language - name: Run Integration Tests - Planning id: run_tests_planning timeout-minutes: 5 shell: bash run: | - uv run pytest -n logical --dist loadfile --dist worksteal ./tests/integration/planning -v --junitxml=pytest-planning.xml + uv run pytest -v -n logical --dist loadfile --dist worksteal ./tests/integration/planning - name: Run Integration Tests - Samples id: run_tests_samples timeout-minutes: 5 shell: bash run: | - uv run pytest -n logical --dist loadfile --dist worksteal ./tests/samples -v --junitxml=pytest-samples.xml - - name: Surface failing tests - if: always() - uses: pmeier/pytest-results-action@main - with: - path: python/pytest-*.xml - summary: true - display-options: fEX - fail-on-empty: true - title: Test results - - name: Minimize uv cache - run: uv cache prune --ci + uv run pytest -v -n logical --dist loadfile --dist worksteal ./tests/samples # This final job is required to satisfy the merge queue. It must only run (or succeed) if no tests failed python-integration-tests-check: @@ -373,7 +347,12 @@ jobs: strategy: max-parallel: 1 fail-fast: false - needs: [python-merge-gate-ai-services, python-merge-gate-memory, python-integration-tests] + needs: + [ + python-merge-gate-ai-services, + python-merge-gate-memory, + python-integration-tests, + ] steps: - name: Get Date shell: bash diff --git a/.github/workflows/python-lint.yml b/.github/workflows/python-lint.yml index c648a36b4a78..18444e097b6c 100644 --- a/.github/workflows/python-lint.yml +++ b/.github/workflows/python-lint.yml @@ -2,13 +2,13 @@ name: Python Code Quality Checks on: workflow_dispatch: pull_request: - branches: [ "main", "feature*" ] + branches: ["main", "feature*"] paths: - - 'python/**' + - "python/**" jobs: pre-commit: - if: '!cancelled()' + if: "!cancelled()" strategy: fail-fast: false matrix: @@ -38,5 +38,3 @@ jobs: extra_args: --config python/.pre-commit-config.yaml --all-files - name: Run Mypy run: uv run mypy -p semantic_kernel --config-file mypy.ini - - name: Minimize uv cache - run: uv cache prune --ci diff --git a/.github/workflows/python-unit-tests.yml b/.github/workflows/python-unit-tests.yml index 7427cf9a7795..aec1937984f5 100644 --- a/.github/workflows/python-unit-tests.yml +++ b/.github/workflows/python-unit-tests.yml @@ -62,8 +62,6 @@ jobs: display-options: fEX fail-on-empty: true title: Test results - - name: Minimize uv cache - run: uv cache prune --ci python-test-coverage: name: Python Test Coverage runs-on: [ubuntu-latest] @@ -80,15 +78,15 @@ jobs: - name: Setup filename variables run: echo "FILE_ID=${{ github.event.number }}" >> $GITHUB_ENV - name: Set up uv - uses: astral-sh/setup-uv@v3 + uses: astral-sh/setup-uv@v4 with: - version: "0.5.2" + version: "0.5.x" enable-cache: true cache-suffix: ${{ runner.os }}-${{ env.UV_PYTHON }} - name: Install the project run: uv sync --all-extras --dev - name: Test with pytest - run: uv run --frozen pytest -q --junitxml=pytest.xml --cov=semantic_kernel --cov-report=term-missing:skip-covered ./tests/unit | tee python-coverage.txt + run: uv run --frozen pytest -q --junitxml=pytest.xml --cov=semantic_kernel --cov-report=term-missing:skip-covered ./tests/unit | tee python-coverage.txt - name: Upload coverage if: always() uses: actions/upload-artifact@v4 @@ -105,5 +103,3 @@ jobs: path: python/pytest.xml overwrite: true retention-days: 1 - - name: Minimize uv cache - run: uv cache prune --ci