コード例 #1
0
testRunLogPath = os.path.join(output_dir, "test_output.log")
testRunErrPath = os.path.join(output_dir, "test_errors.log")

log('Starting system tests')
log('Searching for packages in ' + options.package_dir)
installer = get_installer(options.package_dir, options.doInstall)

# Install the found package
if options.doInstall:
    log("Installing package '%s'" % installer.mantidInstaller)
    try:
        installer.install()
        log("Using Python wrapper: %r" % installer.python_cmd)
        installer.no_uninstall = False
    except Exception as err:
        scriptfailure("Installing failed. " + str(err))
else:
    installer.no_uninstall = True

log("Running system tests. Log files are: '%s' and '%s'" % (testRunLogPath, testRunErrPath))
try:
    # There is a long-standing bug in argparse surrounding processing options starting with a dash.
    # See https://bugs.python.org/issue9334. The suggestion is to use the `=` as we do here but the
    # windows bat file used to start python then swallows these and the `=` is converted to a space
    # and this produces the error: argument -a/--exec-args: expected one argument from runSystemTests.
    # The workaround places a space in the --exec-args parameter that is then stripped off inside
    # runSystemTests.
    executor_args = installer.python_args
    if sys.platform == 'win32':
        executor_args = ' ' + executor_args
    run_test_cmd = '{} {} {}/runSystemTests.py --loglevel={} --executable="{}" --exec-args="{}"'.format(
コード例 #2
0
ファイル: InstallerTests.py プロジェクト: luzpaz/mantid
testRunLogPath = os.path.join(output_dir, "test_output.log")
testRunErrPath = os.path.join(output_dir, "test_errors.log")

log('Starting system tests')
log('Searching for packages in ' + options.package_dir)
installer = get_installer(options.package_dir, options.doInstall)

# Install the found package
if options.doInstall:
    log("Installing package '%s'" % installer.mantidInstaller)
    try:
        installer.install()
        log("Application path " + installer.mantidPlotPath)
        installer.no_uninstall = False
    except Exception as err:
        scriptfailure("Installing failed. " + str(err))
else:
    installer.no_uninstall = True

try:
    # Keep hold of the version that was run
    version = run(installer.mantidPlotPath + ' -v')
    version_tested = open(os.path.join(output_dir, 'version_tested.log'), 'w')
    if version and len(version) > 0:
        version_tested.write(version)
    version_tested.close()
except Exception as err:
    scriptfailure('Version test failed: ' + str(err), installer)

try:
    # Now get the revision number/git commit ID (remove the leading 'g' that isn't part of it)
コード例 #3
0
createScriptLog(parentDir + '/logs/TestScript.log')
testRunLogPath = parentDir + '/logs/testsRun.log'
testRunErrPath = parentDir + '/logs/testsRun.err'

log('Starting system tests')
installer = get_installer(doInstall)

# Install the found package
if doInstall:
    log("Installing package '%s'" % installer.mantidInstaller)
    try:
        installer.install()
        log("Application path " + installer.mantidPlotPath)
        installer.no_uninstall = False
    except Exception,err:
        scriptfailure("Installing failed. "+str(err))
else:
    installer.no_uninstall = True

# Ensure MANTIDPATH points at this directory so that 
# the correct properties file is loaded              
mantidPlotDir = os.path.dirname(installer.mantidPlotPath)
log('MantidPlot directory %s' % mantidPlotDir)
log('Pointing MANTIDPATH at MantidPlot directory %s' % mantidPlotDir)
os.environ["MANTIDPATH"] = mantidPlotDir

try:
    # Keep hold of the version that was run
    version = run(installer.mantidPlotPath + ' -v')
    version_tested = open('version_tested.log','w')
    if version and len(version) > 0:
コード例 #4
0
# installer = get_installer(options.package_dir, options.doInstall)
from conda_mantid_installer import CondaInstaller
installer = CondaInstaller(options.package_dir, options.doInstall)
# XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

# Install the found package
if options.doInstall:
    log("Installing package '%s'" % installer.mantidInstaller)
    try:
        installer.install()
        log("Application path " + installer.mantidPlotPath)
        installer.no_uninstall = False
    except Exception as err:
        import traceback
        tb = traceback.format_exc()
        scriptfailure("Installing failed. %s\n%s" % (err, tb))
else:
    installer.no_uninstall = True

# XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
# there is not mantidplot in conda mantid-framework
# comment the following out for now
"""
try:
    # Keep hold of the version that was run
    version = run(installer.mantidPlotPath + ' -v')
    version_tested = open(os.path.join(output_dir,'version_tested.log'),'w')
    if version and len(version) > 0:
        version_tested.write(version)
    version_tested.close()
except Exception as err: