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

[Question] How to run backend tests only? #14

Closed
hossameldeen opened this issue Nov 18, 2019 · 5 comments
Closed

[Question] How to run backend tests only? #14

hossameldeen opened this issue Nov 18, 2019 · 5 comments
Assignees
Labels

Comments

@hossameldeen
Copy link
Contributor

Use-case: TDD on the backend, using sbt ~test. The frontend tests add too much noise.

A workaround: I know I can do it by commenting this line test := ((test in Test) dependsOn ui-test).value. But is there a command for it without changing the source code?

A generalization: How to run any command (e.g., run) for the backend only?

Thanks in advance! :-) (and in all cases, if there's no solution for that at the moment :) )

@yohangz yohangz self-assigned this Nov 18, 2019
@yohangz
Copy link
Contributor

yohangz commented Nov 18, 2019

@hossameldeen, Please replace

@hossameldeen
Copy link
Contributor Author

@yohangz Sorry, I don't understand. Replace what?

@yohangz
Copy link
Contributor

yohangz commented Nov 18, 2019

@hossameldeen, sorry about that. I mistakenly hit the comment button. :) I will get back to you ASAP.

@yohangz
Copy link
Contributor

yohangz commented Nov 18, 2019

@hossameldeen, please replace

// Execute frontend test task prior to play test execution.
test := ((test in Test) dependsOn `ui-test`).value

with

lazy val testAll = taskKey[Unit]("Run backend and frontend tests.")

// Execute frontend test task prior to play test execution.
testAll := ((test in Test) dependsOn `ui-test`).value

then you can use test to run backend tests while testAll to run both UI and backend

@hossameldeen
Copy link
Contributor Author

Perfect, thank you @yohangz (Y)

Another note for future readers interested in TDD with this seed: You might find ~testQuick useful as well. And note that it happens to be for backend only, there's no version of it for the frontend (I wasn't interested in TDDing the frontend anyway).

One more note for future readers: If you want to use TDD with IntelliJ test runners, you might find the Alt+Shift+F10 shortcut useful. Yup, not really related to the issue but in case someone finds themselves in the exact same position as me :-)

Anyway, thanks again and wish you luck! :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants