- Notifications
You must be signed in to change notification settings - Fork 1
[25.07.26 / TASK-229] Feature - FE Git Action E2E CI 적용 #47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 17 commits
50527ae 6045cb3 eda3cd9 378e66c 2ddaf34 f70099a c90cf04 8693ee5 e249c8c 66e135e 60ea5ce f6d329b 344170e b5b4d17 bd1fea6 5deb2f2 7eb9e96 fd8f17d 5a679b9 7de9646 5522f1d 8a7e079 File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| name: Process E2E Testing | ||
| | ||
| on: | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| | ||
| jobs: | ||
| process-e2e-test: | ||
| runs-on: ubuntu-latest | ||
| | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| | ||
| - name: Set up Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 23 | ||
| Comment on lines +16 to +19 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 코드래빗 코멘트처럼 LTS로 바꾸거나, api 리포지토리의 CI 처럼 여러 노드 버전에서 돌리는 게 좋을 것 같네요! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 애초에 해당 CI의 초반 코드를 해당 플로우의 코드에서 가져와서 23 버전으로 맞춘 것 같네요. | ||
| | ||
six-standard marked this conversation as resolved. Show resolved Hide resolved | ||
| - name: Install dependencies | ||
| run: | | ||
| npm install -g pnpm | ||
| pnpm install --frozen-lockfile | ||
| npx cypress install | ||
| | ||
| - name: Create .env file for Testing | ||
| run: | | ||
| echo "NEXT_PUBLIC_BASE_URL=http://localhost:3000" >> .env | ||
| echo "NEXT_PUBLIC_CHANNELTALK_PLUGIN_KEY=sample_key" >> .env | ||
| echo "NEXT_PUBLIC_GA_ID=sample_id" >> .env | ||
| echo "NEXT_PUBLIC_SENTRY_AUTH_TOKEN=sample_token" >> .env | ||
| echo "NEXT_PUBLIC_SENTRY_DSN=sample_dsn" >> .env | ||
| | ||
| - name: Start application server | ||
| run: | | ||
| pnpm dev & | ||
| env: | ||
| CI: true | ||
| | ||
| - name: Wait for server | ||
| run: npx wait-on http://localhost:3000 --timeout 60000 | ||
| | ||
| - name: Run Cypress tests | ||
| uses: cypress-io/github-action@v6 | ||
| with: | ||
| browser: chrome | ||
| headless: true | ||
| record: false | ||
| wait-on: 'http://localhost:3000' | ||
| wait-on-timeout: 120 | ||
| install: false | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| NEXT_PUBLIC_BASE_URL: 'http://localhost:3000' | ||
| NEXT_PUBLIC_CHANNELTALK_PLUGIN_KEY: 'sample_key' | ||
| NEXT_PUBLIC_GA_ID: 'sample_id' | ||
| NEXT_PUBLIC_SENTRY_AUTH_TOKEN: 'sample_token' | ||
| NEXT_PUBLIC_SENTRY_DSN: 'sample_dsn' | ||
| | ||
| - name: Upload screenshots | ||
| uses: actions/upload-artifact@v4 | ||
| if: failure() | ||
| with: | ||
| name: cypress-screenshots | ||
| path: cypress/screenshots | ||
| Comment on lines +65 to +70 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "artifact" 까진 너무 좋은데 이걸 저장해서 어디에 사용하나요?! next step 이 없는게 아쉽네요. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 반영했습니다! | ||
| | ||
| slackNotify: | ||
| runs-on: ubuntu-latest | ||
| | ||
| steps: | ||
| - name: Notify message to slack | ||
| uses: rtCamp/action-slack-notify@v2 | ||
| env: | ||
| SLACK_WEBHOOK: ${{ secrets.GIT_ACTION_SLACK_WEBHOOK }} | ||
| SLACK_CHANNEL: ${{ secrets.GIT_ACTION_SLACK_CHANNEL }} | ||
| SLACK_COLOR: ${{ job.status }} # 또는 'green', '#ff00ff' 처럼 직접 색상 지정 | ||
| SLACK_USERNAME: Github | ||
| SLACK_ICON: https://cdn-icons-png.flaticon.com/512/25/25231.png | ||
| SLACK_TITLE: E2E Test | ||
| SLACK_MESSAGE: 'E2E CI 테스트가 실패했습니다. Artifact를 확인해주세요.' | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| | @@ -54,6 +54,7 @@ Temporary Items | |
| | ||
| # testing | ||
| /coverage | ||
| /cypress/screenshots | ||
| | ||
| # next.js | ||
| /.next/ | ||
| | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| | @@ -14,10 +14,10 @@ export default defineConfig({ | |
| responseTimeout: 10000, | ||
| env: { | ||
| NEXT_PUBLIC_BASE_URL: 'http://localhost:3000', | ||
| NEXT_PUBLIC_CHANNELTALK_PLUGIN_KEY: 'test_key', | ||
| NEXT_PUBLIC_GA_ID: '', | ||
| NEXT_PUBLIC_SENTRY_AUTH_TOKEN: 'test_sentry_token', | ||
| NEXT_PUBLIC_SENTRY_DSN: 'test_sentry_dsn', | ||
| NEXT_PUBLIC_CHANNELTALK_PLUGIN_KEY: 'sample_key', | ||
| NEXT_PUBLIC_GA_ID: 'sample_id', | ||
| NEXT_PUBLIC_SENTRY_AUTH_TOKEN: 'sample_token', | ||
| NEXT_PUBLIC_SENTRY_DSN: 'sample_dsn', | ||
| Comment on lines +17 to +20 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 저번에 물어 본다는 것을 놓쳤는데 센트리 DSN 경우 node run-time 에서 모듈 올릴때 유효하지 않은 경우 뻑나거든요! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. | ||
| }, | ||
| /* eslint-disable @typescript-eslint/no-unused-vars */ | ||
| setupNodeEvents(_on, _config) { | ||
| | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| | @@ -44,12 +44,6 @@ describe('리더보드 페이지', () => { | |
| cy.get('select').eq(3).select('지난 30일'); | ||
| }); | ||
| | ||
| it('랭킹 순위가 표시되어야 한다', () => { | ||
| cy.get('[data-testid="rank"], [class*="rank"]').should('be.visible'); | ||
| cy.contains('1').should('be.visible'); | ||
| cy.contains('2').should('be.visible'); | ||
| }); | ||
| | ||
| Comment on lines -47 to -52 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 사용자랑 게시글 모두 보이니까 굳이 랭킹은 스킵한거죠? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 네 맞습니다! | ||
| it('통계 변화량이 표시되어야 한다', () => { | ||
| cy.contains('500').should('be.visible'); | ||
| cy.contains('300').should('be.visible'); | ||
| | ||

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
실패시 slack 오도록 하는건 어떻게 되었나요? 노션에 내용 있길래 여쭤봅니다~~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
반영했습니다!