Skip to content
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

Test/#20 플레이 라이트 성능 테스트 자동화 #21

Merged
merged 12 commits into from
Jan 20, 2025

Conversation

ijun17
Copy link
Collaborator

@ijun17 ijun17 commented Jan 20, 2025

📂 작업 내용

closes #20

  • 플레이라이트 일단 돌아가게 하기
  • 성능 테스트 추가

💡 자세한 설명

https://www.notion.so/j-i-n/Playwright-9329f40c5f4d4e868cc1c31e3e615b37

📗 참고 자료 & 구현 결과 (선택)

📢 리뷰 요구 사항 (선택)

🚩 후속 작업 (선택)

✅ 셀프 체크리스트

  • PR 제목을 형식에 맞게 작성했나요?
  • 브랜치 전략에 맞는 브랜치에 PR을 올리고 있나요? (main이 아닙니다.)
  • 이슈는 close 했나요?
  • Reviewers, Labels를 등록했나요?
  • 작업 도중 문서 수정이 필요한 경우 잘 수정했나요?
  • 테스트는 잘 통과했나요?
  • 불필요한 코드는 제거했나요?

- 안쓰이는 대부분의 함수를 주석 처리
- 캔버스 셀렉터를 'canvas'에서 'canvas + canvas'로 변경(두 번째 캔버스)
- cpu 성능 4배 속도 제한
- 성능 메트릭 제한
- 드로잉 시간 20초로 변경
- .test.ts에서 .spec.ts로 변경
- 기존의 vitest랑 겹치는 문제로 인해
- 두번째 캔버스에서 첫번째 캔버스를 가리키도록 변경경
- 단 플레이어 별로 그리는 순서는 보장하지 않음
- 게스트 페이지 로딩 promise all로 처리
- 불필요한 await 제거
- cpu 성능 4배 -> 2배 변경
- 메트릭의 timestamp 제거
- 드로워 뿐만 아니라 게서도 성능 측정
@ijun17 ijun17 changed the base branch from develop to dev-fe January 20, 2025 03:23
@ijun17 ijun17 changed the base branch from dev-fe to develop January 20, 2025 03:44
@ijun17 ijun17 self-assigned this Jan 20, 2025
@ijun17 ijun17 added the ✅ test test 관련 label Jan 20, 2025
@@ -1,6 +1,17 @@
import { Page } from '@playwright/test';
import { DrawingFunction } from './test-types';

let initialSeed = 825347;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이건 seedRandom안에 옮기는 게 좋을 거 같습니다!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

initialSeed는 각 키(페이지) 별로 초기 시드 값을 관리하는 변수입니다
함수가 끝나도 값이 유지되어야 하기에 밖에서 관리 해야 할 것 같습니다

test('Drawing performance test with multiple browsers', async () => {
try {
// 셋업 및 모달 처리
clients = await setupTestRoom('http://localhost:5173');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 부분은 변수로 빼는 게 좋을거 같아요!

// ctx.fillRect(0, 0, canvas.width, canvas.height);
// ctx.stroke();
// });
// },
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

저는 이런 주석 처리된 코드들은 다 지우는게 좋은 것 같은데 어떻게 생각하시나요??

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이전 팀이 작성해 놓은 코드여서 혹시 몰라서 주석 처리 해놨는데 없어도 괜찮을거 같네요

const drawers = clients.filter((client) => ['PAINTER', 'DEVIL'].includes(client.role || ''));

// 모달 닫힌 후 시작 시간 기록
const testStartTime = Date.now();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

저번에 트러블 페인터 팀 테스트 코드를 보니 performance.now를 이용해서 더욱 정밀하게 측정하던데 이 부분도 performance.now를 사용해보는건 어떨까요?

@ijun17 ijun17 merged commit dc75720 into boostcampwm-2024:develop Jan 20, 2025
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✅ test test 관련
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Test] - Playwright 성능 테스트 자동화
3 participants