Making it more resiliant to network problems, fixing playright
Some checks failed
Tests / Build and Push CICD Complete Image (push) Failing after 4m6s
Tests / TSDoc Lint Check (push) Has been skipped
Tests / Backend Tests (push) Has been skipped
Tests / Frontend Tests (push) Has been skipped
Tests / Integration Tests (push) Has been skipped
Tests / End-to-End Tests (push) Has been skipped
Tests / Trailing Whitespace Check (push) Has been skipped
Tests / End of File Check (push) Has been skipped
Tests / YAML Syntax Check (push) Has been skipped
Tests / Backend Doctests (push) Has been skipped
Tests / TOML Syntax Check (push) Has been skipped
Tests / Mixed Line Ending Check (push) Has been skipped
Tests / TOML Formatting Check (push) Has been skipped
Tests / Ruff Linting (push) Has been skipped
Tests / Pyright Type Check (push) Has been skipped
Tests / Darglint Docstring Check (push) Has been skipped
Tests / No Docstring Types Check (push) Has been skipped
Tests / ESLint Check (push) Has been skipped
Tests / Prettier Format Check (push) Has been skipped
Tests / Ruff Format Check (push) Has been skipped
Tests / TypeScript Type Check (push) Has been skipped
Tests / Build and Push CICD Base Image (push) Successful in 3m27s

Signed-off-by: Cliff Hill <xlorep@darkhelm.org>
This commit is contained in:
2025-11-01 10:47:02 -04:00
parent 941106d59a
commit 570bc83295
5 changed files with 305 additions and 82 deletions

View File

@@ -322,10 +322,43 @@ jobs:
needs: setup
steps:
- name: Login to Gitea Container Registry
run: echo "${{ secrets.PACKAGE_ACCESS_TOKEN }}" | docker login dogar.darkhelm.org -u ${{ github.actor }} --password-stdin
run: |
echo "=== Network-Resilient Docker Registry Login ==="
for i in 1 2 3 4 5; do
echo "Login attempt $i/5..."
if echo "${{ secrets.PACKAGE_ACCESS_TOKEN }}" | timeout 60 docker login dogar.darkhelm.org -u ${{ github.actor }} --password-stdin; then
echo "✓ Login successful"
break
else
if [ $i -eq 5 ]; then
echo "❌ All login attempts failed after network timeouts"
exit 1
fi
echo "⚠ Login attempt $i failed, waiting 15s before retry..."
sleep 15
fi
done
- name: Check TOML formatting with pre-commit
run: |
docker pull dogar.darkhelm.org/darkhelm.org/plex-playlist/cicd:${GITHUB_SHA:-latest}
echo "=== Network-Resilient Docker Operations ==="
# Resilient docker pull with retries
for i in 1 2 3; do
echo "Docker pull attempt $i/3..."
if timeout 300 docker pull dogar.darkhelm.org/darkhelm.org/plex-playlist/cicd:${GITHUB_SHA:-latest}; then
echo "✓ Docker pull successful"
break
else
if [ $i -eq 3 ]; then
echo "❌ All docker pull attempts failed"
exit 1
fi
echo "⚠ Docker pull attempt $i failed, waiting 20s before retry..."
sleep 20
fi
done
# Run the actual test
docker run --rm dogar.darkhelm.org/darkhelm.org/plex-playlist/cicd:${GITHUB_SHA:-latest} bash -c "
cd /workspace &&
pre-commit run pretty-format-toml --all-files --show-diff-on-failure
@@ -553,22 +586,75 @@ jobs:
needs: [backend-tests, frontend-tests]
steps:
- name: Login to Gitea Container Registry
run: echo "${{ secrets.PACKAGE_ACCESS_TOKEN }}" | docker login dogar.darkhelm.org -u ${{ github.actor }} --password-stdin
run: |
echo "=== Network-Resilient Docker Registry Login ==="
for i in 1 2 3 4 5; do
echo "Login attempt $i/5..."
if echo "${{ secrets.PACKAGE_ACCESS_TOKEN }}" | timeout 60 docker login dogar.darkhelm.org -u ${{ github.actor }} --password-stdin; then
echo "✓ Login successful"
break
else
if [ $i -eq 5 ]; then
echo "❌ All login attempts failed after network timeouts"
exit 1
fi
echo "⚠ Login attempt $i failed, waiting 15s before retry..."
sleep 15
fi
done
- name: Run E2E tests
run: |
docker pull dogar.darkhelm.org/darkhelm.org/plex-playlist/cicd:${GITHUB_SHA:-latest}
echo "=== Network-Resilient E2E Test Execution ==="
# Resilient docker pull
for i in 1 2 3; do
echo "Docker pull attempt $i/3..."
if timeout 300 docker pull dogar.darkhelm.org/darkhelm.org/plex-playlist/cicd:${GITHUB_SHA:-latest}; then
echo "✓ Docker pull successful"
break
else
if [ $i -eq 3 ]; then
echo "❌ All docker pull attempts failed"
exit 1
fi
echo "⚠ Docker pull attempt $i failed, waiting 20s before retry..."
sleep 20
fi
done
# Run E2E tests with network resilience
docker run --rm -e CI=true dogar.darkhelm.org/darkhelm.org/plex-playlist/cicd:${GITHUB_SHA:-latest} bash -c "
cd /workspace/frontend &&
if [ -d 'tests/e2e' ] || grep -q 'playwright' package.json; then
echo 'Running E2E tests with Playwright...' &&
echo 'Running E2E tests with Playwright (Network Resilient)...' &&
export CI=true &&
export NODE_ENV=test &&
# Network-resilient Playwright setup
echo 'Verifying Playwright installation...' &&
yarn playwright --version &&
echo 'Installing Playwright browser binaries...' &&
yarn playwright install --with-deps &&
echo 'Running tests via yarn script...' &&
yarn test:e2e --reporter=list
echo 'Installing Playwright browser binaries with retries...' &&
for i in 1 2 3; do
echo \"Browser install attempt \$i/3...\" &&
if timeout 600 yarn playwright install --with-deps; then
echo \"✓ Playwright browsers installed successfully\" &&
break
else
if [ \$i -eq 3 ]; then
echo \"❌ All browser install attempts failed\" &&
exit 1
fi
echo \"⚠ Browser install attempt \$i failed, waiting 30s before retry...\" &&
sleep 30
fi
done &&
echo 'Running E2E tests with network resilience...' &&
# Set additional network timeout environment variables
export PLAYWRIGHT_TIMEOUT=90000 &&
export NODE_TLS_REJECT_UNAUTHORIZED=0 &&
yarn test:e2e --reporter=list --timeout=90000
else
echo ' No E2E tests found'
fi