-
-
Notifications
You must be signed in to change notification settings - Fork 20
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
FIX #18 Remove the IntegrationTest scope from the GraphQLQueryPlugin #20
Conversation
// TODO separate these into two auto plugins | ||
override def projectSettings: Seq[Setting[_]] = | ||
pluginSettings(Compile) ++ pluginSettings(IntegrationTest) | ||
override def projectSettings: Seq[Setting[_]] = pluginSettings(Compile) | ||
|
||
private def pluginSettings(config: Configuration): Seq[Setting[_]] = | ||
inConfig(config)( |
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 config can be removed from the following line below:
graphqlQueryDirectory := (sourceDirectory in Compile).value / "graphql",
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.
Good catch. I'm thinking about putting things into the Test
scope as these are actually tests.
I'm also less and less sure if the QueryPlugin
is actually necessary. You can write simple unit
tests with scalatest and sangria pretty easy as well. WDYT?
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 QueryPlugin helps to check that the generated schema and associated queries match. I guess that may be helpful in cases where you don’t us Scala end-to-end. In the project I used sangria in we had a scala.js client and was able to write unit tests that ran queries against the server-side and also tested the JSON serialization.
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.
Interesting point. Then let's keep it. I think the test scope is a better fit then, too.
Refs #18 |
@@ -15,7 +15,6 @@ libraryDependencies ++= Seq( | |||
|
|||
// scripted test settings | |||
scriptedLaunchOpts += "-Dproject.version=" + version.value | |||
scriptedLaunchOpts += "-Dcodegen.samples.dir=" + ((baseDirectory in ThisBuild).value / "src/test/resources") |
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 isolated the test cases as it was hard to refactor things due to the inter-dependencies.
Also the scripted tests acted as unit tests as well, which is too much IMHO.
No description provided.