Skip to content

Pasuereplay feature - #401

Open
PraveenPenguin wants to merge 8 commits into
lop-devops:masterfrom
PraveenPenguin:pasuereplay
Open

Pasuereplay feature#401
PraveenPenguin wants to merge 8 commits into
lop-devops:masterfrom
PraveenPenguin:pasuereplay

Conversation

@PraveenPenguin

Copy link
Copy Markdown
Collaborator

No description provided.

Add optional resume_job_dir parameter to run_test() to support
resume mode. Defaults to None so all existing call sites are
unaffected.

Signed-off-by: Praveen K Pandey <praveen@linux.ibm.com>
Move the existing nrun/cmd build logic into an else branch to
prepare for resume_job_dir handling in the if branch.
No functional change to normal runs.

Signed-off-by: Praveen K Pandey <praveen@linux.ibm.com>
When resume_job_dir is set, extract the job ID from the job dir
name and invoke 'avocado replay <job_id>'. Modern avocado replay
re-runs only the not-passed tests from the prior job automatically,
works for both host and guest suites without extra flags.

Signed-off-by: Praveen K Pandey <praveen@linux.ibm.com>
Add --resume flag to argparse. When set the wrapper uses the
existing outputdir to scan prior job results and resume from
where the run was interrupted.

Usage:
  python avocado-setup.py --run-suite host_a,host_b,host_c --resume

Signed-off-by: Praveen K Pandey <praveen@linux.ibm.com>
On --resume, scan all job-* subdirs in outputdir and build
suite_job_map mapping suite_name to its prior job dir path.

Host suites matched by test file basename in avocado test IDs.
Guest suites matched by suite shortname in VT test IDs.
Job dirs with no/unreadable results.json stored as __interrupted__
fallback (system crashed before results were written).

Signed-off-by: Praveen K Pandey <praveen@linux.ibm.com>
_suite_completed: returns True when a suite has a prior job dir
with a clean results.json (total > 0, interrupt == 0).

_suite_replay_dir: returns the prior job dir to replay for a suite,
or None when the suite never ran (no job dir) so it runs fresh.

Signed-off-by: Praveen K Pandey <praveen@linux.ibm.com>
On --resume, for each suite in order:
  - completed (clean results.json)  -> skip with logged message
  - interrupted (no/partial results) -> avocado replay <job_id>
  - never ran (no job dir at all)   -> normal fresh run

Suites that never ran (e.g. system rebooted before they started)
receive None from _suite_replay_dir and run fully fresh.

Signed-off-by: Praveen K Pandey <praveen@linux.ibm.com>
Add --resume to the script help output block and add a new
argument details entry (item 20) explaining:
- What --resume does (scans results dir, classifies suites)
- The three states: completed/skip, interrupted/replay, never ran/fresh
- Usage examples with and without --output-dir
- Note that --run-suite must match the original run
- Works for both host and guest test suites

Signed-off-by: Praveen K Pandey <praveen@linux.ibm.com>
@PraveenPenguin

Copy link
Copy Markdown
Collaborator Author

log :

~/tests # python avocado-setup.py --run-suite host_rasci,host_io_vnic_fvt --resume
05:05:28 INFO    : Env Config: /root/tests/config/wrapper/env.conf
05:05:28 INFO    : No Run Config: /root/tests/config/wrapper/no_run_tests.conf
05:05:29 INFO    : Check for environment
05:05:36 INFO    : RESUME: suite to job dir map from /root/tests/results: {'__interrupted__': '/root/tests/results/job-2026-07-28T04.29-07add70', 'host_rasci_diag_encl': '/root/tests/results/job-2026-07-28T04.35-320bdf4', 'host_rasci_packages': '/root/tests/results/job-2026-07-28T04.41-536b585'}
05:05:36 INFO    : RESUME: skipping 'host_rasci_diag_encl' (completed in prior run)
05:05:36 INFO    : RESUME: skipping 'host_rasci_packages' (completed in prior run)
05:05:36 INFO    : 
05:05:36 INFO    : Running Host Tests Suite io_vnic_fvt_network_virtualization_NetworkVirtualization_test_add_network_virtualization
05:05:36 INFO    : Running: /usr/local/bin/avocado run --max-parallel-tasks=1 /root/tests/tests/avocado-misc-tests/io/net/virt-net/network_virtualization.py:NetworkVirtualization.test_add$ -m /root/tests/tests/avocado-misc-tests/io/net/virt-net/network_virtualization.py.data/network_virtualization.yaml --force-job-id 356c0aa6addcc189f1abb67d1de93ed131bb3b74                      --job-results-dir /root/tests/results  
/usr/local/lib/python3.13/site-packages/avocado/core/__init__.py:18: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
  import pkg_resources
JOB ID     : 356c0aa6addcc189f1abb67d1de93ed131bb3b74
JOB LOG    : /root/tests/results/job-2026-07-28T05.05-356c0aa/job.log
 (1/1) /root/tests/tests/avocado-misc-tests/io/net/virt-net/network_virtualization.py:NetworkVirtualization.test_add;run-rx_channel-tx_channel-3244: STARTED
^C (1/1) /root/tests/tests/avocado-misc-tests/io/net/virt-net/network_virtualization.py:NetworkVirtualization.test_add;run-rx_channel-tx_channel-3244: INTERRUPTED: Test interrupted: Interrupted by user (7.03 s)

RESULTS    : PASS 0 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 1 | CANCEL 0
JOB HTML   : /root/tests/results/job-2026-07-28T05.05-356c0aa/results.html
JOB TIME   : 17.18 s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant