Skip to content

Commit

Permalink
Merge pull request #49 from qchateau/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
qchateau authored Dec 22, 2020
2 parents 371da6c + 263dc5a commit a6f907b
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 9 deletions.
3 changes: 3 additions & 0 deletions ccb/update/auto.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ def get_error_category(error):
if "Package recipe with version" in error:
return "Bad recipe version"

if "Patch already applied" in error:
return "Patch already applied"

if method == "build":
if "Failed to apply patch" in error:
return "Patch does not apply"
Expand Down
37 changes: 29 additions & 8 deletions ccb/update/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
re.compile(r"^ERROR:\s*(.*)", re.M | re.S),
]

RE_ALREADY_PATCHED = re.compile(r"WARN:\s*(.*):\s*already patched", re.M)
RE_WARNING = re.compile(r"WARN:\s*(.*)", re.M)
RE_CREATE_ERRORS = [RE_WARNING]

RE_CMAKELISTS_VERSION = re.compile(
r"(cmake_minimum_required\s*\(\s*VERSION\s*)([0-9\.]+)(\s*\))", re.I
)
Expand Down Expand Up @@ -60,6 +64,17 @@ def get_test_details(output):
match = regex.search(output)
if match:
return match.group(1)

matches = list(RE_ALREADY_PATCHED.finditer(output))
if matches:
patches = {m.group(1) for m in matches}
return "Patch already applied:\n" + "\n".join(patches)

matches = list(RE_WARNING.finditer(output))
if matches:
warnings = [m.group(1) for m in matches]
return "Warnings during conan create:\n" + "\n".join(warnings)

return "no details"


Expand Down Expand Up @@ -164,17 +179,23 @@ async def test_recipe(recipe, version_str):
cwd=recipe.folder_path,
)
output, _ = await process.communicate()
output = output.decode()
code = await process.wait()
duration = time.time() - t0

if code != 0:
output = output.decode()
logger.info(output)
logger.error(
"%s: test failed in %s",
recipe.name,
format_duration(duration),
)
if code != 0:
logger.info(output)
logger.error(
"%s: test failed in %s",
recipe.name,
format_duration(duration),
)
return TestStatus(
success=False, duration=duration, error=get_test_details(output)
)

for regex in RE_CREATE_ERRORS:
if regex.search(output):
return TestStatus(
success=False, duration=duration, error=get_test_details(output)
)
Expand Down
3 changes: 2 additions & 1 deletion ccb/upstream_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ async def _clone_and_parse_git_repo(self):
env = os.environ.copy()
env["GIT_TERMINAL_PROMPT"] = "0"
await check_call(
["git", "clone", "-q", "-n", self.git_url, tmp], env=env
["git", "clone", "-q", "--filter=tree:0", "-n", self.git_url, tmp],
env=env,
)
logger.info("%s: parsing repository", self.recipe.name)
await self._parse_git_repo(tmp)
Expand Down

0 comments on commit a6f907b

Please sign in to comment.