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

[#58] 테스트 실행 중지 기능 추가하기 #89

Merged
merged 14 commits into from
Nov 21, 2023

Conversation

dev2820
Copy link
Collaborator

@dev2820 dev2820 commented Nov 21, 2023

한 일

  • 테스트 중지 기능 추가
  • 테스트 실행 중 재실행 방지
  • TestCase -> Simulation 으로 명칭 변경
  • Simulation의 입력과 결과 화면을 분리
  • 리팩토링

스크린 샷

변경된 테스트 입력 창

image
입력창과 입력 결과가 나오는 화면이 분리된 것을 볼 수 있습니다.
테스트 실행 버튼이 아래로 이동했습니다.

무한 루프를 시행한 경우

aabab
테스트 코드를 실행하면 테스트 실행이 "실행 취소" 로 변경됩니다.
실행을 취소하면 결과에 "실행 중단" 이라는 문구가 나타납니다.
이를 통해 테스트 수행 중 테스트를 다시 실행할 수 없게 되고, 테스트를 취소할 수 있게 되었습니다.

참조

@dev2820 dev2820 added the FE fe 개발 label Nov 21, 2023
@dev2820 dev2820 self-assigned this Nov 21, 2023
Comment on lines +22 to +31
build: {
rollupOptions: {
output: {
inlineDynamicImports: true,
},
},
},
worker: {
format: 'es',
},
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

이건 웹 워커를 사용하는 경우 셋업해줘야하는 vite 설정인데 우선은 무시해주세요. 저도 자세히 몰라서
현재 Build를 실패하는 이슈가 있어서 설정이 제대로 동작하는지 확인을 못하고 있습니다.

Copy link
Collaborator

@dmdmdkdkr dmdmdkdkr left a comment

Choose a reason for hiding this comment

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

LGTM:D

Comment on lines +56 to +60
const isRequestSuccess = evaluator.evaluate(tasks);

if (!isRequestSuccess) {
return;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

isXXX : boolean;
if(!isXXX) return ;

이렇게 하니 가독성 좋네요

Comment on lines +26 to +31
function cancelEvaluation() {
evalWorkers.forEach(({ worker }) => worker.terminate());
evalManager.cancelTasks();

const newEvalWorkers = range(0, TOTAL_WORKERS).map(createEvaluator);
evalManager.setNewWorkers(newEvalWorkers);
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.

네, while(true)로 한 스레드가 먹통이 되어버리면 그 스레드를 통째로 드러내야해서 cancel하면 워커를 종료시키고 새로 등록합니다.

좀 더 정밀하게 하자면 쉬고 있는 워커는 놔두고 일하고 있는 워커만 새로 만드는 방법도 있는데, 그건 그냥 귀찮아서... :)

Copy link
Collaborator

@mahwin mahwin left a comment

Choose a reason for hiding this comment

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

LGTM 😎

@dev2820 dev2820 merged commit 2d60ace into fe-dev Nov 21, 2023
@dev2820 dev2820 deleted the 58-테스트-실행-중지-기능-추가하기 branch November 21, 2023 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FE fe 개발
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants