Merge ~wesley-wiedenmeier/cloud-init:integration-testing-invocation-cleanup into cloud-init:master
| Status: | Merged |
|---|---|
| Merged at revision: | 76d58265e34851b78e952a7f275340863c90a9f5 |
| Proposed branch: | ~wesley-wiedenmeier/cloud-init:integration-testing-invocation-cleanup |
| Merge into: | cloud-init:master |
| Diff against target: |
600 lines (+349/-36) 8 files modified
doc/rtd/topics/tests.rst (+67/-8) tests/cloud_tests/__init__.py (+1/-0) tests/cloud_tests/__main__.py (+5/-26) tests/cloud_tests/args.py (+53/-1) tests/cloud_tests/bddeb.py (+124/-0) tests/cloud_tests/instances/base.py (+1/-1) tests/cloud_tests/run_funcs.py (+65/-0) tests/cloud_tests/util.py (+33/-0) |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Server Team CI bot | continuous-integration | Approve on 2017-03-19 | |
| Joshua Powers (community) | Approve on 2017-01-12 | ||
| cloud-init commiters | 2017-01-11 | Pending | |
|
Review via email:
|
|||
Description of the Change
Integration Testing: provide commands to run tests from current tree
- Add 'bddeb' command to build a deb from the current working tree
cleanly in a container, so deps don't have to be installed on host
- Add 'tree_collect' and 'tree_run' commands, to build deb from
current working tree and call collect or run with deb
- Fix bug in instance.
Thanks for reviewing
> 1) Had to increase the timeout as 120 seconds was not enough. I bumped to 600.
I'll go ahead and increase the timout a bit, or possibly add the option for the call to snapshot.launch() in bddeb to specify a longer timeout that normal, since the bddeb instance should be expected to take longer to boot than other instances. It would also work to not use cloud-init to install devscripts, and just apt-get it during the build process, that may be cleaner, and would allow finer grained logging messages.
> 2) the tox target "cittest_run" actually does a "tree_run" In order to not be
> confused between run versus tree_run I think this should really be
> "cittest_tree_run"
Good point, citest_run = tree_run may be confusing, I'll get the name switched over.
> lxc list was clean afterwards as expected. I believe I only missed a ppa test.
I think that is plenty of testing as the changes shouldn't have affected anything other than bddeb and adding the new commands. I'll run through with --ppa once to be sure though.
> The only warning message I got other than those for pylxd's 2.2 deprecation
> was:
> /home/powersj/
> DeprecationWarning: The 'warn' method is deprecated, use 'warning' instead
I always forget whether its LOG.warn or LOG.warning that is depricated, got it wrong here, good catch. I'll fix here and grep through to check if its wrong anywhere else.
I should have all of that done at some point tonight, should be ready for merge tomorrow
Timeouts will no longer be an issue for bddeb as dep installation is now handled after boot. I think this should be ready to merge, I've tested again with tree_collect, tree_run, and just with a normal 'run --ppa'
| Joshua Powers (powersj) wrote : | # |
LGTM
Thanks for the changes! Ran the following successfully with no changes to timeouts:
$ tox
$ tox -e citest_tree_run
$ tox -e citest -- tree_run -n zesty -t tests/cloud_
$ python3 -m tests.cloud_tests tree_run -v -n zesty -t tests/cloud_
This merge proposal is no longer required, as everything here is included in the main one at:
https:/
Since there is additional work that can be done to improve the build system, this branch and this merge proposal will be used for development. Below is some of the discussion on bddeb for reference.
> >> * creating the tarball..
> >> I think what we want to do here is:
> >> a.) make-tarball on "this side"
> >> b.) modify bddeb to be able to just create a debian/ dir
> >> either
> >> i.) have it create the orig tarball and a debian.tar.gz
> >> into a provided (empty) output dir.
> >> ii.) have it just create the debian.tar.gz and we create
> >> the tarball example of doing that
> >> http://
> >> c.) move the tarball and debian dir over, extract tarball,
> >> extract debian/
> >> d.) mk-build-deps --install .... debian/control
> >> e.) dpkg-buildpackage
> >>
> >> doing this should mean we do not have to 'install additional
> >> build deps' but rather just have mk-build-deps do the right
> >> thing.
>
> >I had been trying to avoid modifying anything outside cloud_tests,
> >but adding the --debian-tar-only option in bddeb definitely does
> >simplify this. This may be a useful feature in general for debugging
> >cloud-init builds that do not work or doing custom deb builds, as
> >going through the template system can be inconvenient.
>
> >This also avoids having to go through a source repo in case the
> >current version of cloud-init in tree has different deps from the
> >one in the source repo.
>
> > Using dpkg-buildpackage instead of debuild may be quicker too.
>
> Yeah, it makes the build much simpler in the container. I'm tempted
> to further improve bddeb to list what packages need installing even,
> then we could drop the mk-build-deps and equivs ... but that is not
> necessary now. The complexity in that comes really from the obnoxious
> 'python3-pyflakes | pyflakes (<< 1.1.0-2)'
>
> in package/
Yeah, I kinda like the idea of bddeb to handle build deps entirely. That may
make things simpler for users who want to build as well since there have been
lots of questions on irc about how to build packages. We should probably add
more documentation on cloud-inits build system at some point as well.
> >> * when building with dpkg-buildpackage or debuild, good to
> >> allow setting DEB_BUILD_
> >> nosetests)
>
> >Nice, I didn't know that was an option. Lets us avoid the additional
> >build deps step easily, since that was mostly to avoid failing because
> >testing stuff wasn't there.
>
> There is info at https:/
> on what the plan here is... ultimately, package build wont run pep8, but
> would still run nosetests and useful to be able to not run them.
I do like the idea of dropping pep8 in the build, since the actual source used
for the builds whill have already been checked.
> >> * i think the above path means we do not depend on deb-src lines.
>
> >The switch back to ubuntu daily will handle that, but this also
> >avoids going through source repo at all which can be nice if a local
> >change adds a new build dep.
>
> And simply use of mk-build-deps would too..
> I know i'm kind of over-doing this, but i really lik...
This branch should mostly be ready to merge in now. There is additonal work to be done on getting the cc_apt_configure issue resolved in debian jessie, and the hostnamectl issue resolved on centos70, but that can wait, as these are most likely not issues caused by the test suite. Support for package management on centos still needs to be switched to dnf, but since centos is blocked on the hostnamectl issue, that can wait as well.
The cleanup to system_
This branch is not yet ready to merge. The above comment was meant for the main merge proposal at https:/
The build system and the bddeb functionality for cloud-tests can be improved further.
This branch should be ready to merge into trunk now. There were some additional improvements to the build system that had been discussed, but it may be best to work on those later. If the build system is improved in the future, then this code can easily be updated as well.
The tree_run command that this branch provides is useful enough on its own that this is worth merging in on its own, although this is a lower priority than either the main integration-testing update or the distro feature flags branch that is being worked on right now.
PASSED: Continuous integration, rev:ac847078d33
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild:
https:/
PASSED: Continuous integration, rev:e63726f671a
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild:
https:/
- 51fa870... by Wesley Wiedenmeier on 2017-03-19
PASSED: Continuous integration, rev:51fa870b721
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild:
https:/
| Scott Moser (smoser) wrote : | # |
I'm going to mark this 'work in progress'. Josh has integrated this branch and others into his merge proposal at https:/
Thanks for your work, Wesley!
| Scott Moser (smoser) wrote : | # |
Hi.
I've marked this 'merged' as I think it is now in trunk under 76d58265e34851b
If you disagree, please feel free to re-open.


LGTM with two comments:
1) Had to increase the timeout as 120 seconds was not enough. I bumped to 600.
2) the tox target "cittest_run" actually does a "tree_run" In order to not be confused between run versus tree_run I think this should really be "cittest_tree_run"
Tested by running the following on my local system with pylxd 2.1.3:
# lint archive. ubuntu. com/ubuntu/ yakkety main' 0.7.9-0ubuntu1_ all.deb tests/configs/ modules/ write_files. yaml tests/configs/ modules/ timezone. yaml
$ tox
# runs with options
$ python3 -m tests.cloud_tests run -v -n trusty
$ python3 -m tests.cloud_tests run -v -n xenial
$ python3 -m tests.cloud_tests run -v -n yakkety --repo 'deb http://
$ python3 -m tests.cloud_tests run -v -n xenial --deb cloud-init_
# new tox based runs + tree_run
$ tox -e citest_run
$ tox -e citest -- tree_run -n zesty -t tests/cloud_
$ python3 -m tests.cloud_tests tree_run -v -n zesty -t tests/cloud_
lxc list was clean afterwards as expected. I believe I only missed a ppa test.
The only warning message I got other than those for pylxd's 2.2 deprecation was: Work/repos/ cloud-init- wesley/ tests/cloud_ tests/collect. py:48: DeprecationWarning: The 'warn' method is deprecated, use 'warning' instead
/home/powersj/