Skip to content

Commit

Permalink
test: move ACC test back to LXD, fix microk8s setup for LXD
Browse files Browse the repository at this point in the history
  • Loading branch information
anvial committed Oct 7, 2024
1 parent 6614cef commit 8da2f56
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/test_integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,14 @@ jobs:
channel: ${{ matrix.action-operator.cloud-channel }}
juju-channel: ${{ matrix.action-operator.juju }}
lxd-channel: ${{ matrix.action-operator.lxd-channel }}
- name: In case of LXD setup also microk8s
if: ${{ matrix.action-operator.cloud == 'lxd' }}
run: |
sudo snap install microk8s --channel=1.28-strict/stable
sudo usermod -a -G microk8s ubuntu
sudo microk8s.enable dns storage
sudo microk8s.enable dns local-storage
sudo -g microk8s -E microk8s status --wait-ready --timeout=600
- name: Create additional networks when testing with LXD
if: ${{ matrix.action-operator.cloud == 'lxd' }}
run: |
Expand All @@ -88,7 +96,7 @@ jobs:
echo "EOF" >> $GITHUB_ENV
echo "TEST_MANAGEMENT_BR=10.150.40.0/24" >> $GITHUB_ENV
echo "TEST_PUBLIC_BR=10.170.80.0/24" >> $GITHUB_ENV
- name: "Set additional enviroment for microk8s"
- name: "Set additional environment for microk8s"
if: ${{ matrix.action-operator.cloud == 'microk8s' }}
run: |
echo "MICROK8S_CONFIG<<-EOT" >> $GITHUB_ENV
Expand Down
7 changes: 5 additions & 2 deletions internal/provider/resource_kubernetes_cloud_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright 2023 Canonical Ltd.
// Licensed under the Apache License, Version 2.0, see LICENCE file for details.

package provider

import (
Expand All @@ -10,8 +13,8 @@ import (
)

func TestAcc_ResourceKubernetesCloud(t *testing.T) {
if testingCloud != MicroK8sTesting {
t.Skip(t.Name() + " only runs with MicroK8s")
if testingCloud != LXDCloudTesting {
t.Skip(t.Name() + " only runs with LXD")
}
cloudName := acctest.RandomWithPrefix("tf-test-k8scloud")
cloudConfig := os.Getenv("MICROK8S_CONFIG")
Expand Down

0 comments on commit 8da2f56

Please sign in to comment.