Skip to content

ArgumentListTooLong error running junit tests #19950

Open
@wfscheper

Description

@wfscheper

Describe the bug
I have a junit test that transitively depends on ~90 java files. This causes pants to generate a java command to run that test file which is too long, since each compiled jar is listed 3 times.

I was able to modify the __run.sh script to use directory globs instead, but I'm not sure if that's a reasonable solution for pants (line wrapping added for readability):

#!/usr/bin/env bash
# This command line should execute the same process as pants did internally.
cd /tmp/pants-sandbox-acB2Fk
env -i \
COURSIER_ARCHIVE_CACHE=.cache/arc \
COURSIER_CACHE=.cache/5ca0e91bb431137f03c7a4f22d8308c85710964f80926a14e1c040e696573039/jdk \
COURSIER_JVM_CACHE=.cache/v1 \
PANTS_INTERNAL_ABSOLUTE_PREFIX= \
/usr/bin/bash __jdk/jdk.sh __java_home/bin/java \
  -cp $'__jdk/*:*:__toolcp/*' \
  -Xmx512m \
  org.junit.platform.console.ConsoleLauncher \
  --classpath $'*' \
  --scan-class-path $'*' \
  --reports-dir \
  __reports_dir/src.testFixtures.java.com.my.test.TestFile.java.tests

Pants version
2.17.0

OS
Linux

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions