-
Notifications
You must be signed in to change notification settings - Fork 163
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
Fixing double-execution bug #92
Conversation
Excellent, @dfreeman. Does the error happen so early in Maven's startup that we have no hope of even getting a warn out to the logger at any point? If not, then I think the README and the gh-pages should have some gigantic warning in big bold letters with the error that a user would get and the (at-the-end-of-the-day-not-so-difficult) solution. I just did a near total-rewrite of jasmine-rails, so I'm too tuckered out to work on this, but I'm going to do my best to get to merging and cutting a release tomorrow. |
Thank you very much, Dan and Justin. I'll give this a shot as soon as it's merged! |
I just pulled this in, but it triggered a cuke failure ( Feature: custom source and spec directories
In order to organize the project how I see fit
I want to specify custom directories for my JavaScript source and specs
Scenario: custom spec and source directories # features/custom_directories.feature:6
Given I am currently in the "jasmine-webapp-custom-dirs" project # features/step_definitions/mvn_steps.rb:1
When I run "mvn clean test" # features/step_definitions/mvn_steps.rb:6
Then the build should succeed # features/step_definitions/mvn_steps.rb:21
And I should see "Results: 1 specs, 0 failures" # features/step_definitions/mvn_steps.rb:25
expected "[INFO] Scanning for projects...\n[INFO] \n[INFO] ------------------------------------------------------------------------\n[INFO] Building Example Webapp using Jasmine Maven Plugin using custom directories 1.1.0.1-SNAPSHOT\n[INFO] ------------------------------------------------------------------------\n[INFO] \n[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ jasmine-webapp-custom-dirs ---\n[INFO] Deleting /Users/justin/code/java/jasmine-maven-plugin/src/test/resources/examples/jasmine-webapp-custom-dirs/target\n[INFO] \n[INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ jasmine-webapp-custom-dirs ---\n[debug] execute contextualize\n[WARNING] Using platform encoding (MacRoman actually) to copy filtered resources, i.e. build is platform dependent!\n[INFO] skip non existing resourceDirectory /Users/justin/code/java/jasmine-maven-plugin/src/test/resources/examples/jasmine-webapp-custom-dirs/src/main/resources\n[INFO] \n[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ jasmine-webapp-custom-dirs ---\n[INFO] No sources to compile\n[INFO] \n[INFO] --- maven-resources-plugin:2.5:testResources (default-testResources) @ jasmine-webapp-custom-dirs ---\n[debug] execute contextualize\n[WARNING] Using platform encoding (MacRoman actually) to copy filtered resources, i.e. build is platform dependent!\n[INFO] skip non existing resourceDirectory /Users/justin/code/java/jasmine-maven-plugin/src/test/resources/examples/jasmine-webapp-custom-dirs/src/test/resources\n[INFO] \n[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ jasmine-webapp-custom-dirs ---\n[INFO] No sources to compile\n[INFO] \n[INFO] --- maven-surefire-plugin:2.10:test (default-test) @ jasmine-webapp-custom-dirs ---\n[INFO] No tests to run.\n[INFO] Surefire report directory: /Users/justin/code/java/jasmine-maven-plugin/src/test/resources/examples/jasmine-webapp-custom-dirs/target/surefire-reports\n\n-------------------------------------------------------\n T E S T S\n-------------------------------------------------------\n\nResults :\n\nTests run: 0, Failures: 0, Errors: 0, Skipped: 0\n\n[INFO] \n[INFO] >>> jasmine-maven-plugin:1.1.0.1-SNAPSHOT:test (default) @ jasmine-webapp-custom-dirs >>>\n[INFO] \n[INFO] --- jasmine-maven-plugin:1.1.0.1-SNAPSHOT:resources (default-resources) @ jasmine-webapp-custom-dirs ---\n[INFO] Processing JavaScript Sources\n[WARNING] JavaScript source folder was expected but was not found. Set configuration property `jsSrcDir` to the directory containing your JavaScript sources. Skipping jasmine:resources processing.\n[INFO] \n[INFO] --- jasmine-maven-plugin:1.1.0.1-SNAPSHOT:generateManualRunner (default-generateManualRunner) @ jasmine-webapp-custom-dirs ---\n[WARNING] Skipping manual spec runner generation. Check to make sure that both JavaScript directories `/Users/justin/code/java/jasmine-maven-plugin/src/test/resources/examples/jasmine-webapp-custom-dirs/src/main/javascript` and `/Users/justin/code/java/jasmine-maven-plugin/src/test/resources/examples/jasmine-webapp-custom-dirs/src/test/javascript` exist.\n[INFO] \n[INFO] --- jasmine-maven-plugin:1.1.0.1-SNAPSHOT:testResources (default-testResources) @ jasmine-webapp-custom-dirs ---\n[INFO] Processing JavaScript Specs\n[WARNING] JavaScript test source folder was expected but was not found. Set configuration property `jsTestSrcDir` to the directory containing your specs. Skipping jasmine:testResources processing.\n[INFO] \n[INFO] <<< jasmine-maven-plugin:1.1.0.1-SNAPSHOT:test (default) @ jasmine-webapp-custom-dirs <<<\n[INFO] \n[INFO] --- jasmine-maven-plugin:1.1.0.1-SNAPSHOT:test (default) @ jasmine-webapp-custom-dirs ---\n[INFO] Executing Jasmine Specs\n[INFO] \n-------------------------------------------------------\n J A S M I N E S P E C S\n-------------------------------------------------------\n[INFO] \n\nResults: 0 specs, 0 failures\n\n[INFO] ------------------------------------------------------------------------\n[INFO] BUILD SUCCESS\n[INFO] ------------------------------------------------------------------------\n[INFO] Total time: 4.442s\n[INFO] Finished at: Tue Jul 31 11:15:33 EDT 2012\n[INFO] Final Memory: 11M/81M\n[INFO] ------------------------------------------------------------------------\n" to match /Results: 1 specs, 0 failures.*/ (RSpec::Expectations::ExpectationNotMetError)
./features/step_definitions/mvn_steps.rb:26:in `/^I should see "([^"]*)"$/'
features/custom_directories.feature:11:in `And I should see "Results: 1 specs, 0 failures"'
Looking into it now. |
I'll confess that cuke and my laptop have a history of 'disagreement', but I thought I had sorted through pretty well. Please let me know if there's anything I can do to help out debugging. |
Yeah, I have about zero clue what the cause is. Works fine without the patch applied, does not add specs or source (and thus, 0 specs found) when the patch is applied |
It seems that it's not picking up the configuration. It's printing out these directories
But the configured directories are in webapp & src/test/jasmine. |
Yeah, I just came to the same conclusion. What's odd is that it seems to have no trouble picking up other configuration, though, e.g. Unfortunately I don't have time to dig in any deeper right now. I'm sorry this isn't just going smoothly; I imagine you were as eager to put this to rest as I was. |
I got it passing. The configuration was underneath the <build>
<plugins>
<plugin>
<groupId>com.github.searls</groupId>
<artifactId>jasmine-maven-plugin</artifactId>
<version>${project.version}</version>
<extensions>true</extensions>
<executions>
<execution>
<goals>
<goal>test</goal>
</goals>
</execution>
</executions>
<configuration>
<jsSrcDir>${project.basedir}/src/main/webapp/js</jsSrcDir>
<jsTestSrcDir>${project.basedir}/src/test/jasmine</jsTestSrcDir>
</configuration>
</plugin>
</plugins>
</build> |
That was my first impulse too -- which in my mind would be a much bigger issue than the whole However, when I checked to see if |
Dear subscribers of this thread, 1.2.0.0 is released and merges in this fix (along with coffee 1.3.3, the HtmlUnit 2.9, and jasmine 1.2.0) |
Thanks, just to be clear, all that's needed is to add this to the plugin within the POM? true |
Oops, adding the markup:
|
Doh, never mind I see it was added to the markdown. Thanks! |
I hate to ask, but it looks like the plugin isn't accepting the new HtmlUnit 2.9 BrowserVersion values like CHROME_16 and FIREFOX_10. Assuming the plugin just needs to be updated to accept these, any chance that could sneak into a 1.2.1 or something? Thanks. |
Please note 1.2.0.0 doesn't seem to be compatible with Maven 2. More details on original pull request page: #54 |
A fresh version of the "please don't execute my
resources
andcompile
goals twice" fix originally submitted here@searls, I have the gh-pages update too, and am happy to submit it as well, but as it's only a single line (and to my knowledge you can't submit a multi-branch pull request), it might be easier for you to just update yourself. Let me know which you prefer.
I also imagine you'll want to update the archetype you've got hosted at searls-maven-repository.googlecode.com
I don't believe there's a way for the plugin to detect whether the
<extensions>true</extensions>
is present, as the resulting error if it's missing will occur during Maven's startup, long before the plugin has a chance to execute.