-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Move common test assets out of Azure Application Configuration #3368
Conversation
…ut of interceptorManager
…hedulers already.
Can one of the admins verify this patch? |
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.
Given these
/** | ||
* Base class for running live and playback tests using {@link InterceptorManager}. | ||
*/ | ||
public abstract class TestBase { |
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.
Should we also add placeholders for BeforeClass and AfterClass? These could allow performance wins with the tests instead of having to instantiate common build for every test.
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.
I thought about it, but the existing TestBase had a BeforeClass and AfterClass that didn't add value. I'm not sure how performance could be improved with having the base class with a no-op BeforeClass
that then calls the implementing class.
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.
That was left a little too vague on my part, less on the stub methods being useful now but more on they would allow optimizations. For example the App Config unit tests create a new builder, run an authenticate credentials, and construct a new client for each test. That could just get done once during the beforeClass call.
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.
Ahh I see what you're saying. Looking into the BeforeClass annotation... unfortunately it has to be a static method. So, it doesn't lend itself to having a stub method that can be overridden in an implementing class. :/
common/azure-common-test/src/main/java/com/azure/common/TestBase.java
Outdated
Show resolved
Hide resolved
common/azure-common-test/src/main/java/com/azure/common/TestBase.java
Outdated
Show resolved
Hide resolved
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 - just a package rename suggestion
This is part of a couple PRs. This PR:
SdkContext
,TestResourceNamer
, etc. will make it impossible to run test classes in parallel.TestBase
class.Related to #3208.