fix: Improve diff and taxonomy YAML logging#756
fix: Improve diff and taxonomy YAML logging#756anik120 merged 14 commits intoinstructlab:maininstructlab/instructlab:mainfrom rafvasq:improve-diffCopy head branch name to clipboard
Conversation
Signed-off-by: Rafael Vasquez <rafvasq21@gmail.com>
Signed-off-by: Rafael Vasquez <rafvasq21@gmail.com>
Signed-off-by: Rafael Vasquez <rafvasq21@gmail.com>
Signed-off-by: Rafael Vasquez <rafvasq21@gmail.com>
Signed-off-by: Rafael Vasquez <rafvasq21@gmail.com>
Signed-off-by: Rafael Vasquez <rafvasq21@gmail.com>
| # Third Party | ||
| import git | ||
|
|
||
| TEST_VALID_YAML = """created_by: rafael-vasquez |
There was a problem hiding this comment.
I'm not sure this change is necessary, can you explain the motivation?
There was a problem hiding this comment.
I experienced an exception somewhere when running tests where lab diff would complete but with code 1. It was hidden, but I traced an exception coming from read_taxonomy_file around here because the taxonomy file doesn't have those headers to parse. Hopefully I didn't miss something, but passing a valid YAML fixed the return code (and I figured is better than using an arbitrary string).
There was a problem hiding this comment.
Makes sense! Though the contents of that YAML imply it's actually invalid so maybe we could update that?
@aesteve-rh I believe you originally wrote this case so appreciate your feedback here as well
There was a problem hiding this comment.
Sorry, I was on PTO so didn't see this on time.
Yes, makes sense to me too :) Thanks @rafvasq for the update!
Signed-off-by: Rafael Vasquez <rafvasq21@gmail.com>
Signed-off-by: Rafael Vasquez <rafvasq21@gmail.com>
Signed-off-by: Rafael Vasquez <rafvasq21@gmail.com>
Signed-off-by: Rafael Vasquez <rafvasq21@gmail.com>
Signed-off-by: Rafael Vasquez <rafvasq21@gmail.com>
Signed-off-by: Rafael Vasquez <rafvasq21@gmail.com>
| ], | ||
| ) | ||
| self.assertIn(f"Taxonomy in {self.taxonomy.root} is valid :)", result.output) | ||
| self.assertIn("", result.output) |
There was a problem hiding this comment.
This is always evaluated as True, isn't it?
Shouldn't it be assertEquals?
There was a problem hiding this comment.
That's right, and it's being addressed in #776
Resolves #732
cc. @anik120 @nathan-weinberg
Description of your changes:
difftestslab listandlab checkwith newlab diffcommandlab diff --quiet, supplying exit codes without any logginglab diffnow prints list of modified YAMLs and validates them, throwing exception if not validyaml_rulestoNoneto avoid aFileNotFoundexception if user doesn't supply a custom yaml config