Skip to content

Commit

Permalink
Add integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
lgarber-akamai committed Jan 15, 2025
1 parent 8d37b84 commit 8b5b2a2
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
38 changes: 38 additions & 0 deletions test/integration/models/lke/test_lke.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,31 @@ def lke_cluster_with_labels_and_taints(test_linode_client):
cluster.delete()


@pytest.fixture(scope="session")
def lke_cluster_with_apl(test_linode_client):
version = test_linode_client.lke.versions()[0]

region = get_region(test_linode_client, {"Kubernetes", "Disk Encryption"})

node_pools = test_linode_client.lke.node_pool("g6-dedicated-2", 3)
label = get_test_label() + "_cluster"

cluster = test_linode_client.lke.cluster_create(
region,
label,
node_pools,
version,
control_plane=LKEClusterControlPlaneOptions(
high_availability=True,
),
apl_enabled=True,
)

yield cluster

cluster.delete()


def get_cluster_status(cluster: LKECluster, status: str):
return cluster._raw_json["status"] == status

Expand Down Expand Up @@ -328,6 +353,19 @@ def test_lke_cluster_labels_and_taints(lke_cluster_with_labels_and_taints):
assert LKENodePoolTaint.from_json(updated_taints[1]) in pool.taints


@pytest.mark.flaky(reruns=3, reruns_delay=2)
def test_lke_cluster_with_apl(lke_cluster_with_apl):
assert lke_cluster_with_apl.apl_enabled == True
assert (
lke_cluster_with_apl.apl_console_url
== f"https://console.lke{lke_cluster_with_apl.id}.akamai-apl.net"
)
assert (
lke_cluster_with_apl.apl_health_check_url
== f"https://auth.lke{lke_cluster_with_apl.id}.akamai-apl.net/ready"
)


def test_lke_types(test_linode_client):
types = test_linode_client.lke.types()

Expand Down
1 change: 1 addition & 0 deletions test/unit/objects/lke_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,7 @@ def test_cluster_create_with_apl(self):
assert (
cluster.apl_console_url == "https://console.lke18881.akamai-apl.net"
)

assert (
cluster.apl_health_check_url
== "https://auth.lke18881.akamai-apl.net/ready"
Expand Down

0 comments on commit 8b5b2a2

Please sign in to comment.