https://pantsbuild.org/ logo
#general
Title
# general
w

witty-family-13337

01/06/2022, 11:09 AM
hello, giving it a go to Pants 2.9.0rc3 with the JVM support and I have a couple of questions which I don’t know if they are planned for final 2.9.0 or future releases: 1. Is there a way to pass JVM parameters while running ScalaTest tests? What I’m looking for is an equivalent to SBT’s
Test / javaOptions := List(…)
as we have some tests that require some specific JVM arguments (i.e. allowing reflective access to some Java 11 packages) in order to pass. The
[scalatest].args
section in
pants.toml
seems to be only for passing arguments to ScalaTest, not to the underlying JVM 2. We have some tests that need to load some files when running and they try to access them via the classpath but using a
resource
target as a dependency in the
scalatest_tests
target seems to be unsupported. Pants complains that the
resource
target should have a
resolve
or
compatible_resolves
field, but that field is also unsupported in the
resource
target. Is there a workaround for this that you may be aware or does it need to be implemented in a future release?
h

hundreds-father-404

01/06/2022, 4:31 PM
Hello! For #2, resources support was merged yesterday: https://github.com/pantsbuild/pants/pull/13908 @witty-crayon-22786 should that be cherry-picked?
w

witty-family-13337

01/06/2022, 5:24 PM
amazing, almost every time I think I need something, you guys have just merged it or about to ✌️
❤️ 1
b

busy-vase-39202

01/06/2022, 5:28 PM
So true! @witty-family-13337 would it be okay to tweet a quote of that? Without without attribution, whichever you prefer. No pressure, of course. It's just a common enough experience that I think readers will relate. :-)
w

witty-family-13337

01/06/2022, 5:37 PM
yeah sure, you can quote it, I don't mind attribution although it's not a very “original” piece of literature 😅
w

witty-crayon-22786

01/06/2022, 5:58 PM
yea, let’s cherry-pick the
resource
change! that’s a glaring omission
🙌 1
the JVM options are likely to take a little bit longer though… @witty-family-13337: are they a blocker for you?
we have them planned for early in the next milestone, but i’m not sure yet whether we’ll be to cherrypick them to
2.9.x
@witty-family-13337: also: do you need these options for all tests, or just for some?
w

witty-family-13337

01/06/2022, 6:56 PM
hi, sorry for late reply. The options I don't think they are a big blocker
they don't need to be applied to every test case
the ideal scenario would maybe be one in which they can be specified on either a target or globally
target-wise would be good to limit their impact to where they need to
w

witty-crayon-22786

01/06/2022, 6:58 PM
yea. i think that that might connect to some other work we’re planning. thanks!
🙌 1
w

witty-family-13337

01/06/2022, 7:00 PM
but even nowadays we can't do that, with SBT we have to apply them to all the tests in the same submodule, and SBT submodules are coarser than pants targets
I believe I could workaround some of the cases where we need them, so not a big deal if having to wait a bit
👍 1
w

witty-crayon-22786

01/07/2022, 5:19 AM