Skip to content

ci(e2e): use playwright shard feature#5624

Merged
inomdzhon merged 6 commits intomasterfrom
imirdzhamolov/issue5306/ci/playwright-parallelism
Aug 15, 2023
Merged

ci(e2e): use playwright shard feature#5624
inomdzhon merged 6 commits intomasterfrom
imirdzhamolov/issue5306/ci/playwright-parallelism

Conversation

@inomdzhon
Copy link
Contributor

@inomdzhon inomdzhon commented Aug 14, 2023

Изменения в reusable_workflow_test_e2e.yml:

  • Используем strategy.matrix и --shard для распараллеливания джоб.
  • Объединяем отчёты через npx playwright merge-reports см. https://playwright.dev/docs/test-sharding#github-actions-example
  • Удалили загрузку артефакта e2e-output за ненадобностью.
  • Удалили TODO Playwright реализовать покрытие, т.к. покрытие мы уже собираем jest'ом.

Изменения в playwright-ct.config.ts:

  • Так как в CI мы распараллеливаем тесты через --shard, то ставим workers на 1.
  • Пробуем выставить maxFailures: 10 в CI, чтобы в лишний раз не гонять все тесты, если 10 из них упали.
  • Используем для CI blob для отчёта, чтобы потом можно было смержить.

Результат

Стало в ~3.5 раза быстрее 🎉

image

До изменений

image

После изменений

Нюанс про кэширование сборки перед запуском теста

Пробовал использовать @actions/cache для кеширования playwright/.cache, но из-за того, что все тесты идут практически параллельно, этот кэш не успевает создаться.

В будущем можно попробовать создать предварительный шаг, в котором будет создан playwright/.cache и закэширован через @actions/cache. Сейчас у Playwright нет команды, которая позволила бы только собрать сборку для создания playwright/.cache.


Изменения в `reusable_workflow_test_e2e.yml`:
- Используем `strategy.matrix` и `--shard` для распараллеливания джоб.
- Объединяем отчёты через `npx playwright merge-reports`
  см. https://playwright.dev/docs/test-sharding#github-actions-example
- Пробуем использовать `@actions/cache` для кеширования `playwright/.cache`.
- Удалили загрузку артефакта `e2e-output` за ненадобностью.
- Удалили `TODO Playwright реализовать покрытие`, т.к.
  покрытие мы уже собираем jest'ом.

Изменения в `playwright-ct.config.ts`:
- Так как в CI мы распараллеливаем тесты через `--shard`, то
  ставим `workers` на 1.
- Пробуем выставить `maxFailures: 10` в CI, чтобы в лишний раз не гонять
  все тесты, если 10 из них упали.
- Используем для CI blob для отчёта, чтобы потом можно было смержить.
@inomdzhon inomdzhon requested a review from a team as a code owner August 14, 2023 11:46
@codesandbox-ci
Copy link

codesandbox-ci bot commented Aug 14, 2023

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit e373ae9:

Sandbox Source
VKUI TypeScript Configuration

@github-actions
Copy link
Contributor

github-actions bot commented Aug 14, 2023

size-limit report 📦

Path Size
JS 313.64 KB (0%)
JS (gzip) 91.78 KB (0%)
JS (brotli) 76.17 KB (0%)
JS import Div (tree shaking) 2.97 KB (0%)
CSS 276.34 KB (0%)
CSS (gzip) 36.06 KB (0%)
CSS (brotli) 28.61 KB (0%)

@github-actions
Copy link
Contributor

github-actions bot commented Aug 14, 2023

👀 Docs deployed

Commit e373ae9

@codecov
Copy link

codecov bot commented Aug 14, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (e8cfb6e) 81.83% compared to head (e373ae9) 81.83%.
Report is 8 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #5624   +/-   ##
=======================================
  Coverage   81.83%   81.83%           
=======================================
  Files         289      289           
  Lines        9655     9655           
  Branches     3073     3073           
=======================================
  Hits         7901     7901           
  Misses       1754     1754           
Flag Coverage Δ
unittests 81.83% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Co-authored-by: Daniil Suvorov <severecloud@gmail.com>
@github-actions
Copy link
Contributor

github-actions bot commented Aug 14, 2023

e2e tests

Playwright Report

@inomdzhon inomdzhon requested a review from a team August 14, 2023 15:03
SevereCloud
SevereCloud previously approved these changes Aug 14, 2023
Copy link
Contributor

@SevereCloud SevereCloud left a comment

Choose a reason for hiding this comment

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

Красивое

@inomdzhon inomdzhon force-pushed the imirdzhamolov/issue5306/ci/playwright-parallelism branch from 40a7aa9 to 0cd2815 Compare August 14, 2023 15:57
SevereCloud
SevereCloud previously approved these changes Aug 15, 2023
mendrew
mendrew previously approved these changes Aug 15, 2023
Copy link
Contributor

@mendrew mendrew left a comment

Choose a reason for hiding this comment

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

Очень круто, особенно результаты! 🎉 🎉 🎉

Только один вопрос про изменеия вretention-days

@inomdzhon inomdzhon dismissed stale reviews from mendrew and SevereCloud via e373ae9 August 15, 2023 09:47
Copy link
Contributor

@mendrew mendrew left a comment

Choose a reason for hiding this comment

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

💪

@inomdzhon inomdzhon merged commit 145050e into master Aug 15, 2023
@inomdzhon inomdzhon deleted the imirdzhamolov/issue5306/ci/playwright-parallelism branch August 15, 2023 11:00
inomdzhon added a commit that referenced this pull request Aug 21, 2023
test_e2e_prepare_report должен выполняться всегда после test_e2e. В #5624 условие if: always() было выставлено не там где надо.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CI]: включить шардирование для Playwright тестов в reusable_workflow_test_e2e.yml

3 participants