Skip to content

Commit 365615f

Browse files
committed
ci: Add GHA workflow to test AWS
1 parent 8a47d62 commit 365615f

File tree

4 files changed

+20
-2
lines changed

4 files changed

+20
-2
lines changed

.github/workflows/checks.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ jobs:
6262
matrix:
6363
PROVIDER:
6464
- Docker
65+
- AWS
6566
steps:
6667
- name: Check out code
6768
uses: actions/checkout@v4

make/go.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ endif
8989
$(info $(M) running e2e tests$(if $(E2E_LABEL), labelled "$(E2E_LABEL)")$(if $(E2E_FOCUS), matching "$(E2E_FOCUS)"))
9090
env E2E_IMAGE_TAG="$$(gojq --raw-output '.version' $(REPO_ROOT)/dist/metadata.json)" \
9191
envsubst -no-unset -no-empty -i '$(E2E_CONF_FILE)' -o '$(E2E_CONF_FILE_ENVSUBST)'
92-
env AWS_B64ENCODED_CREDENTIALS="$$(clusterawsadm bootstrap credentials encode-as-profile)" \
92+
env AWS_B64ENCODED_CREDENTIALS="$$(clusterawsadm bootstrap credentials encode-as-profile 2>/dev/null)" \
9393
ginkgo run \
9494
--r \
9595
--show-node-events \

test/e2e/e2e_suite_test.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313
"flag"
1414
"os"
1515
"path/filepath"
16+
"slices"
1617
"strings"
1718
"testing"
1819

@@ -175,6 +176,16 @@ func loadE2EConfig(configPath string) *clusterctl.E2EConfig {
175176
)
176177
Expect(config).NotTo(BeNil(), "Failed to load E2E config from %s", configPath)
177178

179+
config.Providers = slices.DeleteFunc(config.Providers, func(p clusterctl.ProviderConfig) bool {
180+
switch p.Name {
181+
case "aws":
182+
_, found := os.LookupEnv("AWS_B64ENCODED_CREDENTIALS")
183+
return !found
184+
default:
185+
return false
186+
}
187+
})
188+
178189
return config
179190
}
180191

test/e2e/quick_start_test.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ package e2e
77

88
import (
99
"fmt"
10+
"slices"
1011
"strings"
1112

1213
. "github.com/onsi/ginkgo/v2"
@@ -47,14 +48,19 @@ var _ = Describe("Quick start", Serial, func() {
4748
Label("addonStrategy:"+addonStrategy),
4849
func() {
4950
e2e.QuickStartSpec(ctx, func() e2e.QuickStartSpecInput {
51+
prov := strings.ToLower(provider)
52+
if slices.Contains(e2eConfig.InfrastructureProviders(), prov) {
53+
Skip(fmt.Sprintf("provider %s is not enabled", prov))
54+
}
55+
5056
return e2e.QuickStartSpecInput{
5157
E2EConfig: e2eConfig,
5258
ClusterctlConfigPath: clusterctlConfigPath,
5359
BootstrapClusterProxy: bootstrapClusterProxy,
5460
ArtifactFolder: artifactFolder,
5561
SkipCleanup: skipCleanup,
5662
Flavor: ptr.To(flavour),
57-
InfrastructureProvider: ptr.To(strings.ToLower(provider)),
63+
InfrastructureProvider: ptr.To(prov),
5864
PostMachinesProvisioned: func(proxy framework.ClusterProxy, namespace, clusterName string) {
5965
framework.AssertOwnerReferences(
6066
namespace,

0 commit comments

Comments
 (0)