Ejemplo n.º 1
0
from StdCheckers import ValidJSON, ValidPythonEncoding, ValidPythonTabs
from StdCheckers import OnPath, MovePackage
from StdCheckers import PropertyChecker
from StdCheckers import tagsFilter
from Core import Failure, Rephrase

__all__ = ("notHasTags", "validTag", "movePackage", "librarian", "nightlyConf",
           "validPython", "uniquePackages")

# The transaction does not involve tags:
#   - AllPaths(Failure(), pattern) returns a failure is
notHasTags = NotContains(tagsFilter)

# Standard tag validation policy
validTag = AllPaths(
    TagRemoval() + TagIntermediateDirs() + ProjectTag() + PackageTag(),
    tagsFilter)

# Package move
movePackage = MovePackage()

# Check for the librarian account (used to give super user powers to it).
librarian = Rephrase(AllowedUsers(["liblhcb"]),
                     '(can be overridden by the librarian)')

# Run the XML and JSON checkers on the nightly build configuration.
nightlyConf = Rephrase(
    AllPaths(ValidXml(), r".*LHCbNightlyConf/trunk/configuration\.xml$") *
    AllPaths(ValidJSON(), r".*LHCbNightlyConf/trunk/.*\.json$"),
    "Error in Nightly Build configuration file.")
Ejemplo n.º 2
0
 def test_040_valid_py_encoding(self):
     checker = AllPaths(ValidPythonEncoding(), r".*\.py$")
     for txn, result in self.py_files_enc:
         self.assertCheckTxn(txn, checker, result)
Ejemplo n.º 3
0
 def test_041_valid_py_tabs(self):
     checker = AllPaths(ValidPythonTabs(), r".*\.py$")
     for txn, result in self.py_files_tab:
         self.assertCheckTxn(txn, checker, result)
Ejemplo n.º 4
0
 def test_040_valid_xml(self):
     checker = AllPaths(ValidXml(), r".*\.xml$")
     for txn, result in self.xml_files:
         self.assertCheckTxn(txn, checker, result)
Ejemplo n.º 5
0
 def test_030_tag_int_dirs(self):
     """tag intermediate dirs"""
     checker = AllPaths(TagIntermediateDirs(), ".*/tags/.*")
     for txn, result in self.tags_int_dirs:
         self.assertCheckTxn(txn, checker, result)
Ejemplo n.º 6
0
 def test_030_tag_removal(self):
     """tag removal"""
     checker = AllPaths(TagRemoval(), ".*/tags/.*")
     for txn, result in self.tags_removal:
         self.assertCheckTxn(txn, checker, result)
Ejemplo n.º 7
0
 def test_030_project_tag(self):
     """project tag validation"""
     checker = AllPaths(ProjectTag(), ".*/tags/.*")
     for txn, result in self.project_tags:
         self.assertCheckTxn(txn, checker, result)
Ejemplo n.º 8
0
 def test_030_package_tag(self):
     """package tag validation"""
     checker = AllPaths(PackageTag(), ".*/tags/.*")
     for txn, result in self.package_tags:
         self.assertCheckTxn(txn, checker, result)