added debug log to test execution
This commit is contained in:
parent
d2960bc892
commit
8f7b132dd4
1 changed files with 23 additions and 14 deletions
|
|
@ -51,13 +51,16 @@ jobs:
|
|||
- name: Upload to Allure
|
||||
if: always()
|
||||
run: |
|
||||
# Login und Cookies speichern
|
||||
# Debug: Check if results exist
|
||||
echo "=== Allure results directory ==="
|
||||
ls -la target/allure-results/ || echo "Directory not found"
|
||||
|
||||
# Login
|
||||
curl -s -c cookies.txt \
|
||||
-X POST "${ALLURE_SERVER}/allure-docker-service/login" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"username":"admin","password":"${{ secrets.ALLURE_PASSWORD }}"}'
|
||||
|
||||
# CSRF Token aus Cookie extrahieren
|
||||
CSRF_TOKEN=$(grep csrf_access_token cookies.txt | awk '{print $7}')
|
||||
|
||||
# Create project
|
||||
|
|
@ -67,22 +70,28 @@ jobs:
|
|||
-H "Content-Type: application/json" \
|
||||
-d '{"id":"'${ALLURE_PROJECT}'"}' || true
|
||||
|
||||
# Clean results
|
||||
# Clean old results
|
||||
curl -s -o /dev/null -b cookies.txt \
|
||||
-H "X-CSRF-TOKEN: ${CSRF_TOKEN}" \
|
||||
"${ALLURE_SERVER}/allure-docker-service/clean-results?project_id=${ALLURE_PROJECT}"
|
||||
|
||||
# Upload files
|
||||
# Upload files with debug
|
||||
FILE_COUNT=0
|
||||
for f in target/allure-results/*; do
|
||||
[ -f "$f" ] && curl -s -o /dev/null -b cookies.txt \
|
||||
if [ -f "$f" ]; then
|
||||
echo "Uploading: $f"
|
||||
curl -s -o /dev/null -b cookies.txt \
|
||||
-H "X-CSRF-TOKEN: ${CSRF_TOKEN}" \
|
||||
-X POST "${ALLURE_SERVER}/allure-docker-service/send-results?project_id=${ALLURE_PROJECT}" \
|
||||
-F "results[]=@$f"
|
||||
FILE_COUNT=$((FILE_COUNT + 1))
|
||||
fi
|
||||
done
|
||||
echo "Uploaded ${FILE_COUNT} files"
|
||||
|
||||
# Generate report
|
||||
curl -s -b cookies.txt \
|
||||
-H "X-CSRF-TOKEN: ${CSRF_TOKEN}" \
|
||||
"${ALLURE_SERVER}/allure-docker-service/generate-report?project_id=${ALLURE_PROJECT}"
|
||||
|
||||
echo "Allure upload complete"
|
||||
echo "✅ Allure upload complete"
|
||||
Loading…
Add table
Reference in a new issue