Add examples of mill + cask + scalasql #4924
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
base: main
Are you sure you want to change the base?
Add examples of mill + cask + scalasql #4924
Conversation
ivy"com.h2database:h2:2.2.224" | ||
) | ||
|
||
object test extends ScalaTests { |
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.
Let's have one test
suite using H2 in memory and one integration
suite using PostgreSQL via testcontainers.
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.
Addressed for examples
@chaitanyawaikar left some comments but otherwise looks reasonable |
"[6549-0] [error] -- [E8] /home/runner/work/mill/mill/out/example/scalalib/web/11-todo-http4s-scalasql/native/server/testForked.dest/worker-0/sandbox/run-2/build.mill:7:5 [6549-0] [error] 7 ? ivy"org.http4s::http4s-ember-server::0.23.30", [6549-0] [error] ? ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [6549-0] [error] ?value ivy is not a member of StringContext, but could be made available as an extension method. [6549-0] [error] ? [6549-0] [error] ?One of the following imports might fix the problem: [6549-0] [error] ? [6549-0] [error] ? import coursier.ivyRepositoryString [6549-0] [error] ? import coursier.util.StringInterpolators.SafeIvyRepository [6549-0] [error] ? [6549-0] [error] ? [6549-0] [error] -- [E8] /home/runner/work/mill/mill/out/example/scalalib/web/11-todo-http4s-scalasql/native/server/testForked.dest/worker-0/sandbox/run-2/build.mill:8:5"
Are these apps written from scratch or did you copy them from somewhere else? If they are copies, you should add a comment where they come from, which version you used and under which license they were shared. |
These apps are written from scratch. I checked the pattern of other examples written under |
@chaitanyawaikar let me know when you want me to review this again, l'm not seeing the separate |
@lihaoyi yes, I will try to complete this in 1-2 days. I am facing many issues running integration tests locally, hence started pushing code to remote CI server. It may sound a bit trivial, but could you please let me know how to run the integration tests from within the examples ? I tried the following commands # From inside the example ../mill/example/scalalib/web/10-todo-webapp-cask-scalasql
./mill __.test
# From the root project directory
./mill "example.scalalib.web.`10-todo-webapp-cask-scalasql`.test" and none of them run only the integration tests only for that module. However, running the complete test suite locally however crashes my system and this is slowing me down considerably. Any inputs here would be highly helpful to bring this to completion. Thank you 🙏 |
@chaitanyawaikar the developer.md docs have the syntax
|
The review comments have been addressed. Feel free to review them once again. |
def scalaVersion = `package`.scalaVersion | ||
override def repositories = super.repositories ++ Seq( | ||
coursier.MavenRepository("https://oss.sonatype.org/content/repositories/snapshots") | ||
) | ||
override def moduleDeps = Seq(`package`) |
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.
None of these are necessary, why are they here?
} | ||
|
||
/** Unit tests using H2 */ | ||
trait TestModule extends TestBase with ScalaTests { |
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.
No need separate traits, just put these definitions in the object
s
ivy"com.lihaoyi::scalatags:0.13.1", | ||
ivy"com.lihaoyi::upickle:3.1.0", | ||
ivy"com.lihaoyi::scalasql:0.1.19", | ||
ivy"com.h2database:h2:2.2.224" |
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.
Does the root module really need h2database
when it is only used in the unit tests?
Dep.parse(ivy"org.http4s::http4s-scalatags::0.25.2", scalaVersion()).right.get, | ||
Dep.parse(ivy"io.circe::circe-generic::0.14.10", scalaVersion()).right.get, | ||
Dep.parse(ivy"com.lihaoyi::scalasql:0.1.19", scalaVersion()).right.get, | ||
Dep.parse(ivy"com.h2database:h2:2.2.224", scalaVersion()).right.get |
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.
Why this Dep.parse.right.get
stuff?
Left some comments. Your example Lastly, lets replace the existing Cask and Http4s examples with your new ones, rather than simply adding them on. The existing examples aren't really necessary once the new examples are in shape |
Description
This PR solves the issue #4799. It includes creation of two new examples of the very popular TODO MVC app
10-todo-webapp-cask-scalasql
11-todo-http4s-scalasql
Unit tests, integration tests and a short documentation have been added for each of these modules.
Commands to run the examples