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

tests: Modify deployment for real hw tests #179

Merged
merged 2 commits into from
Mar 5, 2024

Conversation

dashmage
Copy link
Contributor

This patch modifies the test_build_and_deploy method to work even when testing with real hardware where the machine has already been pre-deployed in the model. The attaching of required resources after the bundle deployment is handled here as well.

The test execution logic has also been slightly tweaked. If the --collectors option is provided, then ONLY the real hardware dependent tests will be executed (marked with the "realhw" marker, belonging to TestCharmWithHW). If the option not provided, the hardware independent tests (in TestCharm) will be executed. If full tests are required, a make target can possibly be created which runs the pytest command with and without providing collectors.

Some logic has also been added to ensure that the test_build_and_deploy function will run for both, hardware dependent and independent tests.

This patch modifies the test_build_and_deploy method to work even when
testing with real hardware where the machine has already been
pre-deployed in the model. The attaching of required resources after the
bundle deployment is handled here as well.

The test execution logic has also been slightly tweaked. If the
--collectors option is provided, then ONLY the real hardware dependent
tests will be executed (marked with the "realhw" marker, belonging to
TestCharmWithHW). If the option not provided, the hardware independent
tests (in TestCharm) will be executed. If full tests are required, a
make target can be created which runs the pytest command with and without
providing collectors.

Some logic has also been added to ensure that the test_build_and_deploy
function will run for both, hardware dependent and independent tests.
Copy link
Contributor

@chanchiwai-ray chanchiwai-ray left a comment

Choose a reason for hiding this comment

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

Needs information

tests/functional/test_charm.py Outdated Show resolved Hide resolved
tests/functional/test_charm.py Outdated Show resolved Hide resolved
tests/functional/conftest.py Outdated Show resolved Hide resolved
Copy link

@Pjack Pjack left a comment

Choose a reason for hiding this comment

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

LGTM. I will approve it after addressing Ray's comment.

@dashmage dashmage force-pushed the bseng-1381-modify-deployment branch from 0081f38 to 898d6dd Compare March 1, 2024 09:36
@dashmage dashmage requested a review from chanchiwai-ray March 3, 2024 17:41
Copy link

@Pjack Pjack left a comment

Choose a reason for hiding this comment

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

LGTM

@dashmage dashmage merged commit 089ae93 into canonical:master Mar 5, 2024
5 checks passed
@dashmage dashmage deleted the bseng-1381-modify-deployment branch March 5, 2024 04:29
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.

4 participants