-
Notifications
You must be signed in to change notification settings - Fork 2
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
Conversation
- 안쓰이는 대부분의 함수를 주석 처리 - 캔버스 셀렉터를 'canvas'에서 'canvas + canvas'로 변경(두 번째 캔버스)
- cpu 성능 4배 속도 제한 - 성능 메트릭 제한 - 드로잉 시간 20초로 변경
- .test.ts에서 .spec.ts로 변경 - 기존의 vitest랑 겹치는 문제로 인해
- 두번째 캔버스에서 첫번째 캔버스를 가리키도록 변경경
- 단 플레이어 별로 그리는 순서는 보장하지 않음
- 게스트 페이지 로딩 promise all로 처리 - 불필요한 await 제거 - cpu 성능 4배 -> 2배 변경 - 메트릭의 timestamp 제거 - 드로워 뿐만 아니라 게서도 성능 측정
@@ -1,6 +1,17 @@ | |||
import { Page } from '@playwright/test'; | |||
import { DrawingFunction } from './test-types'; | |||
|
|||
let initialSeed = 825347; |
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.
이건 seedRandom안에 옮기는 게 좋을 거 같습니다!
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.
initialSeed는 각 키(페이지) 별로 초기 시드 값을 관리하는 변수입니다
함수가 끝나도 값이 유지되어야 하기에 밖에서 관리 해야 할 것 같습니다
test('Drawing performance test with multiple browsers', async () => { | ||
try { | ||
// 셋업 및 모달 처리 | ||
clients = await setupTestRoom('http://localhost:5173'); |
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.
이 부분은 변수로 빼는 게 좋을거 같아요!
core/crdt/test/drawing-utils.ts
Outdated
// ctx.fillRect(0, 0, canvas.width, canvas.height); | ||
// ctx.stroke(); | ||
// }); | ||
// }, |
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.
저는 이런 주석 처리된 코드들은 다 지우는게 좋은 것 같은데 어떻게 생각하시나요??
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.
이전 팀이 작성해 놓은 코드여서 혹시 몰라서 주석 처리 해놨는데 없어도 괜찮을거 같네요
const drawers = clients.filter((client) => ['PAINTER', 'DEVIL'].includes(client.role || '')); | ||
|
||
// 모달 닫힌 후 시작 시간 기록 | ||
const testStartTime = Date.now(); |
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.
저번에 트러블 페인터 팀 테스트 코드를 보니 performance.now를 이용해서 더욱 정밀하게 측정하던데 이 부분도 performance.now를 사용해보는건 어떨까요?
📂 작업 내용
closes #20
💡 자세한 설명
https://www.notion.so/j-i-n/Playwright-9329f40c5f4d4e868cc1c31e3e615b37
📗 참고 자료 & 구현 결과 (선택)
📢 리뷰 요구 사항 (선택)
🚩 후속 작업 (선택)
✅ 셀프 체크리스트
main
이 아닙니다.)