-
Notifications
You must be signed in to change notification settings - Fork 43
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
Refactor integration test browser #935
Conversation
This commit prepares the testBrowser BrowserType init before the next refactoring commit. No behavior change is involved!
It is only used in a single place. There is no need to make it reusable at the moment.
This will be needed when options need to set testBrowser themselves. Instead of doing all the work in newTestBrowser and complicating it.
This will let us the testBrowser's initialization stage. Since it first makes a test VU and then uses it to initialize a browser type, some options (i.e. withLogCache) can only be used after the initialization. However, some others (i.e. withSamples) can only be used before the initialization. This fields lets us use both kind of options and let them init by detecting the init stage.
The option is now responsible for setting the log cache. This has the benefit of reducing the pollution in the newTestBrowser function and separates the responsibilities. We also don't need to keep track of whether to set the log cache. The option does that.
We're starting to remove the testBrowserOptions.
Simplify and remove testBrowserOptions. Options are now a part of testBrowser itself.
This makes it easier to see the initialization of the test browser as they're related.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I left a couple of nit picks comments 🙂
Would be nice next time if large refactors could be broken down into smaller PRs 😅
@ankur22, thanks for your review 🙇
Sorry for the hassle 😢 I understand the challenge with the commit count! While I've added descriptive links to help, they may not be enough 😢 Despite this PR being smaller than usual, I acknowledge that breaking larger refactors into smaller atomic PRs could aid comprehension. We also need to ensure clarity is maintained due to too many PRs. How about discussing the best approach in a brief meeting? 🙂 I'm sure we can devise a suitable solution for all. Thanks for your input! 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice refactor! 👏 Although quite lengthy 😅
I think readability of the testBrowser
implementation is better now and helper methods are better organized. Thanks!
Just made a small comment.
Thanks, @ka3de 🙇 You mean the number of commits since our usual PRs are larger? Then again, sorry for the hassle :( I couldn't keep it smaller to make it a meaningful unit of work. I'm happy to discuss this in a short meeting :)
Good to hear! |
Updates: #898.
This PR improves the test browser into this one as follows. It's a nice first small step in removing the
api
package, and starting with the core of tests seemed to me an effective idea. While on it, I also made a refactoring that had been on my mind for quite a while.api
package dependency by using concrete types. See it here altogether.testBrowserOptions
ortestBrowser
.