Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
c88df24
Support proxy values
swetha1654 Jan 20, 2026
5ca542c
static errors
swetha1654 Jan 20, 2026
209479e
fix static and lint issues
swetha1654 Jan 20, 2026
903ce2f
fix static and lint inside app
swetha1654 Jan 20, 2026
72d8d3f
abort on fail
swetha1654 Jan 20, 2026
26b2965
add changelog
swetha1654 Jan 20, 2026
3f37f58
vale error
swetha1654 Jan 20, 2026
4860270
delete chain and run integ tests
swetha1654 Jan 27, 2026
f74433b
chore(deps): update dependency openstacksdk to v4.9.0 (#184)
renovate[bot] Jan 22, 2026
83fffe4
chore: update charm libraries (#177)
github-actions[bot] Jan 22, 2026
9e8f934
Merge branch 'main' into ISD-3652-aproxy2
swetha1654 Jan 27, 2026
e49a597
Update src/builder.py
swetha1654 Jan 27, 2026
d901d07
remove pyproject update
swetha1654 Jan 27, 2026
ad07dc9
address code review
swetha1654 Feb 5, 2026
7cb4485
remove tesT
swetha1654 Feb 5, 2026
1d7a529
test
swetha1654 Feb 6, 2026
7ef5451
update prerouting chain
swetha1654 Feb 10, 2026
417b9ef
fix script
swetha1654 Feb 10, 2026
08d10b4
fix script
swetha1654 Feb 10, 2026
1e68b2a
update builder initializer
swetha1654 Feb 10, 2026
efbadff
remove all code
swetha1654 Feb 10, 2026
a89fbdb
remove code
swetha1654 Feb 10, 2026
47c6b97
remove code
swetha1654 Feb 10, 2026
b804d34
setup proxy env for all hooks
swetha1654 Feb 10, 2026
b57f7ae
fix lint issues
swetha1654 Feb 10, 2026
2f7a6f2
Merge branch 'main' into ISD-3652-aproxy2
swetha1654 Feb 10, 2026
40db4e1
remove lint
swetha1654 Feb 10, 2026
60cd863
add more logs
swetha1654 Feb 10, 2026
130b7f7
remove randomly added code
swetha1654 Feb 10, 2026
cc9f619
lint issues
swetha1654 Feb 10, 2026
d3befa1
disable noproxy and check
swetha1654 Feb 11, 2026
608545b
experiment with no proxy
swetha1654 Feb 11, 2026
51761f9
debug
swetha1654 Feb 12, 2026
ca7e35e
debug
swetha1654 Feb 12, 2026
210216d
debug
swetha1654 Feb 12, 2026
75b6d5b
empty commit
swetha1654 Feb 17, 2026
ab91e2f
Merge branch 'main' into ISD-3652-integration-test
swetha1654 Feb 17, 2026
f15b342
test charm update
swetha1654 Feb 17, 2026
2f1baf1
fix lint
swetha1654 Feb 17, 2026
c63248d
update changelog
swetha1654 Feb 17, 2026
5d25987
update permissions
swetha1654 Feb 18, 2026
4240a99
add comment
swetha1654 Feb 18, 2026
f6f860a
change name
swetha1654 Feb 18, 2026
3c4d909
address copilot comments
swetha1654 Feb 18, 2026
956e6f6
add comment
swetha1654 Feb 18, 2026
c9ef1b7
Merge branch 'main' into ISD-3652-integration-test
swetha1654 Feb 18, 2026
c646603
lint issues
swetha1654 Feb 18, 2026
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
2 changes: 2 additions & 0 deletions .github/workflows/integration_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ jobs:
self-hosted-runner-arch: X64
self-hosted-runner-label: pfe-ci
builder-runner-label: X64
pre-run-script: |
-c "./tests/integration/aproxy_prerouting_workaround.sh"
allure-report:
if: ${{ !cancelled() && github.event_name == 'schedule' }}
needs:
Expand Down
3 changes: 3 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@

<!-- vale Canonical.007-Headings-sentence-case = NO -->

## [#198 Update integration tests](https://github.com/canonical/github-runner-image-builder-operator/pull/198) (2026-02-17)
* Update integration tests that were intentionally not done in #185.

## [#185 Remove aproxy installation and add proxy support in workload](https://github.com/canonical/github-runner-image-builder-operator/pull/185) (2026-01-20)
* Remove `aproxy` snap installation in the charm and inject proxy values from the model config into the workload process.

Expand Down
33 changes: 33 additions & 0 deletions tests/integration/aproxy_prerouting_workaround.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash

# Copyright 2026 Canonical Ltd.
# See LICENSE file for licensing details.

# Aproxy is installed on the CI runners and we want to test if the charm and workload respect the
# proxy values without aproxy. This script adds a nftables rule to bypass aproxy for any traffic
# originating from the LXD container, except for the juju controller traffic which is needed
# to spin up machines for the charms.

set -euo pipefail

# charmcraft pack runs inside the LXD container and needs to go through proxy so it
# will be done before modifying the nftables rules.
/snap/bin/charmcraft pack -p tests/integration/data/charm

IP=$(lxc list -c 4 --format csv | awk '{print $1}' | head -n 1)

if [[ -z "${IP:-}" ]]; then
echo "Error: no IPv4 address found from 'lxc list'. Ensure an LXC container with an IPv4 address is running." >&2
exit 1
fi

echo "IP=$IP"

if ! sudo nft list chain ip aproxy prerouting >/dev/null 2>&1; then
echo "Error: nftables chain 'ip aproxy prerouting' not found. Ensure aproxy is configured before running this script." >&2
exit 1
fi

# we want only the juju controller traffic to go through aproxy to spin up machines for the charms.
# Any other charm related traffic should handle proxy by itself.
sudo nft insert rule ip aproxy prerouting index 0 ip saddr != "$IP" return
30 changes: 9 additions & 21 deletions tests/integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@
import os
import secrets
import string

# subprocess module is used to call juju cli directly due to constraints with private-endpoint
# models
import subprocess # nosec: B404
from dataclasses import dataclass
from datetime import datetime, timezone
from pathlib import Path
Expand Down Expand Up @@ -64,6 +60,8 @@
# This is required to dynamically load async fixtures in async def model_fixture()
nest_asyncio.apply()

TEST_CHARM_FILE = "./test_ubuntu-22.04-amd64.charm"


@dataclass
class _Secret:
Expand Down Expand Up @@ -105,7 +103,10 @@ async def model_fixture(proxy: ProxyConfig, ops_test: OpsTest) -> AsyncGenerator
{
"juju-http-proxy": proxy.http,
"juju-https-proxy": proxy.https,
"juju-no-proxy": proxy.no_proxy,
"apt-http-proxy": proxy.http,
"apt-https-proxy": proxy.https,
"snap-http-proxy": proxy.http,
"snap-https-proxy": proxy.https,
}
)
yield ops_test.model
Expand All @@ -117,25 +118,15 @@ def dispatch_time_fixture():
return datetime.now(tz=timezone.utc)


@pytest.fixture(scope="module", name="test_charm_file")
def test_charm_file_fixture() -> str:
"""Build the charm and return the path to the built charm."""
subprocess.check_call( # nosec: B603
["/snap/bin/charmcraft", "pack", "-p", "tests/integration/data/charm"]
)
return "./test_ubuntu-22.04-amd64.charm"


@pytest_asyncio.fixture(scope="module", name="test_charm")
async def test_charm_fixture(
model: Model,
test_id: str,
test_charm_file: str,
private_endpoint_configs: PrivateEndpointConfigs,
) -> AsyncGenerator[Application, None]:
"""The test charm that becomes active when valid relation data is given."""
app_name = f"test-{test_id}"
app = await _deploy_test_charm(app_name, model, private_endpoint_configs, test_charm_file)
app = await _deploy_test_charm(app_name, model, private_endpoint_configs)

yield app

Expand All @@ -147,12 +138,11 @@ async def test_charm_fixture(
async def test_charm_2(
model: Model,
test_id: str,
test_charm_file: str,
private_endpoint_configs: PrivateEndpointConfigs,
) -> AsyncGenerator[Application, None]:
"""A second test charm that becomes active when valid relation data is given."""
app_name = f"test2-{test_id}"
app = await _deploy_test_charm(app_name, model, private_endpoint_configs, test_charm_file)
app = await _deploy_test_charm(app_name, model, private_endpoint_configs)

yield app

Expand All @@ -165,20 +155,18 @@ async def _deploy_test_charm(
app_name: str,
model: Model,
private_endpoint_configs: PrivateEndpointConfigs,
test_charm_file: str,
):
"""Deploy the test charm with the given application name.

Args:
app_name: The name of the application to deploy.
model: The Juju model to deploy the charm in.
private_endpoint_configs: The OpenStack private endpoint configurations.
test_charm_file: The path to the built test charm file.

"""
logger.info("Deploying built test charm")
app: Application = await model.deploy(
test_charm_file,
TEST_CHARM_FILE,
app_name,
config={
"openstack-auth-url": private_endpoint_configs["auth_url"],
Expand Down
Loading