<feed xmlns='http://www.w3.org/2005/Atom'>
<title>vyos-cloud-init.git/cloudinit/tests/test_persistence.py, branch rolling</title>
<subtitle> (mirror of https://github.com/vyos/vyos-cloud-init.git)
</subtitle>
<id>https://git.amelek.net/vyos/vyos-cloud-init.git/atom?h=rolling</id>
<link rel='self' href='https://git.amelek.net/vyos/vyos-cloud-init.git/atom?h=rolling'/>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/'/>
<updated>2021-12-03T20:11:46+00:00</updated>
<entry>
<title>Reorganize unit test locations under tests/unittests (#1126)</title>
<updated>2021-12-03T20:11:46+00:00</updated>
<author>
<name>Brett Holman</name>
<email>bholman.devel@gmail.com</email>
</author>
<published>2021-12-03T20:11:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=039c40f9b3d88ee8158604bb18ca4bf2fb5d5e51'/>
<id>urn:sha1:039c40f9b3d88ee8158604bb18ca4bf2fb5d5e51</id>
<content type='text'>
This attempts to standardize unit test file location under test/unittests/
such that any source file located at cloudinit/path/to/file.py may have a
corresponding unit test file at test/unittests/path/to/test_file.py.

Noteworthy Comments:
====================
Four different duplicate test files existed:
test_{gpg,util,cc_mounts,cc_resolv_conf}.py
Each of these duplicate file pairs has been merged together. This is a
break in git history for these files.

The test suite appears to have a dependency on test order. Changing test
order causes some tests to fail. This should be rectified, but for now
some tests have been modified in
tests/unittests/config/test_set_passwords.py.

A helper class name starts with "Test" which causes pytest to try
executing it as a test case, which then throws warnings "due to Class
having __init__()".  Silence by changing the name of the class.

# helpers.py is imported in many test files, import paths change
cloudinit/tests/helpers.py -&gt; tests/unittests/helpers.py

# Move directories:
cloudinit/distros/tests -&gt; tests/unittests/distros
cloudinit/cmd/devel/tests -&gt; tests/unittests/cmd/devel
cloudinit/cmd/tests -&gt; tests/unittests/cmd/
cloudinit/sources/helpers/tests -&gt; tests/unittests/sources/helpers
cloudinit/sources/tests -&gt; tests/unittests/sources
cloudinit/net/tests -&gt; tests/unittests/net
cloudinit/config/tests -&gt; tests/unittests/config
cloudinit/analyze/tests/ -&gt; tests/unittests/analyze/

# Standardize tests already in tests/unittests/
test_datasource -&gt; sources
test_distros -&gt; distros
test_vmware -&gt; sources/vmware
test_handler -&gt; config        # this contains cloudconfig module tests
test_runs -&gt; runs</content>
</entry>
<entry>
<title>test_persistence: simplify VersionIsPoppedFromState (#674)</title>
<updated>2020-11-18T16:11:58+00:00</updated>
<author>
<name>Daniel Watkins</name>
<email>oddbloke@ubuntu.com</email>
</author>
<published>2020-11-18T16:11:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=96d21dfbee308cd8fe00809184f78da9231ece4a'/>
<id>urn:sha1:96d21dfbee308cd8fe00809184f78da9231ece4a</id>
<content type='text'>
</content>
</entry>
<entry>
<title>test_persistence: add VersionIsPoppedFromState test (#673)</title>
<updated>2020-11-17T21:55:55+00:00</updated>
<author>
<name>Daniel Watkins</name>
<email>oddbloke@ubuntu.com</email>
</author>
<published>2020-11-17T21:55:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=e1bde919923ff1f9d1d197f64ea43b976f034062'/>
<id>urn:sha1:e1bde919923ff1f9d1d197f64ea43b976f034062</id>
<content type='text'>
</content>
</entry>
<entry>
<title>introduce an upgrade framework and related testing (#659)</title>
<updated>2020-11-17T21:37:29+00:00</updated>
<author>
<name>Daniel Watkins</name>
<email>oddbloke@ubuntu.com</email>
</author>
<published>2020-11-17T21:37:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.amelek.net/vyos/vyos-cloud-init.git/commit/?id=4f2da1cc1d24cbc47025cc8613c0d3ec287a20f9'/>
<id>urn:sha1:4f2da1cc1d24cbc47025cc8613c0d3ec287a20f9</id>
<content type='text'>
This commit does the following:

* introduces the `cloudinit.persistence` module, containing
  `CloudInitPickleMixin` which provides lightweight versioning of
  objects' pickled representations (and associated testing)
* introduces a basic upgrade testing framework (in
  `cloudinit.tests.test_upgrade`) which unpickles pickles from previous
  versions of cloud-init (stored in `tests/data/old_pickles`) and tests
  invariants that the current cloud-init codebase expects
* uses the versioning framework to address an upgrade issue where
  `Distro.networking` could get into an unexpected state, and uses the
  upgrade testing framework to confirm that the issue is addressed</content>
</entry>
</feed>
