From f135783aa180ab82fbde13b81551d0dcea734638 Mon Sep 17 00:00:00 2001 From: Viktor Petersson Date: Sat, 7 Dec 2024 13:24:51 +0000 Subject: [PATCH] Adds debug logging --- .github/workflows/test.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1fc5a97..51335f2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -55,11 +55,15 @@ jobs: - name: Run visual tests run: | # Create snapshot directory - mkdir -p test/__image_snapshots__ + mkdir -p __image_snapshots__ # Run tests with update flag to generate snapshots and JSON output CI=1 xvfb-run --auto-servernum --server-args="-screen 0 1280x800x24" npm run test:visual:ci -- -u --json --outputFile=visual-test-results.json + # Debug - show where files are + echo "=== File locations ===" + find . -name "*.png" + - name: Generate visual test summary if: always() run: | @@ -78,14 +82,14 @@ jobs: echo "\`\`\`" >> $GITHUB_STEP_SUMMARY pwd >> $GITHUB_STEP_SUMMARY echo "Directory contents:" >> $GITHUB_STEP_SUMMARY - ls -R test/__image_snapshots__/ >> $GITHUB_STEP_SUMMARY 2>&1 || echo "No snapshots directory found" >> $GITHUB_STEP_SUMMARY + find . -name "*.png" >> $GITHUB_STEP_SUMMARY 2>&1 echo "\`\`\`" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY # Show screenshots echo "### Screenshots" >> $GITHUB_STEP_SUMMARY shopt -s nullglob # Handle case when no files match pattern - for img in test/__image_snapshots__/*.png; do + for img in $(find . -name "*.png"); do if [ -f "$img" ]; then name=$(basename "$img" -snap.png | sed 's/ci-//') echo "#### $name" >> $GITHUB_STEP_SUMMARY @@ -101,5 +105,6 @@ jobs: uses: actions/upload-artifact@v4 with: name: visual-test-screenshots - path: test/__image_snapshots__/*.png + path: | + ./**/*.png if-no-files-found: warn \ No newline at end of file