Skip to content

Commit

Permalink
[chore] Add testing by installing on GCE (#1496)
Browse files Browse the repository at this point in the history
  • Loading branch information
atoulme authored Oct 16, 2024
1 parent 397a782 commit 4b58e15
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
41 changes: 41 additions & 0 deletions .github/workflows/functional_test_v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -365,3 +365,44 @@ jobs:
run: |
cd functional_tests
TEARDOWN_BEFORE_SETUP=true go test -v -tags functional
gce-autopilot-test:
name: Test helm install in GCE (kops) - credentials needed
needs: kubernetes-test
if: github.event.pull_request.head.repo.full_name == github.repository
concurrency:
group: gce-access
env:
KUBE_TEST_ENV: gce
SKIP_TESTS: "true"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ~1.21.8
cache: false
- name: Cache Go
id: go-cache
timeout-minutes: 5
uses: actions/cache@v4
with:
path: |
~/go/bin
~/go/pkg/mod
key: go-cache-${{ runner.os }}-${{ hashFiles('**/go.sum') }}
- name: Update dependencies
run: |
make dep-update
- name: Set kubeconfig
run: echo "$GCE_KUBECONFIG" > /tmp/kubeconfig
env:
GCE_KUBECONFIG: ${{ secrets.GCE_KUBECONFIG }}
- name: run functional tests
uses: mobiledevops/secret-to-file-action@v1
env:
HOST_ENDPOINT: 0.0.0.0
KUBECONFIG: /tmp/kubeconfig
run: |
cd functional_tests
TEARDOWN_BEFORE_SETUP=true go test -v -tags functional
3 changes: 2 additions & 1 deletion functional_tests/functional_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ const (
eksTestKubeEnv = "eks"
autopilotTestKubeEnv = "gke/autopilot"
aksTestKubeEnv = "aks"
gceTestKubeEnv = "gce"
testDir = "testdata"
valuesDir = "values"
manifestsDir = "manifests"
Expand Down Expand Up @@ -532,7 +533,7 @@ func Test_Functions(t *testing.T) {
require.True(t, setKubeTestEnv, "the environment variable KUBE_TEST_ENV must be set")

switch kubeTestEnv {
case kindTestKubeEnv, autopilotTestKubeEnv, aksTestKubeEnv:
case kindTestKubeEnv, autopilotTestKubeEnv, aksTestKubeEnv, gceTestKubeEnv:
expectedValuesDir = kindValuesDir
case eksTestKubeEnv:
expectedValuesDir = eksValuesDir
Expand Down

0 comments on commit 4b58e15

Please sign in to comment.