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

Add native image test task #60

Merged
merged 11 commits into from
Apr 16, 2023
Merged

Conversation

cobr123
Copy link
Contributor

@cobr123 cobr123 commented Oct 31, 2022

Added tasks:

  • nativeImageTest
  • nativeImageTestRun
  • nativeImageTestRunAgent

Issue #50

@klpx
Copy link

klpx commented Feb 14, 2023

Really appreciate this work.
Tested your branch. It works as expected without any problems.
Built it with just:

sbt publishLocal

Tested with the following project configuration:

sbt.version = 1.8.2
nativeImageVersion := "22.3.1"
nativeImageJvm := "graalvm-java17"

The only thing I had to my buid.sbt is to specify test mainclass:

Test / mainClass := Some("my.app.ZioSpec")

Is there anything I can help to get this merged and released?

@nartamonov
Copy link

@ckipp @tgodzik @olafurpg Any hope the PR will be merged? ✌️ It's very useful feature, currently I use self-written task for running native tests at my work.

Copy link
Member

@olafurpg olafurpg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like super useful functionality and the PR has detailed tests. LGTM thank you!

@olafurpg
Copy link
Member

I'm on the phone right now so can't cut a release. Added a reminder to follow up and merge and release.

@olafurpg olafurpg merged commit 321e62c into scalameta:main Apr 16, 2023
@olafurpg
Copy link
Member

Published https://github.com/scalameta/sbt-native-image/releases/tag/v0.3.3 but may take a while for the jars to become available on Maven Central.

@nartamonov could you send a PR adding documentation to the readme so that people can discover this new functionality?

@nayavu
Copy link

nayavu commented May 5, 2023

@olafurpg 3 weeks have been passed but still no jars in Maven Central

@ckipp01
Copy link
Member

ckipp01 commented May 5, 2023

It looks like the publish job failed https://github.com/scalameta/sbt-native-image/actions/runs/4712517890. Looking I'm not really sure what's going on, but I'll update the release related things in #69 and give it another try.

@ckipp01
Copy link
Member

ckipp01 commented May 5, 2023

Alright, the 0.3.4 tag correctly released https://github.com/scalameta/sbt-native-image/actions/runs/4893876177/jobs/8737347750. This should be available soon.

@nayavu
Copy link

nayavu commented May 5, 2023

@ckipp01 , thank you for resolving it so fast!

I created a small example of how to use new features to automate native image building for Akka HTTP, might be useful for someone:
https://github.com/nayavu/akka-http-native-image

@guizmaii
Copy link
Collaborator

Hi everyone,

Does anyone know what I have to put in Test / main := Some(???) to run ZIO tests with the new nativeImageTestRun cmd?

I see in @nayavu's example, that for ScalaTest, it's: Test / mainClass := Some("org.scalatest.tools.Runner") but I don't find the equivalent for ZIO.

I tried several things and gets this error:

Error: Method 'zio.test.sbt.ZTestRunnerJVM.main' is declared as the main entry point but it can not be found. Make sure that class 'zio.test.sbt.ZTestRunnerJVM' is on the classpath and that method 'main(String[])' exists in that class.

Thanks

@cobr123
Copy link
Contributor Author

cobr123 commented May 19, 2023

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

Successfully merging this pull request may close these issues.

7 participants