Running unit tests on the mac fails because PATH is different from Terminal PATH
Bug #591085 reported by
Archimedes Trajano
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Java library for Bazaar |
New
|
Undecided
|
Unassigned |
Bug Description
Running unit tests on Eclipse on the mac fails because PATH is different from the Terminal PATH. Is there a better way of calculating the PATH? Should we put in a copy of bzr itself as part of the test resources and execute it if Python is available? (kinda yucky)
Can it be executed in Jython?
Somehow call terminal and get the PATH from there? like bash -c 'which bzr'
Related branches
lp:~trajano/bzr-java-lib/mac-eclipse
Ready for review
for merging
into
lp:~verterok/bzr-java-lib/bzr-java-lib
- Guillermo Gonzalez: Pending requested
-
Diff: 550 lines (+193/-48)10 files modifiedsrc/main/java/org/vcs/bazaar/client/BazaarClient.java (+33/-10)
src/main/java/org/vcs/bazaar/client/BazaarClientPreferences.java (+32/-15)
src/main/java/org/vcs/bazaar/client/commandline/CommandLineClient.java (+19/-6)
src/main/java/org/vcs/bazaar/client/commandline/CommandLineClientFactory.java (+11/-6)
src/main/java/org/vcs/bazaar/client/utils/BazaarUtilities.java (+25/-1)
src/main/java/org/vcs/bazaar/client/xmlrpc/XmlRpcClient.java (+4/-1)
src/main/java/org/vcs/bazaar/client/xmlrpc/internal/XMLRPCCommandRunner.java (+25/-8)
src/test/java/org/vcs/bazaar/client/BazaarClientTest.java (+1/-0)
src/test/java/org/vcs/bazaar/client/ProcessSanityTest.java (+40/-0)
src/test/java/org/vcs/bazaar/client/commandline/commands/PluginsTest.java (+3/-1)
To post a comment you must log in.
The implementation I did was pretty yucky but it seems to move the thing forward so now it will find the executable on the Mac.
final Process whichProcess = Runtime. getRuntime( ).exec( getenv( "SHELL" ), "-lc", "which bzr" }); s.getInputStrea m()));
new String[] { System.
final BufferedReader reader = new BufferedReader(new InputStreamReader(
whichProces
final String pathLine = reader.readLine();