-
Notifications
You must be signed in to change notification settings - Fork 26
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
Issue#360 - Create stress/load test which should cover all APIs with mocked OP #365
Conversation
return UmaClientFactory.instance(); | ||
} | ||
|
||
public Validator createValidator(Jwt idToken, OpenIdConfigurationResponse discoveryResponse, PublicOpKeyService keyService) { |
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.
we shouldn't mock validator, we want real validator to run. Is it because internal client it not created via client factory?
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.
Done. We have mocked RSASigner
otherwise we need JwksUri
which required op_host.
} | ||
|
||
public ResourceRegistrar createResourceRegistrar(PatProvider patProvider, ServiceProvider serviceProvider) { | ||
return new ResourceRegistrar(patProvider, serviceProvider); |
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.
It looks wrong too, we should mock ServiceProvider
and PatProvider
provider instead. But if it's more convenient then we can leave it for now.
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.
We have left this for now.
import java.lang.reflect.Constructor; | ||
import java.lang.reflect.Method; | ||
|
||
public class EnableMocksListener implements IAnnotationTransformer { |
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 guess we can add "mock" package exclusion since load test will be run only manually.
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.
Created 'tesng-load.xml' for mocked test cases so that the mocked test cases are excluded when running the unit test cases on jenkins.
public class SetUpTest { | ||
|
||
private static final Logger LOG = LoggerFactory.getLogger(SetUpTest.class); | ||
|
||
public static DropwizardTestSupport<OxdServerConfiguration> SUPPORT = null; | ||
|
||
|
||
@Parameters({"host", "opHost", "redirectUrls"}) | ||
@Parameters({"host", "opHost", "redirectUrls", "isLoadTest"}) |
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.
Lets introduce SetUpMockServerTest
which pick it up (with code re-use without copy/pastes). It would be nice to not mess between our normal tests and load tests.
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.
Done
@@ -24,10 +24,10 @@ | |||
*/ | |||
public class UpdateSiteTest { | |||
|
|||
@Parameters({"host", "opHost", "redirectUrls"}) | |||
@Parameters({"host", "opHost", "redirectUrls", "isLoadTest"}) |
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.
redundant, we should not mess normal and load tests
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.
Done
@@ -5,6 +5,7 @@ | |||
<parameter name="host" value="http://localhost"/> | |||
<parameter name="opHost" value="https://${test.server.name}"/> | |||
<parameter name="opDiscoveryPath" value=""/> | |||
<parameter name="isLoadTest" value="false"/> |
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.
create separate testng-load.xml
. isLoadTest
should not be here.
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.
Done
<!--<listeners> | ||
<listener class-name="org.gluu.oxd.mock.listener.EnableMocksListener"></listener> | ||
</listeners>--> | ||
|
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.
redundant line, remove please.
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.
Done
@@ -247,6 +253,15 @@ | |||
<class name="io.swagger.client.api.UmaGetClaimsGatheringUrlTest"/> | |||
</classes> | |||
</test> | |||
|
|||
|
|||
<!-- Mock tests--> |
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.
It should go in separate testng-load.xml.
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.
Done
test/test.properties
Outdated
@@ -0,0 +1,21 @@ | |||
test.server.name=ce-dev5.gluu.org |
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.
if we want to keep it for ce-dev5.gluu.org
then rename this file to ce-dev5.properties
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.
Not Required, so removed.
Issue#360 - Create stress/load test which should cover all APIs with mocked OP
#360
Changes Done:
For running the Mock test cases all the OP_HOST clients have been mocked using factory class
OpClientFactoryMockImpl.java
To run Mocked test cases (for load testing) set
isLoadTest
parameter inoxd-server/testng.xml
totrue
and uncommentorg.gluu.oxd.mock.listener.EnableMocksListener
which will disable all unit test cases.To run unit test case (not the mocked ones) set
isLoadTest
parameter inoxd-server/testng.xml
tofalse
and commentorg.gluu.oxd.mock.listener.EnableMocksListener
.org.gluu.oxd.mock.AuthorizationCodeFlowTest
andorg.gluu.oxd.mock.UmaFullTest
to mock test authorization and UMA code flow.