Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

ci: retain API unit test reports (#42583)

Stephen Zhou57b9d73efe6a
diff --git a/.github/workflows/api-tests.yml b/.github/workflows/api-tests.yml
index c99c3c3cc25..05738455011 100644
--- a/.github/workflows/api-tests.yml
+++ b/.github/workflows/api-tests.yml
@@ -18,6 +18,7 @@ jobs:
name: API Unit Tests (${{ matrix.python-version }}, shard ${{ matrix.shardIndex }}/${{ matrix.shardTotal }})
runs-on: depot-ubuntu-24.04
env:
+ PYTHONUNBUFFERED: '1'
COVERAGE_FILE: coverage-unit-${{ matrix.python-version }}-${{ matrix.shardIndex }}
defaults:
run:
@@ -63,6 +64,7 @@ jobs:
--shard-total "${{ matrix.shardTotal }}" \
-o 'addopts=--cov=./api --cov-branch --import-mode=importlib' \
--cov-report= \
+ --junitxml=test-results/unit.xml \
api/tests/unit_tests \
api/providers/vdb/*/tests/unit_tests \
api/providers/trace/*/tests/unit_tests \
@@ -75,8 +77,18 @@ jobs:
-o 'addopts=--cov=./api --cov-branch --import-mode=importlib' \
--cov-report= \
--cov-append \
+ --junitxml=test-results/controllers.xml \
api/tests/unit_tests/controllers
+ - name: Upload unit test reports
+ if: ${{ !cancelled() }}
+ uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
+ with:
+ name: api-test-results-unit-${{ matrix.python-version }}-${{ matrix.shardIndex }}
+ path: test-results/*.xml
+ if-no-files-found: warn
+ retention-days: 7
+
- name: Upload unit coverage data
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with: