Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add INSTANCE_TYPE integration settings and lessen integration log spams #5988

Merged
merged 1 commit into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions doc/rtd/development/integration_tests.rst
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,30 @@ on of:
PLATFORM = 'lxd_container'


Selecting Instance Type
-----------------------

To select a specific instance type, modify the ``INSTANCE_TYPE`` variable to be
the desired instance type. This value is cloud-specific, so refer to the
cloud's documentation for the available instance types. If you specify an
instance type, be sure to also specify respective cloud platform you are
testing against.

.. tab-set::

.. tab-item:: Inline environment variable

.. code-block:: bash

CLOUD_INIT_PLATFORM=ec2 CLOUD_INIT_INSTANCE_TYPE='t2.micro' tox -e integration_tests

.. tab-item:: user_settings.py file

.. code-block:: python

PLATFORM = 'ec2' # need to specify the cloud in order to use the instance type setting
INSTANCE_TYPE = 't2.micro'

Image selection
===============

Expand Down
4 changes: 4 additions & 0 deletions tests/integration_tests/clouds.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ def launch(
"user_data": user_data,
"username": DISTRO_TO_USERNAME[CURRENT_RELEASE.os],
}
if self.settings.INSTANCE_TYPE:
default_launch_kwargs["instance_type"] = (
self.settings.INSTANCE_TYPE
)
launch_kwargs = {**default_launch_kwargs, **launch_kwargs}
display_launch_kwargs = deepcopy(launch_kwargs)
if display_launch_kwargs.get("user_data") is not None:
Expand Down