|
24 | 24 | - name: Set the pathname of the local results directory |
25 | 25 | tags: vars |
26 | 26 | ansible.builtin.set_fact: |
27 | | - gitr_results_dir: "../workflows/gitr/results/{{ ansible_kernel }}/{{ gitr_test_group }}/" |
| 27 | + gitr_results_full_path: "{{ topdir_path }}/workflows/gitr/results" |
| 28 | + gitr_results_target: "../workflows/gitr/results/last-run" |
28 | 29 | gitr_run_uniqifier: "{{ ansible_date_time.iso8601_basic_short }}" |
29 | 30 |
|
| 31 | +- name: Clean up our localhost results/last-run directory |
| 32 | + local_action: file path="{{ gitr_results_target }}/" state=absent |
| 33 | + run_once: true |
| 34 | + tags: [ 'run_tests', 'copy_results', 'clean_local_results' ] |
| 35 | + |
| 36 | +- name: Create empty last-run directory |
| 37 | + local_action: file path="{{ gitr_results_target }}/" state=directory |
| 38 | + run_once: true |
| 39 | + tags: [ 'run_tests', 'copy_results', 'clean_local_results' ] |
| 40 | + |
| 41 | +- name: Get used target kernel version |
| 42 | + tags: [ 'copy_results' ] |
| 43 | + command: "uname -r" |
| 44 | + register: uname_cmd |
| 45 | + |
| 46 | +- name: Store last kernel variable |
| 47 | + tags: [ 'copy_results' ] |
| 48 | + set_fact: |
| 49 | + last_kernel: "{{ uname_cmd.stdout_lines | regex_replace('\\]') | regex_replace('\\[') | replace(\"'\",'') }}" |
| 50 | + run_once: true |
| 51 | + |
| 52 | +- name: Document used target kernel version |
| 53 | + local_action: "shell echo {{ last_kernel }} > {{ gitr_results_target }}/../last-kernel.txt" |
| 54 | + tags: [ 'run_tests', 'copy_results', 'print_results' ] |
| 55 | + run_once: true |
| 56 | + |
30 | 57 | - name: Ensure the local results directory exists |
31 | 58 | tags: copy_results |
32 | 59 | ansible.builtin.file: |
33 | | - path: "{{ gitr_results_dir }}" |
| 60 | + path: "{{ gitr_results_full_path }}/last-run/{{ last_kernel }}/{{ gitr_test_group }}" |
34 | 61 | state: directory |
35 | 62 | mode: "u=rwx,g=rx,o=rx" |
36 | 63 | delegate_to: localhost |
37 | | - run_once: true |
38 | 64 |
|
39 | 65 | - name: Install dependencies for the git regression tests |
40 | 66 | tags: gitr |
|
303 | 329 | tags: copy_results |
304 | 330 | ansible.builtin.fetch: |
305 | 331 | src: "/tmp/{{ gitr_run_uniqifier }}.tgz" |
306 | | - dest: "{{ gitr_results_dir }}" |
| 332 | + dest: "{{ gitr_results_full_path }}/last-run/{{ last_kernel }}/{{ gitr_test_group }}/" |
307 | 333 | flat: true |
308 | 334 | validate_checksum: true |
309 | 335 |
|
310 | 336 | - name: Copy summary results to the control node |
311 | 337 | tags: copy_results |
312 | 338 | ansible.builtin.fetch: |
313 | 339 | src: "{{ gitr_mnt }}/{{ gitr_run_uniqifier }}.summary" |
314 | | - dest: "{{ gitr_results_dir }}" |
| 340 | + dest: "{{ gitr_results_full_path }}/last-run/{{ last_kernel }}/{{ gitr_test_group }}/" |
315 | 341 | flat: true |
316 | 342 | validate_checksum: false |
317 | 343 |
|
318 | 344 | - name: Copy stderr to the control node |
319 | 345 | tags: copy_results |
320 | 346 | ansible.builtin.fetch: |
321 | 347 | src: "{{ gitr_mnt }}/{{ gitr_run_uniqifier }}.stderr" |
322 | | - dest: "{{ gitr_results_dir }}" |
| 348 | + dest: "{{ gitr_results_full_path }}/last-run/{{ last_kernel }}/{{ gitr_test_group }}/" |
323 | 349 | flat: true |
324 | 350 | validate_checksum: false |
325 | 351 | when: gitr_results.rc != 0 |
|
328 | 354 | tags: copy_results |
329 | 355 | ansible.builtin.fetch: |
330 | 356 | src: "{{ gitr_mnt }}/{{ gitr_run_uniqifier }}.rpc" |
331 | | - dest: "{{ gitr_results_dir }}" |
| 357 | + dest: "{{ gitr_results_full_path }}/last-run/{{ last_kernel }}/{{ gitr_test_group }}/" |
332 | 358 | flat: true |
333 | 359 | validate_checksum: false |
334 | 360 | when: |
|
339 | 365 | tags: copy_results |
340 | 366 | ansible.builtin.fetch: |
341 | 367 | src: "{{ gitr_mnt }}/{{ gitr_run_uniqifier }}.xprt" |
342 | | - dest: "{{ gitr_results_dir }}" |
| 368 | + dest: "{{ gitr_results_full_path }}/last-run/{{ last_kernel }}/{{ gitr_test_group }}/" |
343 | 369 | flat: true |
344 | 370 | validate_checksum: false |
345 | 371 | when: |
346 | 372 | - gitr_fstype == "nfs" |
347 | 373 | - ansible_os_family == 'RedHat' |
| 374 | + |
| 375 | +- name: Verify last-run kernel directory exists |
| 376 | + tags: [ 'copy_results' ] |
| 377 | + delegate_to: localhost |
| 378 | + stat: |
| 379 | + path: "{{ gitr_results_full_path }}/last-run/{{ last_kernel }}" |
| 380 | + register: last_run_kernel_dir |
| 381 | + |
| 382 | +- name: Copy over the last-run into the results directory for archiving into kdevops |
| 383 | + copy: |
| 384 | + src: "{{ gitr_results_full_path }}/last-run/{{ last_kernel }}" |
| 385 | + dest: "{{ gitr_results_full_path }}/" |
| 386 | + run_once: true |
| 387 | + tags: [ 'copy_results' ] |
| 388 | + delegate_to: localhost |
| 389 | + when: |
| 390 | + - last_run_kernel_dir.stat.exists |
0 commit comments