C.W.K.
Stream
Lesson 11 of 13 · published

Smoke test

~10 min · smoke, post-deploy, verification

Level 0Apprentice
0 XP0/101 lessons0/10 achievements
0/120 XP to next level120 XP to go0% complete

'Deploy 됨' 은 '동작' 아냐

deploy job 이 green 이면 코드가 runtime 에 닿았다는 거. Runtime 이 동작 하는지는 별도 질문. Smoke test 가 그걸 답해.

뭘 검사할까

  • Health 엔드포인트/health 가 방금 deploy 한 build SHA 와 매치하는 200 반환.
  • 골든 사용자 플로우 하나 — 로그인, 프로필 fetch, 로그아웃. 최소 '앱 살아있나' 모양.
  • 외부 통합 — DB 쿼리, cache hit, third-party API ping.
  • Asset URL — 메인 페이지가 예상 제목 + CSS bundle hash 포함 HTML 반환.

Smoke 가 어디에 맞는가

  1. 사전-deploy: staging deploy job 후, prod deploy 시작 전 staging 에 smoke.
  2. 사후-deploy: prod deploy 직후 prod 에 smoke. 실패면 rollback workflow 발사.

Smoke vs full e2e

Smoke 는 빠르고 (60 초 이하) 생존 여부 테스트. Full end-to-end 는 더 느리고 (5-30 분) 현실적 조건에서 동작 테스트. 다른 역할. Smoke 가 deploy gate; e2e 는 nightly 에.

Code

사후-deploy smoke + 자동 rollback·yaml
  deploy:
    runs-on: ubuntu-latest
    environment: production
    steps:
      - uses: actions/checkout@v4
      - run: ./deploy.sh

  smoke:
    needs: deploy
    runs-on: ubuntu-latest
    steps:
      - name: Health
        run: |
          for i in 1 2 3 4 5; do
            sha=$(curl -fsS https://api.example.com/health | jq -r .sha)
            if [[ "$sha" == "${GITHUB_SHA::7}" ]]; then
              echo 'OK'; exit 0
            fi
            sleep 10
          done
          exit 1
      - name: Golden flow
        run: ./tests/smoke.sh

  rollback:
    needs: smoke
    if: failure()
    runs-on: ubuntu-latest
    environment: production
    steps:
      - run: ./rollback.sh

External links

Exercise

서비스에 SHA-aware health 엔드포인트 추가 (build sha + uptime + db ping 반환). 1 분 polling 하는 사후-deploy smoke job 연결. 의도적으로 나쁜 deploy 시도하고 rollback 발화 확인.

Progress

Progress is local-only — sign in to sync across devices.
이 페이지에서 버그를 발견하셨거나 피드백이 있으세요?문제 신고

댓글 0

🔔 답글 알림 (로그인 필요)
로그인댓글을 남기려면 로그인해 주세요.

아직 댓글이 없어요. 첫 댓글을 남겨보세요.