-
Notifications
You must be signed in to change notification settings - Fork 4
Conversation
17a44d7
to
64d5f53
Compare
@roxell Looks like things are ready for review so I will have a look through this and add some comments shortly :) |
64d5f53
to
8dfdd75
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good to me - just added a few comments where I think there should be more documentation.
Path.mkdir(dirname, parents=True, exist_ok=True) | ||
chdir(dirname) | ||
download_attachments(TestRun(testrun)) | ||
chdir(sys.path[0]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume changing to sys.path[0]
means the script won't work properly if launched from a different directory (so it would only work correctly if the user launches from squad-client-utils). I think that's fine for this case, but it should probably be documented.
env_name = Environment(getid((TestRun(testrun).environment))).slug | ||
dirname = Path(f"{attachment_dir}/{env_name}_{str(TestRun(testrun).id)}") | ||
print(dirname) | ||
if "qemu-" in dirname.name: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be good to add a comment here to say why we only want "qemu-" - it will make it easier to understand the purpose of the script.
chdir(sys.path[0]) | ||
|
||
file = glob.glob(f"{dirname}/mmtests-*.tar.xz") | ||
with contextlib.closing(lzma.LZMAFile(file[0])) as xz: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be good to comment what is being extracted and why
|
||
file = glob.glob(f"{dirname}/output/*.json") | ||
file_write = file[0].replace("/output", "") | ||
with open(file[0], mode="r") as read_file: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a comment to say what this step does and its purpose (looks like it finds the json file - presumably there is only one of these since we are referencing file[0]
- and then it removes "/output" and sorts the json keys)
8bbb5dd
to
3cee2e0
Compare
This scripts helps with downloading all attachments from SQUAD for a given group, project and build_id. For now the attachments only works in tuxsuite/tuxrun. Signed-off-by: Anders Roxell <[email protected]>
3cee2e0
to
fbc4293
Compare
No description provided.