8000 Ability to run tests in different versions of browsers by unlok · Pull Request #73 · gemini-testing/gemini-core · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Sep 21, 2022. It is now read-only.

Ability to run tests in different versions of browsers - #73

Merged
unlok merged 1 commit into
masterfrom
feature/pass-bro-version
Jun 23, 2020
Merged

unlok merged 1 commit into
masterfrom
feature/pass-bro-version

Conversation

@unlok
@unlok unlok commented Jun 3, 2020
Copy link
Copy Markdown

No description provided.

@DudaGod DudaGod left a comment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Что осталось:

  • не забывать выгасить коммит с тестирование
  • неплохо было бы тестов на limited-pool докинуть

в остальном /ok

Comment thread lib/browser-pool/caching-pool.js Resolved

_initPool(browserId, version) {
const compositeId = buildCompositeBrowserId(browserId, version);
const freeBrowser = this.underlyingPool.freeBrowser.bind(this.underlyingPool);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

что же ты такой любитель bind-ов, можно же спокойно без него обойтись

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

я просто перенес код из конструктора)
ну и в данном случае bind явный, а если написать:

const freeBrowser = (...args) => this.underlyingPool.freeBrowser(...args);

ну такоееее...

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Мы bind не юзаем, так как после него ты такую функцию ни с каким другим контекстом выполнения уже не вызовешь. Поэтому такие проблемы решаем с помощью стрелочных функций или .call

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Ну и зря не юзаете) Нужно отталкиваться от задачи. Не нужно хотеть перебиндить контекст метода, если это метод класса и он опирается на его внутренний стейт.

}

const {hasFreeSlots} = options;
const hasCacheForNextRequest = this._caches[options.compositeIdForNextRequest];
< 10BC8 div class="d-flex flex-items-center flex-wrap gap-1"> @DudaGod DudaGod Jun 17, 2020
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ты тут пулы веревками связал, так как ожидаешь, что другой пул прокинет необходимые опции

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

да, по-другому не добраться до лимитов( собственно говоря, пулы сами по себе связанны по своей логике и как-то вложить по-другому их не получится.

Comment thread lib/browser-pool/limited-use-set.js Resolved
Comment thread test/lib/browser-pool/basic-pool.js Resolved
Comment thread test/lib/browser-pool/caching-pool.js Resolved
Comment thread test/lib/browser-pool/caching-pool.js Resolved
Comment thread test/lib/browser-pool/limited-pool.js Resolved
Comment thread test/lib/browser-pool/caching-pool.js Resolved
@unlok
unlok force-pushed the feature/pass-bro-version branch 3 times, most recently from abcc75a to 3db5690 Compare June 18, 2020 14:54
@DudaGod DudaGod left a comment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/ok#2

Comment thread .gitignore Resolved

_initPool(browserId, version) {
const compositeId = buildCompositeBrowserId(browserId, version);
const freeBrowser = this.underlyingPool.freeBrowser.bind(this.underlyingPool);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Мы bind не юзаем, так как после него ты такую функцию ни с каким другим контекстом выполнения уже не вызовешь. Поэтому такие проблемы решаем с помощью стрелочных функций или .call

Comment thread test/lib/browser-pool/basic-pool.js Resolved
});
});

describe('freeBrowser', () => {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🔥

@unlok
unlok force-pushed the feature/pass-bro-version branch 2 times, most recently from 3ba5729 to 93d4e54 Compare June 23, 2020 15:35
@unlok
unlok merged commit e71e428 into master Jun 23, 2020
@unlok
unlok deleted the feature/pass-bro-version branch June 23, 2020 15:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0