Skip to content

Commit

Permalink
a few more tries
Browse files Browse the repository at this point in the history
  • Loading branch information
javierdelapuente committed Jan 30, 2025
1 parent 3b0c952 commit 0e3adbf
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 4 deletions.
3 changes: 2 additions & 1 deletion tests/integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,8 @@ async def image_builder_fixture(
config={
"app-channel": "edge",
"build-interval": "12",
"revision-history-limit": "5",
# JAVI be careful, maybe all tests use the same names for the images
"revision-history-limit": "15",
"openstack-auth-url": private_endpoint_config["auth_url"],
# Bandit thinks this is a hardcoded password
"openstack-password": private_endpoint_config["password"], # nosec: B105
Expand Down
8 changes: 7 additions & 1 deletion tests/integration/helpers/openstack.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,13 @@ def log_runners(self, unit: Unit) -> None:
runners = self._get_runners(unit)
logger.info("[ list of runners for unit %s]", unit)
for runner in runners:
logger.info("[ runner %s ]: %s", runner.name, runner)
logger.info(
" [ runner %s ] status %s created %s updated %s",
runner.name,
runner.status,
runner.created_at,
runner.updated_at,
)
logger.info("[ end list of runners for unit %s]")

async def delete_single_runner(self, unit: Unit) -> None:
Expand Down
18 changes: 17 additions & 1 deletion tests/integration/test_charm_fork_path_change.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,31 @@ async def test_path_config_change(

logger.info("Ensure there is a runner (this calls reconcile)")
await instance_helper.ensure_charm_has_runner(app_with_forked_repo)
logger.info("after ensure_charm_has_runner")
instance_helper.log_runners(unit)

logger.info("Change Path config option")
await app_with_forked_repo.set_config({PATH_CONFIG_NAME: path})
instance_helper.log_runners(unit)

status = await model.get_status()
logger.info(" status : %s", status)

logger.info("Reconciling (again)")
await reconcile(app=app_with_forked_repo, model=model)

logger.info("after Reconciling (again)")
instance_helper.log_runners(unit)

status = await model.get_status()
logger.info("JAVI status 2: %s", status)

runner_names = await instance_helper.get_runner_names(unit)
logger.info("runners: %s", runner_names)
assert len(runner_names) == 1
#this will crash if there is not exactly one
logger.info("runner info: %s", instance_helper._get_single_runner(unit))

runner_name = runner_names[0]

runners_in_repo = github_repository.get_self_hosted_runners()
Expand All @@ -62,4 +78,4 @@ async def test_path_config_change(
filter(lambda runner: runner.name == runner_name, runners_in_repo)
)

assert len(runner_in_repo_with_same_name) == 1
assert len(runner_in_repo_with_same_name) == 1, "there has to be 1 runner in the repo"
3 changes: 2 additions & 1 deletion tests/integration/test_runner_manager_openstack.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
)
from github_runner_manager.metrics import events
from github_runner_manager.openstack_cloud import health_checks
from github_runner_manager.openstack_cloud import constants
from github_runner_manager.openstack_cloud.openstack_runner_manager import (
OpenStackCredentials,
OpenStackRunnerManager,
Expand All @@ -50,7 +51,7 @@
)

logger = logging.getLogger(__name__)

constants.CREATE_SERVER_TIMEOUT = 900

@pytest.fixture(scope="module", name="runner_label")
def runner_label():
Expand Down

0 comments on commit 0e3adbf

Please sign in to comment.