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

Ledger-API-Test-Tool doesn't work outside the bazel environment #1841

Closed
gerolf-da opened this issue Jun 24, 2019 · 0 comments

Comments

Projects
None yet
1 participant
@gerolf-da
Copy link
Contributor

commented Jun 24, 2019

We use Bazel's Runfiles class to fix paths during test execution via Bazel. Unfortunately this breaks running tests outside the Bazel environment in the standalone ledger-api-test-tool.

The error presented to the user is the following:

$ java -jar ledger-api-test-tool.jar -h localhost -p 6865
Exception in thread "main" java.lang.ExceptionInInitializerError
        at com.daml.ledger.api.testtool.LedgerApiTestTool$.main(LedgerApiTestTool.scala:39)
        at com.daml.ledger.api.testtool.LedgerApiTestTool.main(LedgerApiTestTool.scala)
Caused by: java.io.IOException: Cannot find runfiles: $RUNFILES_DIR and $JAVA_RUNFILES are both unset or empty
        at com.google.devtools.build.runfiles.Runfiles.getRunfilesDir(Runfiles.java:180)
        at com.google.devtools.build.runfiles.Runfiles.create(Runfiles.java:114)
        at com.google.devtools.build.runfiles.Runfiles.create(Runfiles.java:79)
        at com.digitalasset.daml.bazeltools.BazelRunfiles.rlocation(BazelRunfiles.scala:12)
        at com.digitalasset.daml.bazeltools.BazelRunfiles.rlocation$(BazelRunfiles.scala:12)
        at com.digitalasset.daml.bazeltools.BazelRunfiles$.rlocation(BazelRunfiles.scala:16)
        at com.digitalasset.platform.PlatformApplications$Config$.<init>(PlatformApplications.scala:97)
        at com.digitalasset.platform.PlatformApplications$Config$.<clinit>(PlatformApplications.scala)
        ... 2 more

@gerolf-da gerolf-da self-assigned this Jun 24, 2019

gerolf-da added a commit that referenced this issue Jun 24, 2019

Only fix paths when running in a bazel environment.
Running the tests via the ledger-api-test-tool results in a nasty
runtime exception. This check only fixes paths if it detects a bazel
environment.

Fixes #1841

gerolf-da added a commit that referenced this issue Jun 24, 2019

Only fix paths when running in a bazel environment.
Running the tests via the ledger-api-test-tool results in a nasty
runtime exception. This check only fixes paths if it detects a bazel
environment.

Fixes #1841

gerolf-da added a commit that referenced this issue Jun 24, 2019

Only fix paths when running in a bazel environment.
Running the tests via the ledger-api-test-tool results in a nasty
runtime exception. This check only fixes paths if it detects a bazel
environment.

Fixes #1841

@mergify mergify bot closed this in #1842 Jun 24, 2019

mergify bot added a commit that referenced this issue Jun 24, 2019

Only fix paths when running in a bazel environment. (#1842)
Running the tests via the ledger-api-test-tool results in a nasty
runtime exception. This check only fixes paths if it detects a bazel
environment.

Fixes #1841
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.