Skip to content

integration_tests: add test for LP: #1898997#713

Merged
OddBloke merged 6 commits into
canonical:masterfrom
OddBloke:tests
Dec 9, 2020
Merged

integration_tests: add test for LP: #1898997#713
OddBloke merged 6 commits into
canonical:masterfrom
OddBloke:tests

Conversation

@OddBloke
Copy link
Copy Markdown
Collaborator

@OddBloke OddBloke commented Dec 7, 2020

Proposed Commit Message

integration_tests: add test for LP: #1898997

This introduces the `lxd_config_dict` mark, used to specify a
free-form configuration dict to LXD for tests which only run there; and
the `not_xenial` and `not_bionic` marks, used to skip tests on
xenial/bionic via a basic release skipping mechanism.

(The `lxd_config_dict` change further complicated `_client`, so a minor
refactoring is applied.)

Additional Context

This is WIP because it needs canonical/pycloudlib#66 to land for network config to LXD VMs to work.

Test Steps

Run CLOUD_INIT_PLATFORM=lxd_vm pytest --log-cli-level=INFO tests/integration_tests/bugs/test_lp1898997.py to see a failure.

Run CLOUD_INIT_PLATFORM=lxd_vm CLOUD_INIT_CLOUD_INIT_SOURCE=PROPOSED pytest --log-cli-level=INFO tests/integration_tests/bugs/test_lp1898997.py to see a pass.

Checklist:

  • My code follows the process laid out in the documentation
  • I have updated or added any unit tests accordingly
  • I have updated or added any documentation accordingly

@OddBloke OddBloke added the wip Work in progress, do not land label Dec 7, 2020
Comment thread tests/integration_tests/bugs/test_lp1898997.py
This mark allows tests to pass in free-form configuration to the LXD
instance being created.

TODO:
* Skip tests which specify this mark on non-LXD platforms.
@OddBloke OddBloke force-pushed the tests branch 2 times, most recently from ef60a24 to 313e660 Compare December 8, 2020 16:52
@OddBloke OddBloke changed the title WIP: integration_tests: add test for LP: #1898997 integration_tests: add test for LP: #1898997 Dec 8, 2020
@OddBloke
Copy link
Copy Markdown
Collaborator Author

OddBloke commented Dec 8, 2020

This is now ready for review; it still needs canonical/pycloudlib#66 to land before it can land (so I've left the wip tag) but I wouldn't anticipate any review changes to that PR would lead to changes here (because, essentially, this is exercising the existing pycloudlib API which was found to have an internal bug).

@OddBloke OddBloke removed the wip Work in progress, do not land label Dec 8, 2020
@OddBloke
Copy link
Copy Markdown
Collaborator Author

OddBloke commented Dec 8, 2020

This is now ready for review (and subsequent landing, once our Travis issues are sorted).

@OddBloke OddBloke closed this Dec 8, 2020
@OddBloke OddBloke reopened this Dec 8, 2020
Copy link
Copy Markdown
Contributor

@TheRealFalcon TheRealFalcon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor questions/nits, but nothing that should prevent merging. Thanks for all the LXD yak shaving!

Comment thread tests/integration_tests/conftest.py Outdated
Comment thread tox.ini
Comment thread tests/integration_tests/bugs/test_lp1898997.py
Copy link
Copy Markdown
Contributor

@TheRealFalcon TheRealFalcon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Jk...just remembered something. You should update the commit hash of pycloudlib to the latest commit in integration-requirements.txt. I also forgot to do that in my last PR.

@OddBloke
Copy link
Copy Markdown
Collaborator Author

OddBloke commented Dec 9, 2020

Jk...just remembered something. You should update the commit hash of pycloudlib to the latest commit in integration-requirements.txt. I also forgot to do that in my last PR.

Ooh, good catch. I wonder if we should update the test steps to instruct people to manually run the integration tests using tox; that would catch such issues, I think.

These will cause tests marked with them to be skipped on xenial and
bionic respectively.  The mechanism is semi-generic, so introducing new
"not_*" marks should just be a case of adding them to tox.ini.

(This also marks the test in `test_lp1898997.py` with these two marks.)
The latest commit includes the changes required for LXD network config
to work.
@OddBloke OddBloke merged commit 05216aa into canonical:master Dec 9, 2020
@OddBloke OddBloke deleted the tests branch December 9, 2020 23:11
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.

2 participants