def test_get_all_packages(): """ Check that we get all the packages in the correct order and with correct inheritance """ json_test_file = os.path.join(os.path.dirname(__file__), 'testFiles/config_test.json') cfg = Conf.load(json_test_file) allPackages = cfg['allPackagesConfig'] # Most paths should be relative now ! assert len(allPackages) == 4 pkg1 = allPackages[0] assert pkg1['name'] == 'grp1_pkg1_name' assert pkg1['mockRoot'] == os.path.join(testDir, 'grp1_pkg1_mockRoot') pkg2 = allPackages[1] assert pkg2['name'] == 'grp1_pkg2_name' assert pkg2['mockRoot'] == os.path.join(testDir, 'grp1_mockRoot') pkg3 = allPackages[2] assert pkg3['name'] == 'grp2_pkg1_name' assert pkg3['mockRoot'] == os.path.join(testDir, 'grp2_pkg1_mockRoot') pkg4 = allPackages[3] assert pkg4['name'] == 'grp2_pkg2_name' assert pkg4['mockRoot'] == os.path.join(testDir, 'mockRoot')
def main(): jsonConf = sys.argv[1] cfg = Conf.load(jsonConf) allPackages = cfg['allPackagesConfig'] pprint.pprint(allPackages) for package in allPackages: diracoslib.buildPackage(package)
def test_resolve_requirement(cfgFile, pipReqExpected): """pipRequirement can be a url or a path If we have an URL, it should stay as is If it is a path, we want it to be resolved to absolute path """ cfg = Conf.load(cfgFile) requirementURL = cfg['pipRequirements'] assert requirementURL == pipReqExpected
def main(): jsonConf = sys.argv[1] pkgName = sys.argv[2] cfg = Conf.load(jsonConf) allPackages = cfg['allPackagesConfig'] #pprint.pprint(allPackages) for package in allPackages: if package.get('name') == pkgName: diracoslib.buildPackage(package)
def main(): jsonConf = sys.argv[1] cfg = Conf.load(jsonConf) allPackages = cfg['allPackagesConfig'] pprint.pprint(allPackages) totalPackages = len(allPackages) for packageId, package in enumerate(allPackages, 1): logging.info("Building %s (%s/%s)", package['name'], packageId, totalPackages) diracoslib.buildPackage(package)
def main(): logging.basicConfig(level=logging.DEBUG) jsonConf = sys.argv[1] cfg = Conf.load(jsonConf) #pprint.pprint(allPackages) mockInstallConfig = cfg['mockInstallConfig'] mockInstallRoot = cfg['mockInstallRoot'] pipRequirements = cfg['pipRequirements'] pipBuildDependencies = cfg['pipBuildDependencies'] diracoslib.buildPythonModules(mockInstallConfig, mockInstallRoot, pipRequirements, pipBuildDependencies)
def main(): logging.basicConfig(level=logging.DEBUG) jsonConf = sys.argv[1] cfg = Conf.load(jsonConf) mockInstallConfig = cfg['mockInstallConfig'] mockInstallRoot = cfg['mockInstallRoot'] pipRequirements = cfg['pipRequirements'] pipBuildDependencies = cfg['pipBuildDependencies'] fixedVersionFile = diracoslib.fixPipRequirementsVersions( mockInstallConfig, mockInstallRoot, pipRequirements, pipBuildDependencies) print "Fixed version file in %s" % fixedVersionFile
def main(): logging.basicConfig(level=logging.DEBUG) jsonConf = sys.argv[1] cfg = Conf.load(jsonConf) extensionName = cfg['extensionName'] diracOsVersion = cfg['diracOsVersion'] diracOsExtVersion = cfg['version'] pipRequirementFile = cfg['pipRequirements'] diracosExtTar = diracoslib.buildDiracOSExtension(extensionName, diracOsVersion, diracOsExtVersion, pipRequirementFile) print "Tar file %s" % diracosExtTar
def main(): logging.basicConfig(level=logging.DEBUG) jsonConf = sys.argv[1] cfg = Conf.load(jsonConf) mockInstallConfig = cfg.get('mockInstallConfig') mockInstallRoot = cfg.get('mockInstallRoot') pipRequirements = cfg['pipRequirements'] pipBuildDependencies = cfg.get('pipBuildDependencies') # No need to do it in mock if there are no build dependencies fixedVersionFile = diracoslib.fixPipRequirementsVersions( mockInstallConfig, mockInstallRoot, pipRequirements, pipBuildDependencies) print "Fixed version file in %s" % fixedVersionFile
def test_resolve_mockConfig(): """ mockConfig should resolved to an absolute path, except if it is a standard config""" json_test_file = os.path.join(os.path.dirname(__file__), 'testFiles/config_test.json') cfg = Conf.load(json_test_file) allPackages = cfg['allPackagesConfig'] # If the mockConfig is a '.cfg' path, it should be resolved to an absolute path pkg1 = allPackages[0] assert pkg1['mockConfig'] == os.path.join(testDir, 'grp1_pkg1_mockConfig.cfg') # If not, it should stay as it is pkg2 = allPackages[2] assert pkg2['mockConfig'] == 'grp2_pkg1_mockConfig'
def main(): jsonConf = sys.argv[1] cfg = Conf.load(jsonConf) diracoslib.bundleDIRACOS(cfg)
def main(): jsonConf = sys.argv[1] cfg = Conf.load(jsonConf) pprint.pprint(cfg)
""" Test the configuration of diracos""" import os from context import diracos from diracos import Conf json_test_file = os.path.join(os.path.dirname(__file__), 'config_test.json') cfg = Conf.load(json_test_file) # def test_global_config_objects(): # """ Checks that the configuration file is correctly read""" # # for attr in ['mockConfig', 'mockRoot', 'patchDir', 'repo']: # assert getattr(cfg, attr) == attr # # pkgGrp1 = cfg.packageGroups[0] # assert pkgGrp1.name == 'grp1' # for attr in ['mockConfig', 'mockRoot', 'patchDir', 'repo']: # assert getattr(pkgGrp1, attr) == 'grp1_%s'%attr # # grp1Pkg1 = pkgGrp1.packages[0] # for attr in ['name', 'routine', 'src', 'mockConfig', 'mockRoot', 'patchDir', 'patchFile', 'repo']: # assert getattr(grp1Pkg1, attr) == 'grp1_pkg1_%s'%attr # for attr in ['buildOnly', 'disablePatch']: # assert getattr(grp1Pkg1, attr) is True # # grp1Pkg2 = pkgGrp1.packages[1] # for attr in ['routine', 'mockConfig', 'mockRoot', 'patchDir', 'patchFile', 'repo']: # assert getattr(grp1Pkg2, attr) is None # for attr in ['name', 'src', ]: