-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
feat: support test source dirs in the plugin #68
Conversation
should be working now. |
assertThat(contentSource).doesNotExist(); | ||
|
||
final File resultFileProcessor = new File(basedir, "target/spoon-maven-plugin/spoon-nb-statement.txt"); | ||
assertThat(resultFileProcessor).exists(); |
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 think this test will always pass. Because you have an App.java class and thus the resultFileProcessor will always exist. Am I wrong?
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.
from my understanding the test will always fail, because we need the processors from the "/resources/processors/"
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.
Note: on my side I didn't try the test I wrote because the maven build was failing.
The processor is at
spoon-maven-plugin/src/test/java/fr/inria/gforge/spoon/mojo/CountStatementProcessor.java
Line 10 in 4bd92ae
public class CountStatementProcessor extends AbstractProcessor<CtStatement> { |
What I meant is that you're testing that the check worked by verifying that the output file exists. But this file will be created by the processor running on the main source, no?
Side note: this is why I didn't have any App.java class in my 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.
All this is speculation since I didn't run the maven build :)
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.
having only test classes is a way better test, good point. Changed it.
now it should only test with the test source file. |
Can i remove the edit in the original issue and see this as solved/ready for review/merge? |
Is that a question for me? :) If so, not sure what you mean. |
Yes was a question for you because i added
Afterwards, because you found some open problem |
@MartinWitt I've closed #68 if that's what you meant. Thanks! |
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.
Thanks a lot @MartinWitt you first contribution to spoon-maven-plugin will be very useful.
See comments, esp to improve the test of thee new feature.
<plugin> | ||
<groupId>fr.inria.gforge.spoon</groupId> | ||
<artifactId>spoon-maven-plugin</artifactId> | ||
<configuration> |
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.
the processor should be configured in full classpath
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 dont understand what you mean sry. Could you explain it?
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.
the processor should be configured in full classpath
@monperrus BTW could you explain why you've removed fullclasspath by default? It seemed like it would have better chance to work by default than having to force a configuration parameter, no? What am I missing? And yes I'm sure there are good reasons I don't know, I haven't followed this discussion/decision. I'm just curious to know the reasons. Thx!
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 dont understand what you mean sry. Could you explain it?
I think @monperrus means using <noclasspath>false</noclasspath>
or something like this but I'm not sure either.
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.
@monperrus BTW could you explain why you've removed fullclasspath by default?
It was removed from spoon-core by default, we did not make any explicit decision for spoon-maven-plugin, it inherits the default of spoon-core.
Why we set the default to NOCLASSPATH in spoon-core? Because it mawimizes the chance that a newcomer gets something interesting out of spoon without reading the doc and without setting a correct full classpath.
src/test/projects/hello-world-with-test/test/main/java/fr/inira/gforge/spoon/AppTest.java
Outdated
Show resolved
Hide resolved
Now, we need to expand |
Still need to lookup, how to specify classpath entries, for using |
Many many thanks @MartinWitt for the progress here.
See #69 @vmassol Does this meet your use case? |
README.md
Outdated
@@ -160,6 +160,7 @@ Maps and objects are created like this: | |||
## How to change source and output folder? | |||
|
|||
You can specify at spoon its input and output directories with, respectively, `srcFolder` and `outFolder` tags. |
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.
still needs rewrite.
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.
ok
The testConfigurationOfTheCustomInputFolder shows, that removing option removes the ability to check only some custom folder. Readd the sourceFolder setting or lose the ability? |
OK for me to remove this feature. |
All todos are resolved now. |
Thanks a lot @MartinWitt , that was long but very important work to be done. |
Thanks @vmassol for all your inputs. |
Yippee; thanks a lot guys, you're great :) Big up to @MartinWitt |
@monperrus @MartinWitt Any idea when a spoon version containing this will be available? :) Thanks! |
Sadly releases are out of my scope, you have to wait for a maintainer(?) for a release. |
I'll do the release.
@vmassol do you confirm that everything works as expected on your setup?
|
bq. @vmassol do you confirm that everything works as expected on your setup? I was actually waiting for the release to test :) Problem is that I probably won't have the time today to test it (I'm in meeting all day). Now the issue represents my need for sure and you have tests for it I guess so it should be fine. If you prefer me to test it, then I could do that Friday. Thx |
If you prefer me to test it, then I could do that Friday.
Yes, that would be better. We're not in a rush anyway.
|
Actually I won't have the time because of the release. Maybe next week, but not sure yet. The "rush" was because I wanted to have this before the 12.4RC1 release of XWiki but from what I see it's going to be too late (I don't like to have an issue with commits and not closed for a release). But it's ok, it'll go in the next release in one month. It just means the spoon check is not active on xwiki FTM so more violations can be added any day. Definitely not critical but nice to have ASAP. My point is that you should not wait for me. You need to have your own tests so that you're sure that it works. But I'll be happy to help if I can, but will take some time. Thx |
No worries, we move forward. Release 3.4 done! @MartinWitt would you prepare a changelog to be added to https://github.com/SpoonLabs/spoon-maven-plugin/releases/tag/spoon-maven-plugin-3.4? Thanks! |
Thanks @monperrus! |
@MartinWitt I think this comment needs to be modified since you've removed the testFolder config properties:
Thanks |
@MartinWitt @monperrus I think I've found a regression in v3.4, see INRIA/spoon#3366 EDIT: Confirmed that it's a regression. I've re-run our build with v3.3 and it passed. |
@monperrus changelog comes after fixing the regression if that is okay for you? |
Sure, perfectly fine. Thx a lot. |
yes! we will release 3.4.1 and changelog it directly |
Fixes INRIA/spoon#3327
should do the trick, with adding a new parameter for test src. Sadly I need to fix maven issues before i can test it, because a dependency cant be resolved. If somebody wants to test it, it could be faster.
For the record the following fails: