diff options
Diffstat (limited to 'meta/lib/oeqa/utils/postactions.py')
| -rw-r--r-- | meta/lib/oeqa/utils/postactions.py | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/meta/lib/oeqa/utils/postactions.py b/meta/lib/oeqa/utils/postactions.py index 09c338ef68..7014b2830a 100644 --- a/meta/lib/oeqa/utils/postactions.py +++ b/meta/lib/oeqa/utils/postactions.py | |||
| @@ -9,6 +9,15 @@ | |||
| 9 | 9 | ||
| 10 | from oeqa.utils import get_json_result_dir | 10 | from oeqa.utils import get_json_result_dir |
| 11 | 11 | ||
| 12 | def create_artifacts_directory(d, tc): | ||
| 13 | import shutil | ||
| 14 | |||
| 15 | local_artifacts_dir = os.path.join(get_json_result_dir(d), "artifacts") | ||
| 16 | if os.path.isdir(local_artifacts_dir): | ||
| 17 | shutil.rmtree(local_artifacts_dir) | ||
| 18 | |||
| 19 | os.makedirs(local_artifacts_dir) | ||
| 20 | |||
| 12 | ################################################################## | 21 | ################################################################## |
| 13 | # Artifacts retrieval | 22 | # Artifacts retrieval |
| 14 | ################################################################## | 23 | ################################################################## |
| @@ -29,13 +38,7 @@ def get_artifacts_list(target, raw_list): | |||
| 29 | return result | 38 | return result |
| 30 | 39 | ||
| 31 | def retrieve_test_artifacts(target, artifacts_list, target_dir): | 40 | def retrieve_test_artifacts(target, artifacts_list, target_dir): |
| 32 | import shutil | ||
| 33 | |||
| 34 | local_artifacts_dir = os.path.join(target_dir, "artifacts") | 41 | local_artifacts_dir = os.path.join(target_dir, "artifacts") |
| 35 | if os.path.isdir(local_artifacts_dir): | ||
| 36 | shutil.rmtree(local_artifacts_dir) | ||
| 37 | |||
| 38 | os.makedirs(local_artifacts_dir) | ||
| 39 | for artifact_path in artifacts_list: | 42 | for artifact_path in artifacts_list: |
| 40 | if not os.path.isabs(artifact_path): | 43 | if not os.path.isabs(artifact_path): |
| 41 | bb.warn(f"{artifact_path} is not an absolute path") | 44 | bb.warn(f"{artifact_path} is not an absolute path") |
| @@ -61,6 +64,7 @@ def list_and_fetch_failed_tests_artifacts(d, tc): | |||
| 61 | 64 | ||
| 62 | def run_failed_tests_post_actions(d, tc): | 65 | def run_failed_tests_post_actions(d, tc): |
| 63 | post_actions=[ | 66 | post_actions=[ |
| 67 | create_artifacts_directory, | ||
| 64 | list_and_fetch_failed_tests_artifacts | 68 | list_and_fetch_failed_tests_artifacts |
| 65 | ] | 69 | ] |
| 66 | 70 | ||
