ACK/CMNTS: [autotest][PATCH] UBUNTU: SAUCE: fix missing setup on second run
sean.feole at canonical.com
Thu Jun 3 13:42:23 UTC 2021
This will not have any negative affect on the way SRU testing operates.
I agree that it is annoying setup() will only get run once, unless you
iterate the version +=1. It's also not apparent to someone unless they
rummage through the autotest docs.
Unfortunately, not every test in our collection operate in the same
manner, there are some that do not use a setup() but that is neither
here nor there. I have also just modified the version if running through
any sort of triage in the past. This is because the intended use case
always runs once on a freshly deployed system.
This is good Krzysztof! Will def help for those working on test
+1 from me.
On 6/3/21 9:21 AM, Krzysztof Kozlowski wrote:
> The autotest had nice idea that test setup can be executed only once on
> a machine, till test version does not change. If version stays the
> same, autotest will not run test setup on next executions.
> However this requirement/feature was not defined clear enough and some
> 1. Perform cleanup() which reverts the setup() (e.g. ubuntu_boot).
> 2. Set runtime configuration (e.g. initialize object's field in Python
> __init__()) during setup() and read it on each test (e.g.
> All of these cases fail. Fix this by calling the test setup() every
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski at canonical.com>
> client/shared/utils.py | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
> diff --git a/client/shared/utils.py b/client/shared/utils.py
> index 3e8c9448d23e..367edcd04a03 100644
> --- a/client/shared/utils.py
> +++ b/client/shared/utils.py
> @@ -862,7 +862,11 @@ def update_version(srcdir, preserve_srcdir, new_version, install,
> shutil.copyfile(patch_src, patch_dst)
> - install(*args, **dargs)
> + # The test-specific setup is always needed because:
> + # - it could have been reverted with cleanup()
> + # - few broken tests might depend on setup() run always
> + install(*args, **dargs)
> + if install_needed:
> pickle.dump(new_version, open(versionfile, 'w'))
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the kernel-team