canonical / hardware-observer-operator

A charm to setup prometheus exporter for IPMI, RedFish and RAID devices from different vendors.
Apache License 2.0
7 stars 14 forks source link

tests: Modify deployment for real hw tests #179

Closed dashmage closed 4 months ago

dashmage commented 4 months ago

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.