Kaydet (Commit) 816e5063 authored tarafından Michael Stahl's avatar Michael Stahl

framework, unotest: do not override UserInstallation from environment

The PythonTest_dbaccess_python may fail in incremental builds because of
stale JVM path in workdir/unittest/user/config/javasettings_Linux_X86_64.xml
so it's better to use the fresh UserInstallation that is already passed
in from PythonTest.mk.  To make that work, tolerate non-existing path in
SubstitutePathVariables::SetPredefinedPathVariables() at least when
running in the build environment, which is probably better than
effectively running with "/" as UserInstallation anyway...

This partially reverts commit 6dbb6275.

Change-Id: I4d42d53c049056590662828360c4ce5a29af0f4b
üst deb9dd06
...@@ -1250,7 +1250,9 @@ void SubstitutePathVariables::SetPredefinedPathVariables() ...@@ -1250,7 +1250,9 @@ void SubstitutePathVariables::SetPredefinedPathVariables()
//TODO: Is that still the case? (With OOo 3.4, "unopkg sync" was run as part //TODO: Is that still the case? (With OOo 3.4, "unopkg sync" was run as part
// of the setup. Then no user installation was required.) // of the setup. Then no user installation was required.)
//Therefore we do not assert here. //Therefore we do not assert here.
if( aState == ::utl::Bootstrap::PATH_EXISTS ) { // It's not possible to detect when an empty value would actually be used.
// (note: getenv is a hack to detect if we're running in a unit test)
if (aState == ::utl::Bootstrap::PATH_EXISTS || getenv("SRC_ROOT")) {
m_aPreDefVars.m_FixedVar[ PREDEFVAR_USERPATH ] = ConvertOSLtoUCBURL( sVal ); m_aPreDefVars.m_FixedVar[ PREDEFVAR_USERPATH ] = ConvertOSLtoUCBURL( sVal );
} }
......
...@@ -174,15 +174,6 @@ class UnoInProcess: ...@@ -174,15 +174,6 @@ class UnoInProcess:
def getDoc(self): def getDoc(self):
return self.xDoc return self.xDoc
def setUp(self): def setUp(self):
# set UserInstallation to user profile dir in test/user-template:
path = os.getenv("WORKDIR")
if os.name == "nt":
# do not quote drive letter - it must be "X:"
url = "file:///" + path
else:
url = "file://" + quote(path)
os.putenv("UserInstallation", url + "/unittest")
self.xContext = pyuno.getComponentContext() self.xContext = pyuno.getComponentContext()
pyuno.private_initTestEnvironment() pyuno.private_initTestEnvironment()
def openEmptyWriterDoc(self): def openEmptyWriterDoc(self):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment