Skip to content

Commit 54b55a1

Browse files
authored
Fix E2E tests (#646)
1 parent e17affa commit 54b55a1

File tree

2 files changed

+32
-2
lines changed

2 files changed

+32
-2
lines changed

.github/workflows/helm-end-to-end-tfc.yaml

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,30 @@
11
name: E2E on HCP Terraform Operator [Helm]
22

3+
# To run this workflow locally, you can use https://github.com/nektos/act.
4+
# Act is a tool for executing GitHub Actions in your local environment.
5+
6+
# First, export the required secrets as environment variables:
7+
8+
# export TFC_OAUTH_TOKEN=<OAUTH_TOKEN>
9+
# export TFC_ORG=<ORG_NAME>
10+
# export TFC_TOKEN=<TOKEN>
11+
# export TFC_VCS_REPO=<VCS_REPO>
12+
13+
14+
# Then execute the workflow with:
15+
16+
# act workflow_dispatch --rm \
17+
# --container-architecture linux/arm64 \
18+
# -P linux=catthehacker/ubuntu:act-latest \
19+
# --var KIND_VERSION=0.30.0 \
20+
# --var BIN_NAME=manager \
21+
# --env PLATFORMS=arm64 \
22+
# -s TFC_OAUTH_TOKEN \
23+
# -s TFC_ORG \
24+
# -s TFC_TOKEN \
25+
# -s TFC_VCS_REPO \
26+
# -W .github/workflows/helm-end-to-end-tfc.yaml
27+
328
on:
429
schedule:
530
- cron: '30 6 * * 0'
@@ -17,6 +42,7 @@ env:
1742
CLUSTER_NAME: 'this'
1843
DOCKER_IMAGE: 'this'
1944
KUBECONFIG: ${{ github.workspace }}/.kube/config
45+
PLATFORMS: 'amd64'
2046

2147
jobs:
2248
tests:
@@ -56,15 +82,15 @@ jobs:
5682
- name: Set up QEMU
5783
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0
5884
with:
59-
platforms: amd64
85+
platforms: ${{ env.PLATFORMS }}
6086

6187
- name: Set up Docker Buildx
6288
uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3.3.0
6389

6490
- name: Build and load Docker image
6591
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
6692
with:
67-
platforms: linux/amd64
93+
platforms: linux/${{ env.PLATFORMS }}
6894
load: true
6995
build-args:
7096
BIN_NAME=${{ vars.BIN_NAME }}

internal/controller/runscollector_controller_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ package controller
66
import (
77
"io"
88
"net/http"
9+
"os"
910
"strings"
1011
"time"
1112

@@ -25,6 +26,9 @@ var _ = Describe("RunsCollector Controller", Ordered, func() {
2526
)
2627

2728
BeforeAll(func() {
29+
if os.Getenv("USE_EXISTING_CLUSTER") == "true" {
30+
Skip("Does not run on an existing cluster")
31+
}
2832
// Set default Eventually timers
2933
SetDefaultEventuallyTimeout(syncPeriod * 4)
3034
SetDefaultEventuallyPollingInterval(2 * time.Second)

0 commit comments

Comments
 (0)