Skip to content
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

ISPN-11345 Introduce integration tests for serverNG #7912

Closed
wants to merge 1 commit into from

Conversation

diegolovison
Copy link
Contributor

@diegolovison diegolovison commented Feb 18, 2020

https://issues.redhat.com/browse/ISPN-11345

  • Support Arquillian
  • Arquillian is optional
  • Support multiple Infinispan Servers
  • Support Infinispan CONTAINER driver

Support Arquillian
Allow running the test in Wildfly or Tomcat

Arquillian is optional
We can run the test without deploying it in Wildfly or Tomcat. It runs faster.

Support multiple Infinispan Servers
As a QE, I would like to create a test scenario using multiple Infinispan Servers.

Support Infinispan CONTAINER driver
Infinispan Servers will be running in a container.

@tristantarrant
Copy link
Member

Please wait while I work on extracting the Infinispan Server Test Driver to its own module


ArquillianServer server = ArquillianServer.valueOf(System.getProperty("infinispan.server.integration.launch").toUpperCase());
WebArchive war = ShrinkWrap.create(WebArchive.class, "infinispan-server-integration.war");
if (ArquillianServer.TOMCAT9.equals(server)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a NIT, instead of use if/else if/else in this case you can use swtich

switch (server) {
         case TOMCAT9:
            tomcat9(war);
            break;
         case WILDFLY18:
            wildfly18(war);
            break;
         default:
            throw new IllegalStateException(String.format("%s not supported", server));
      }

@diegolovison
Copy link
Contributor Author

diegolovison commented Mar 2, 2020

We now support be able to run the tests with and without Arquillian

dlovison@Diegos-MacBook-Pro infinispan % mvn verify -pl server/integration -Pwildfly18 | grep HotRodRemoteCacheIT
[INFO] Running org.infinispan.server.integration.HotRodRemoteCacheIT
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 26.964 s - in org.infinispan.server.integration.HotRodRemoteCacheIT
dlovison@Diegos-MacBook-Pro infinispan % mvn verify -pl server/integration -Ptomcat9 | grep HotRodRemoteCacheIT
[INFO] Running org.infinispan.server.integration.HotRodRemoteCacheIT
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 41.451 s - in org.infinispan.server.integration.HotRodRemoteCacheIT
dlovison@Diegos-MacBook-Pro infinispan % mvn verify -pl server/integration | grep HotRodRemoteCacheIT 
[INFO] Running org.infinispan.server.integration.HotRodRemoteCacheIT
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 9.084 s - in org.infinispan.server.integration.HotRodRemoteCacheIT

@diegolovison diegolovison force-pushed the ISPN-11345/10x branch 13 times, most recently from 22d5819 to 51857d3 Compare March 3, 2020 01:51
@diegolovison diegolovison force-pushed the ISPN-11345/10x branch 2 times, most recently from 4db8e38 to a9e360b Compare March 10, 2020 02:23
@diegolovison diegolovison force-pushed the ISPN-11345/10x branch 9 times, most recently from 8622845 to 3002046 Compare March 13, 2020 18:42
@diegolovison diegolovison force-pushed the ISPN-11345/10x branch 2 times, most recently from 4211c45 to 600ff91 Compare March 27, 2020 18:00
@diegolovison diegolovison force-pushed the ISPN-11345/10x branch 3 times, most recently from 0e05667 to 62ac5ce Compare April 8, 2020 00:11
@diegolovison
Copy link
Contributor Author

It is ready for review

Copy link
Member

@tristantarrant tristantarrant left a comment

Choose a reason for hiding this comment

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

You should work against master instead of 10.1.x.
Also I tried to build it but it fails with the following errors:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project infinispan-server-integration: Compilation failure: Compilation failure: 
[ERROR] /home/tst/Work/Infinispan/infinispan/server/integration/src/main/java/org/infinispan/server/integration/enricher/Enricher.java:[35,41] cannot find symbol
[ERROR]   symbol:   variable REMOTE_CONTAINER
[ERROR]   location: class org.infinispan.server.test.core.ServerRunMode
[ERROR] /home/tst/Work/Infinispan/infinispan/server/integration/src/main/java/org/infinispan/server/integration/enricher/Enricher.java:[38,26] cannot find symbol
[ERROR]   symbol:   method before(java.lang.String)
[ERROR]   location: variable serverRule of type org.infinispan.server.integration.enricher.Enricher.RemoteInfinispanServerRule
[ERROR] /home/tst/Work/Infinispan/infinispan/server/integration/src/main/java/org/infinispan/server/integration/enricher/Enricher.java:[41,46] method before in class org.infinispan.server.test.junit4.InfinispanServerTestMethodRule cannot be applied to given types;
[ERROR]   required: no arguments
[ERROR]   found:    java.lang.String,java.lang.String
[ERROR]   reason: actual and formal argument lists differ in length
[ERROR] /home/tst/Work/Infinispan/infinispan/server/integration/src/main/java/org/infinispan/server/integration/enricher/Enricher.java:[55,46] cannot find symbol
[ERROR]   symbol:   method getInfinispanServerRule()
[ERROR]   location: variable infinispanServerTestMethodRule of type org.infinispan.server.test.junit4.InfinispanServerTestMethodRule
[ERROR] /home/tst/Work/Infinispan/infinispan/server/integration/src/main/java/org/infinispan/server/integration/enricher/Enricher.java:[56,46] after() has private access in org.infinispan.server.test.junit4.InfinispanServerTestMethodRule
[ERROR] /home/tst/Work/Infinispan/infinispan/server/integration/src/main/java/org/infinispan/server/integration/enricher/Enricher.java:[68,7] method does not override or implement a method from a supertype
[ERROR] /home/tst/Work/Infinispan/infinispan/server/integration/src/main/java/org/infinispan/server/integration/enricher/Enricher.java:[70,14] serverDriver has private access in org.infinispan.server.test.junit4.InfinispanServerRule
[ERROR] /home/tst/Work/Infinispan/infinispan/server/integration/src/main/java/org/infinispan/server/integration/enricher/Enricher.java:[70,30] configuration has private access in org.infinispan.server.test.junit4.InfinispanServerRule
[ERROR] /home/tst/Work/Infinispan/infinispan/server/integration/src/main/java/org/infinispan/server/integration/enricher/Enricher.java:[70,43] cannot find symbol
[ERROR]   symbol:   method newDriver()
[ERROR]   location: variable configuration of type org.infinispan.server.test.core.InfinispanServerTestConfiguration
[ERROR] /home/tst/Work/Infinispan/infinispan/server/integration/src/main/java/org/infinispan/server/integration/InfinispanServerIntegrationProcessorExecuter.java:[55,28] before(java.lang.String) has private access in org.infinispan.server.test.junit4.InfinispanServerRule
[ERROR] /home/tst/Work/Infinispan/infinispan/server/integration/src/main/java/org/infinispan/server/integration/InfinispanServerIntegrationProcessorExecuter.java:[65,19] after(java.lang.String) has private access in org.infinispan.server.test.junit4.InfinispanServerRule
[ERROR] -> [Help 1]


public enum ArquillianServerType {

NONE, TOMCAT9, WILDFLY18;
Copy link
Member

Choose a reason for hiding this comment

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

We should remove the version from the identifiers.


<properties>
<version.tomcat>9.0.11</version.tomcat>
<version.wildfly>18.0.1.Final</version.wildfly>
Copy link
Member

Choose a reason for hiding this comment

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

19 please

WebArchive war = ShrinkWrap.create(WebArchive.class, "infinispan-server-integration.war");
addDefaultTestLib(war);
ArquillianServerType arquillianServerType = ArquillianServerType.current();
if (ArquillianServerType.TOMCAT9.equals(arquillianServerType)) {
Copy link
Member

Choose a reason for hiding this comment

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

Prefer a switch/case

/*
* It starts the ServerRunMode.CONTAINER in the client side
*/
public class InfinispanServerIntegrationProcessorExecuter {
Copy link
Member

Choose a reason for hiding this comment

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

s/Executer/Executor/

@diegolovison
Copy link
Contributor Author

I am waiting for #8173 get merged and then will work in the master branch

@diegolovison
Copy link
Contributor Author

I am waiting for #8297 get merged and then will work in the master branch

@danberindei
Copy link
Member

Please rebase on master. You can also edit the PR and change the base to master, no need to open a new one.

@diegolovison
Copy link
Contributor Author

I am going to follow https://github.com/infinispan/infinispan/tree/master/integrationtests/wildfly-modules that will simplify a lot the code

@diegolovison diegolovison deleted the ISPN-11345/10x branch June 2, 2020 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants