This repository has been archived by the owner on Jan 15, 2020. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello, I learned about Gradle today and I started reading your book and following the examples as I go. I've run into some trouble running the
testing-geb
example.When I run it with
gradle test
(the way suggested in therun-example.bsh
for the project), the build passes but no output (reports/test results, not even abuild
directory) appears in the project's directory. Furthermore, when I change thegoogle.story
file in an attempt to break the test, for instance:the build still passes as if nothing happened.
Upon closer inspection, it seems that the
test
task stops prematurely because the project contains no test classes and all of the relevant code is put intest.doLast
, which never executes.Running the build with
-i
yields the following messageI tried passing the closure to a custom task instead of the
test.doLast
, in the following way:and running the test with
gradle integrationTest
. This time, it proceeded to download the dependencies and attempted to run the scenario. Unfortunately, it failed again and reported missing JavaScript files that it apparently expected to be present in thebuild\test-results
directory.Again, the
build
directory was not created. This is because obviously the new task does not come with all the functionality provided bytest
.I managed to run the test properly by adding a dummy test class to the project. The story itself fails because the test does not take into account the localized versions of google search and the titles don't match the ones I see in the browser. But don't think it's an issue for a simple example like this. What's important is that the story was actually executed and the reports were generated successfully.
I thought I'd share the solution, however naive. If there's a cleaner way to make the test run properly, please let me know. Perhaps there's a way to run the
test
task despite having no test classes available.