From d32aa3f76ec66e8bea548dd62eaee2dbf0998064 Mon Sep 17 00:00:00 2001 From: Marc Campbell Date: Tue, 3 Feb 2026 12:04:28 +0000 Subject: [PATCH] Add smoke test: push/pull + TTL expiry verification After deploy, tests: 1. Push busybox with 5m TTL (uses commit SHA for unique name) 2. Pull back to verify registry works 3. Wait 7 minutes for TTL to expire 4. Verify pull fails (image correctly deleted) Signed-off-by: Marc Campbell --- .github/workflows/deploy.yml | 46 ++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index f2cd648..fdff603 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -88,3 +88,49 @@ jobs: -e "replreg_secret=$(doppler secrets get REPLREG_SECRET --plain)" \ -e "registry_url=$(doppler secrets get REGISTRY_URL --plain)" \ playbooks/site.yml + + smoke-test: + name: Smoke Test (Push/Pull/TTL) + runs-on: ubuntu-latest + needs: deploy + steps: + - name: Test push and pull + run: | + IMAGE="ttl.sh/smoke-${{ github.sha }}:5m" + echo "๐Ÿงช Testing with image: $IMAGE" + + # Use busybox - tiny image (~1MB) + docker pull busybox:latest + docker tag busybox:latest "$IMAGE" + + echo "๐Ÿ“ค Pushing image..." + docker push "$IMAGE" + + # Remove local copy to force pull from registry + docker rmi "$IMAGE" + + echo "๐Ÿ“ฅ Pulling image back..." + docker pull "$IMAGE" + + echo "โœ… Push/pull test passed!" + + - name: Wait for TTL expiry + run: | + echo "โณ Waiting 7 minutes for 5m TTL to expire..." + sleep 420 + + - name: Verify image expired + run: | + IMAGE="ttl.sh/smoke-${{ github.sha }}:5m" + echo "๐Ÿ” Verifying image has expired..." + + # Remove local copy if cached + docker rmi "$IMAGE" 2>/dev/null || true + + # Try to pull - should fail + if docker pull "$IMAGE" 2>&1; then + echo "โŒ ERROR: Image still exists after TTL expiry!" + exit 1 + else + echo "โœ… Image correctly expired and unavailable!" + fi