Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.

chore: Run perf tests in CI #847

Merged
merged 6 commits into from
Feb 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ general:
jobs:
build:
docker:
- image: circleci/node:8
- image: circleci/node:8-browsers
Copy link
Member

Choose a reason for hiding this comment

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

Not sure about this, puppeteer package will install an own browser. Do we need to switch images?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes.
Puppeteer installs its own Chrome, but it still depends on some shared libraries which are not installed in the original image:

[02:10:55] 'perf:run' errored after 174 ms
[02:10:55] Error: Failed to launch chrome!
/home/circleci/project/node_modules/puppeteer/.local-chromium/linux-609904/chrome-linux/chrome: error while loading shared libraries: libXtst.so.6: cannot open shared object file: No such file or directory

environment:
TZ: "/usr/share/zoneinfo/America/Los_Angeles"
steps:
Expand Down Expand Up @@ -83,6 +83,9 @@ jobs:
else
echo "STATS_URI not set, skipping"
fi
- run:
name: Performance Tests
command: yarn perf
- run:
name: Danger JS
command: |
Expand Down
4 changes: 3 additions & 1 deletion build/gulp/tasks/perf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ task('perf:run', async () => {
let browser

try {
browser = await puppeteer.launch()
browser = await puppeteer.launch({
args: ['--single-process'], // Workaround for newPage hang in CircleCI: https://github.com/GoogleChrome/puppeteer/issues/1409#issuecomment-453845568
})

for (let i = 0; i < times; i++) {
const page = await browser.newPage()
Expand Down