-
Notifications
You must be signed in to change notification settings - Fork 28
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
DSpot/Pit on Lutece core #704
Comments
Hello @assadOW2 Are you able to execute PIT and descartes? Could you please provide the command line? I guess executing the test with JUnit won't work also? I'll look to have a solution to this problem. |
hello @danglotb JUnit tests work only if you use the command line I gave in the description (and of course a mysql running on localhost for that configuration). |
Okay, so to be able to amplify the test suite of Lutece, we need to implement/fix the maven execution in the STAMP-project/testrunner. I'm gonna try to do that ASAP. |
Hi @danglotb, I tryed to fix the execution of the tests.
|
But DSpot uses a I'm currently working on this. |
For now, the major problem is that when we run a There are two potential solutions:
The first solution would be better for me, since we won't mess the source tree of the user. Do you have any idea how to do it? |
I found a workaround but it requires to modify the One must add: <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<executions>
<execution>
<id>default-testCompile</id>
<phase>none</phase>
</execution>
</executions>
</plugin> This can be implemented in DSpot, since we have already the mechanism of using a custom |
Hello, #714 should allow executing DSpot on Lutece. For now, I cannot merge the changes because the new release of STAMP-project/testrunner is not yet available. (need some time to be on maven central). But, I propose you to pull the branch git remote add danglotb https://github.com/danglotb/dspot.git
git fetch danglotb feat-use-maven-exec-test
git checkout feat-use-maven-exec-test
mvn clean package -DskipTests Then, you must do two things:
maven.pre.goals=lutece:exploded,antrun:run,-Dlutece-antrun-db-host=localhost,-Dlutece-antrun-db-name=lutece,-Dlutece-antrun-db-user=lutece,-Dlutece-antrun-db-password=motdepasse,-Dlutece-test-mysql Which is the concatenation of all your pre goals separated with a comma
Please, keep me update. |
Hi @danglotb, Same error occurs: Works better if I use the maven plugin in a |
Hi @gibello
Okay, I'll reproduce and fix this.
What did you do? Could give me the whole procedure? Could it be generalizable? |
Hi @danglotb , thanks a lot :) Added that in the pom (note I recompiled the Mojo and added the missing "excludedClasses" property):
mvn dspot:amplify-unit-tests Works (well, I'm not sure the reports are relevant... but discovering, dspot, maybe I don't find them, it's not really documented what is generated ansd where...). Takes 15 minutes and no failure, at least. If I uncomment the Jacoco testCriterion, it fails because of "CoveragePerTest.ser" not found (after a kind of class version mismatch in asm, I think...). So, it works only with default testCriterion (and only with the maven plugin, not the command line). generate-new-test-class, with-comment and use-maven-to-exe-test do not change anything in the fact that it works (it does if I comment them out). |
Hello, I'm not able to execute the Lutece's tests. I obtain the following errors: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.8:run (default-cli) on project lutece-core: An Ant BuildException has occured: The following error occurred while executing this line:
[ERROR] /home/bdanglot/workspace/lutece-core/target/lutece/WEB-INF/sql/build.xml:240: The following error occurred while executing this line:
[ERROR] /home/bdanglot/workspace/lutece-core/target/lutece/WEB-INF/sql/build.xml:47: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
[ERROR]
[ERROR] The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
[ERROR] around Ant part ...<ant antfile="/home/bdanglot/workspace/lutece-core/target/lutece/WEB-INF/sql/build.xml" dir="/home/bdanglot/workspace/lutece-core/target/lutece/WEB-INF/sql/">... @ 14:161 in /home/bdanglot/workspace/lutece-core/target/antrun/build-main.xml: Connection refused (Connection refused) With the following command line: mvn clean lutece:exploded antrun:run test -Dlutece-antrun-db-host=localhost -Dlutece-antrun-db-name=lutece -Dlutece-antrun-db-user=lutece -Dlutece-antrun-db-password=motdepasse -Dlutece-test-mysql Lutece-core version: da9efa1737ed47a004c6fe2dfac94f5b3b232a76 Thank you. |
hi @danglotb : Is mysql runnning and reachable on localhost ? |
Hi @danglotb
i push my tests on https://github.com/STAMP-project/lutece-core/
I'm using hsql db. Fell free to add o change the project.
Nicola
|
I did manage to build and test I can now look if we can amplify the tests. |
@assadOW2 were you able to run And obviously, the JacocoCoverageSelector won't work, since we need to execute the test through a maven command line, and test runner uses a java command line to compute the coverage. I'm gonna work on test-runner to make it able to compute the coverage with a maven command. |
Hi, should we keep this issue open? |
@danglotb Concerning Lutece itself, a reminder of how to run tests (not sure you were aware of the last tip, at the end of this comment): Install MySQL ("sudo apt-get install mysql-server") Build lutece: Initialize the database (with the script attached - it is an aggregate of multiple db scripts found in the lutece codebase): create_mysql_lutece_test_db.sql Now you should be able to run "mvn test" . Note that you may still encounter another issue: fr.paris.lutece.portal.service.plugin.PluginFileTest contains a hard-coded path… with a TODO comment (!), that may require to hard-copy target/test-classes/ dir in ../ so that everything goes fine (better do it, it is safer). |
Closing this issue. Please reopen it or open a new one. Thank you. |
Characteristics
Description
Unit tests on Lutece core (https://github.com/lutece-platform/lutece-core) require special configuration in order to be executed successfully. Command line argument used is:
mvn clean lutece:exploded antrun:run test -Dlutece-antrun-db-host=localhost -Dlutece-antrun-db-name=lutece -Dlutece-antrun-db-user=lutece -Dlutece-antrun-db-password=motdepasse -Dlutece-test-mysql
More information on automatic tests can be found on official Lutece wiki: https://fr.lutece.paris.fr/fr/wiki/maven.html
If unit tests are run with standard mvn test command, they fail. And this is why pit is not running when executing DSpot, it says it requires a green test suite.
My question is how can we run DSpot in order to pass the same configuration as above, regarding database.
Thanks for your help.
Steps to reproduce
Properties file
Command Line / Options
Other files and URLs
Relationships
Help on issue template
Preview to follow the link or open file .github/ISSUE_DOC.md
The text was updated successfully, but these errors were encountered: