메타 데이터를 지정하여 CI에서 TestCafe 테스트를 병렬로 실행하는 방법
내가 아는 한 TestCafe 기본 동작은 테스트를 병렬로 실행하는 것입니다. 실제로이 browsers
함수 는 브라우저 배열을 받아들입니다 (멋진). 그러나 제가하고 싶은 것은 상당히 다릅니다. 포털 영역 (검색, 결제 등)을 기반으로하는 설비가 있으므로 CLI에서 이러한 테스트를 직교하므로 병렬로 실행할 수 있는지 알고 싶습니다. 물론 범위는 테스트 케이스 수가 증가함에 따라 실행 시간을 개선하는 것입니다. 반면에 특정 메타 데이터 필터에 대해 병렬로 실행 된 테스트가 실패하면 다른 필터도 중지 할 수 있음을 의미하는 실패를 포착하고 싶습니다.
I am not using TestCafe's docker but our custom one with just Firefox, Chrome installed and we launch of tests in headless mode.
As a last point a great thing would be if we could run these scenario/metadata in parallel but somehow at the end of the test suite gather the reports together.
I understand the question is not easy especially because it involves either TestCafe or GitlabCi but probably someone else faced this problem too.
Thank you
답변
If I understand you correctly, the behavior you described can be achieved by dividing the test execution among multiple CI jobs. For example, each CI job can test a particular area of your portal. For that, run TestCafe with specified metadata of your fixture/test. Also, most of the CI systems allow you to cancel all other jobs in a pipeline if one of the jobs fails (unfortunately, Gitlab hasn't released this feature yet).
On the other hand, you can use TestCafe's programmatic API: create multiple TestCafe runners, each running the desired subset of tests. However, at the end of the test execution, you'll need to merge generated reports into one report manually. Check this answer to get an idea of how to create multiple runners.