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

testRuntime and cucumber #40

Open
dbahlbeck opened this issue Feb 12, 2015 · 3 comments
Open

testRuntime and cucumber #40

dbahlbeck opened this issue Feb 12, 2015 · 3 comments
Assignees

Comments

@dbahlbeck
Copy link

Hi,
I have a gradle project using the cucumber plugin that has a testRuntime dependency like this:

dependencies {
  testCompile project(':projectA')
  testRuntime project(':projectB')
}

in projectB there are a number of classes and resources that are only required at runtime. Unfortunately the jars for these projects are not build when I run the cucumber task, resulting in resources not being found etc.

How do I go about fixing this? Am I doing something wrong or is it a bug?

Thanks in advance!

@viphe
Copy link
Collaborator

viphe commented Feb 23, 2015

Hi,
The Cucumber plugin does not change anything to your testCompile or testRuntime deps or their interpretation. cucumberCompile and cucumberRuntime just depend on those.
Make sure your test classes compile correctly even without any Cucumber stuff.
If you could come up with some sample project replicating your issue, I should be able to look into it.

Cheers.

@dbahlbeck
Copy link
Author

Hi again,

Sorry for the long delay in responding. I have made a small Gradle multiproject that reproduces the problem. I have added it to github here: https://github.com/wursley/cucumber-test-dep

Here's a short summary of the code:

There are two projects 'proj1' and 'proj2'.
Proj1 contains:

  • the cucumber features and glue code
  • a Junit test that does the same as the cucumber glue code
  • a testRuntime dependency to proj2

Proj2 contains:

  • a class with a method that prints a message to stdout

To reproduce the problem run:

  • gradlew clean :proj1:cucumber

Compare this with running:

  • gradlew clean :proj1:test

You'll see in the Gradle output that when running :proj1:cucumber that the code for proj2 is not compiled.

Thanks for any help! :-)

@viphe
Copy link
Collaborator

viphe commented May 11, 2015

Thanks! This sounds awesome.
I will try to look at it as soon I can.

@viphe viphe self-assigned this May 11, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants