Skip to content

test(mdc-menu): add performance tests for mdc-menu #20494

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

Merged
merged 3 commits into from
Sep 15, 2020

Conversation

wagnermaciel
Copy link
Contributor

  • Also cleaned up a small ts error I was getting from the material menu's driver.

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Sep 3, 2020
* Also cleaned up a small ts error I was getting from the material menu's driver.
@wagnermaciel wagnermaciel marked this pull request as ready for review September 3, 2020 22:04
@wagnermaciel wagnermaciel requested a review from a team as a code owner September 3, 2020 22:04
Copy link
Member

@devversion devversion left a comment

Choose a reason for hiding this comment

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

LGTM

params: [],
setup: async () => {
trigger = element(by.buttonText('Basic Menu'));
},
Copy link
Member

@devversion devversion Sep 4, 2020

Choose a reason for hiding this comment

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

As a note for the dev-infra helper: We should remove the setup property from the runBenchmark function and just do the setup before. e.g. you could just directly assign the trigger variable based on what I can tell.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You mean inside the work callback?

Copy link
Member

Choose a reason for hiding this comment

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

No, I just meant before calling runBenchmark.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The browser is not open until runBenchmark is called.

Copy link
Member

Choose a reason for hiding this comment

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

IIRC the browser is always open with protractor, it just is on an empty page on initialization. So ideally IMO, the test would manually call await browser.open(<..>) before and then do all preparation work before starting with the samples.

The reason why I'm proposing this is that setup and prepare are very unclear and ambiguous IMO, and as it looks, it's also complicating the logic for preparations (as seen with above for finding the trigger). I don't feel very strongly about it. Changing the name of these properties might help too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changing runBenchmark to not call openBrowser would require fixing all the old tests in angular/angular, too. Same with renaming setup, prepare, and work.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, that's clear to me. Though I think that these usages should ideally not prevent us from maintaining good health and readable code. I mentioned this here as a side note, but I think we should do something in the future.

For the record: I'd be happy to go through the instances in the future if needed. We could also add a separate helper that has the less ambiguous API. All of that is obviously not a priority right now but something to keep in mind since we keep adding new benchmarks and spread this across repositories.

Copy link
Member

Choose a reason for hiding this comment

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

@devversion devversion added action: merge The PR is ready for merge by the caretaker target: patch This PR is targeted for the next patch release labels Sep 4, 2020
Copy link
Member

@crisbeto crisbeto left a comment

Choose a reason for hiding this comment

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

LGTM

@wagnermaciel wagnermaciel merged commit f298de3 into angular:master Sep 15, 2020
wagnermaciel added a commit that referenced this pull request Sep 15, 2020
* test(mdc-menu): add performance tests for mdc-menu

* Also cleaned up a small ts error I was getting from the material menu's driver.

* fix ts errors and reword test ids

* change tabs to spaces

(cherry picked from commit f298de3)
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Oct 16, 2020
@wagnermaciel wagnermaciel deleted the mdc-menu-benchmark branch January 14, 2021 19:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants