chore(ci): remove memory regression tests (#6395)
This commit is contained in:
1 parent
6aeda3faaf
commit
77dc317da2
1 file changed
+7
-83
@@ -60,7 +60,7 @@ jobs:
|
|||||||
TURBO_PLATFORM: linux/amd64
|
TURBO_PLATFORM: linux/amd64
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v7
|
- uses: actions/checkout@v7
|
||||||
if: '!env.ACT'
|
if: "!env.ACT"
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
@@ -91,7 +91,7 @@ jobs:
|
|||||||
run: pnpm test
|
run: pnpm test
|
||||||
|
|
||||||
container:
|
container:
|
||||||
name: Container, E2E, and memory
|
name: Container and E2E
|
||||||
needs: fast-gate
|
needs: fast-gate
|
||||||
if: |
|
if: |
|
||||||
github.event_name == 'merge_group' ||
|
github.event_name == 'merge_group' ||
|
||||||
@@ -104,7 +104,7 @@ jobs:
|
|||||||
packages: write
|
packages: write
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v7
|
- uses: actions/checkout@v7
|
||||||
if: '!env.ACT'
|
if: "!env.ACT"
|
||||||
with:
|
with:
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.ref || '' }}
|
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.ref || '' }}
|
||||||
@@ -113,11 +113,11 @@ jobs:
|
|||||||
uses: ./tooling/github/setup
|
uses: ./tooling/github/setup
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
if: '!env.ACT'
|
if: "!env.ACT"
|
||||||
uses: docker/setup-buildx-action@v4
|
uses: docker/setup-buildx-action@v4
|
||||||
|
|
||||||
- name: Build container once
|
- name: Build container once
|
||||||
if: '!env.ACT'
|
if: "!env.ACT"
|
||||||
uses: docker/build-push-action@v7
|
uses: docker/build-push-action@v7
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
@@ -158,7 +158,7 @@ jobs:
|
|||||||
--tag homarr-ci --tag homarr-e2e "${secret_args[@]}" .
|
--tag homarr-ci --tag homarr-e2e "${secret_args[@]}" .
|
||||||
|
|
||||||
- name: Cache Playwright browsers
|
- name: Cache Playwright browsers
|
||||||
if: '!env.ACT'
|
if: "!env.ACT"
|
||||||
id: playwright-cache
|
id: playwright-cache
|
||||||
uses: actions/cache@v6
|
uses: actions/cache@v6
|
||||||
with:
|
with:
|
||||||
@@ -184,82 +184,6 @@ jobs:
|
|||||||
path: e2e/test-results/
|
path: e2e/test-results/
|
||||||
retention-days: 7
|
retention-days: 7
|
||||||
|
|
||||||
- name: Run memory regression test
|
|
||||||
env:
|
|
||||||
CONTAINER_NAME: homarr-mem-${{ github.run_id }}-${{ github.run_attempt }}
|
|
||||||
SECRET_ENCRYPTION_KEY: 0000000000000000000000000000000000000000000000000000000000000000
|
|
||||||
run: |
|
|
||||||
docker run -d --name "$CONTAINER_NAME" -p 127.0.0.1::7575 \
|
|
||||||
-e NO_EXTERNAL_CONNECTION=true \
|
|
||||||
-e SECRET_ENCRYPTION_KEY="$SECRET_ENCRYPTION_KEY" \
|
|
||||||
homarr-ci
|
|
||||||
PORT=$(docker port "$CONTAINER_NAME" 7575/tcp | sed 's/.*://')
|
|
||||||
[[ "$PORT" =~ ^[0-9]+$ ]] || { echo "ERROR: invalid port mapping: '$PORT'"; exit 1; }
|
|
||||||
URL="http://127.0.0.1:${PORT}"
|
|
||||||
|
|
||||||
healthy=false
|
|
||||||
for i in $(seq 1 30); do
|
|
||||||
if curl -sf "$URL/api/health/ready" >/dev/null 2>&1; then
|
|
||||||
echo "Container healthy after $((i * 2))s"
|
|
||||||
healthy=true
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
sleep 2
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ "$healthy" != "true" ]; then
|
|
||||||
echo "ERROR: Container never became healthy"
|
|
||||||
docker logs "$CONTAINER_NAME" --tail 100
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
warmup_ok=0
|
|
||||||
for _ in $(seq 1 5); do
|
|
||||||
curl -sf "$URL/" >/dev/null 2>&1 && warmup_ok=$((warmup_ok + 1))
|
|
||||||
sleep 2
|
|
||||||
done
|
|
||||||
if [ "$warmup_ok" -eq 0 ]; then
|
|
||||||
echo "ERROR: All warmup requests failed"
|
|
||||||
docker logs "$CONTAINER_NAME" --tail 50
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
docker inspect -f '{{.State.Running}}' "$CONTAINER_NAME" | grep -qx true || {
|
|
||||||
echo "ERROR: Container died before memory measurement"
|
|
||||||
docker logs "$CONTAINER_NAME" --tail 100
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
RAW_MEMORY=$(docker stats --no-stream --format '{{.MemUsage}}' "$CONTAINER_NAME" | sed 's| /.*||')
|
|
||||||
MEMORY_MB=$(echo "$RAW_MEMORY" | awk '
|
|
||||||
/GiB/ { gsub(/GiB/, ""); print $1 * 1024; next }
|
|
||||||
/MiB/ { gsub(/MiB/, ""); print $1; next }
|
|
||||||
/KiB/ { gsub(/KiB/, ""); print $1 / 1024; next }
|
|
||||||
{ print $1 / 1048576 }
|
|
||||||
')
|
|
||||||
|
|
||||||
echo "Memory usage: ${MEMORY_MB} MB (${RAW_MEMORY})"
|
|
||||||
[[ "$MEMORY_MB" =~ ^[0-9]+(\.[0-9]+)?$ ]] || {
|
|
||||||
echo "ERROR: non-numeric memory value: '$MEMORY_MB' (raw: '$RAW_MEMORY')"
|
|
||||||
docker logs "$CONTAINER_NAME" --tail 100
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
if awk "BEGIN { exit !($MEMORY_MB < 50) }"; then
|
|
||||||
echo "ERROR: Memory suspiciously low (${MEMORY_MB} MB) — container may have crashed"
|
|
||||||
docker logs "$CONTAINER_NAME" --tail 100
|
|
||||||
exit 1
|
|
||||||
elif awk "BEGIN { exit !($MEMORY_MB > 700) }"; then
|
|
||||||
echo "ERROR: Memory usage ${MEMORY_MB} MB exceeds 700 MB"
|
|
||||||
docker logs "$CONTAINER_NAME" --tail 100
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Clean up memory test container
|
|
||||||
if: always()
|
|
||||||
env:
|
|
||||||
CONTAINER_NAME: homarr-mem-${{ github.run_id }}-${{ github.run_attempt }}
|
|
||||||
run: docker rm -f "$CONTAINER_NAME" >/dev/null 2>&1 || true
|
|
||||||
|
|
||||||
- name: Determine preview tag
|
- name: Determine preview tag
|
||||||
id: preview
|
id: preview
|
||||||
if: |
|
if: |
|
||||||
@@ -309,7 +233,7 @@ jobs:
|
|||||||
run: test -n "$PR_NUMBER" || { echo "pr_number is required for cleanup"; exit 1; }
|
run: test -n "$PR_NUMBER" || { echo "pr_number is required for cleanup"; exit 1; }
|
||||||
|
|
||||||
- name: Delete GHCR package version
|
- name: Delete GHCR package version
|
||||||
if: '!env.ACT'
|
if: "!env.ACT"
|
||||||
uses: actions/github-script@v8
|
uses: actions/github-script@v8
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
|
|||||||
Reference in new issue
Block a user