Skip to content

Commit

Permalink
Adds debug logging
Browse files Browse the repository at this point in the history
  • Loading branch information
vpetersson committed Dec 7, 2024
1 parent 94397c3 commit f135783
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand All @@ -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
Expand All @@ -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

0 comments on commit f135783

Please sign in to comment.