Update .gitea/workflows/test.yml
Run Pytest with HTML and XML Test Reports / tests (push) Successful in 23s
Run Pytest with HTML and XML Test Reports / tests (push) Successful in 23s
This commit is contained in:
@@ -66,7 +66,7 @@ jobs:
|
||||
run: |
|
||||
echo "🚀 Running tests and generating reports..."
|
||||
source venv/bin/activate
|
||||
mkdir -p ci-reports/{coverage,markdown}
|
||||
mkdir -p ci-reports/{allure,coverage,markdown}
|
||||
|
||||
echo "🧪 Running pytest with coverage and report generation..."
|
||||
pixi run pytest . \
|
||||
@@ -76,15 +76,23 @@ jobs:
|
||||
--cov-report=html:ci-reports/coverage/ \
|
||||
--json-report \
|
||||
--json-report-file=ci-reports/markdown/pytest-report.json \
|
||||
--capture=no > ci-reports/markdown/raw-test-output.log 2>&1
|
||||
|
||||
exit_code=2
|
||||
echo "📦 Pytest exit code: $exit_code"
|
||||
--capture=no > ci-reports/markdown/raw-test-output.log 2>&1 && {
|
||||
echo "✅ Pytest completed"
|
||||
echo ""
|
||||
echo "📄 Markdown: ci-reports/markdown/test-report.md"
|
||||
echo ""
|
||||
echo "📦 JSON: ci-reports/markdown/pytest.json"
|
||||
} || {
|
||||
echo ""
|
||||
echo "⚠️ Some tests failed"
|
||||
awk '/=+ short test summary info =+/,/=+.* in .*s =+/' ci-reports/markdown/raw-test-output.log || true
|
||||
#cat ci-reports/markdown/raw-test-output.log
|
||||
}
|
||||
|
||||
echo ""
|
||||
echo "📈 Generating coverage summary..."
|
||||
coverage report --format=markdown > ci-reports/markdown/coverage-summary.md && {
|
||||
echo "✅ Coverage summary generated : ci-reports/markdown/coverage-summary.md"
|
||||
echo "✅ Coverage summary generated"
|
||||
} || {
|
||||
echo "⚠️ Coverage generation failed"
|
||||
}
|
||||
@@ -95,9 +103,8 @@ jobs:
|
||||
--input ci-reports/markdown/pytest-report.json \
|
||||
--output ci-reports/markdown/TEST-REPORT.md \
|
||||
--log ci-reports/markdown/raw-test-output.log \
|
||||
--json ci-reports/markdown/pytest-report.json \
|
||||
--exit-code $exit_code && {
|
||||
echo "✅ Tests markdown generated : ci-reports/markdown/TEST-REPORT.md"
|
||||
--json ci-reports/markdown/pytest-report.json && {
|
||||
echo "✅ Tests markdown generated"
|
||||
} || {
|
||||
echo "⚠️ Tests markdown generation failed"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user