Skip to content

Commit

Permalink
Merge branch 'main' into fix-dump
Browse files Browse the repository at this point in the history
  • Loading branch information
randmonkey authored Apr 21, 2023
2 parents 5064924 + ee6b271 commit 9f9923f
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 18 deletions.
19 changes: 10 additions & 9 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,32 +94,34 @@ jobs:
test: ${{ fromJSON(needs.setup-integration-tests.outputs.test_names) }}
runs-on: ubuntu-latest
steps:
# This step is needed to avoid running the integration tests if the secrets are not available.
# TODO: remove this step once we have a way to run integration tests on forks.
# https://github.com/Kong/kubernetes-testing-framework/issues/596
- name: Detect if we should run (have required secrets)
id: detect_if_should_run
# This step is needed to avoid running the integration tests requiring an enterprise license
# if the secrets are not available.
- name: Detect if we should run test cases requring an enterprise license (have required secrets)
id: detect_if_should_run_enterprise
run: echo "result=${{ secrets.PULP_PASSWORD != '' }}" >> $GITHUB_OUTPUT

- name: Set environment variable to enable test cases requiring an enterprise license
if: steps.detect_if_should_run_enterprise.outputs.result == 'true'
id: set_run_enterprise_env
run: echo "KTF_TEST_RUN_ENTERPRISE_CASES=true" >> $GITHUB_ENV

- name: checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: Kong/kong-license@master
if: steps.detect_if_should_run.outputs.result == 'true'
if: steps.detect_if_should_run_enterprise.outputs.result == 'true'
id: license
with:
password: ${{ secrets.PULP_PASSWORD }}

- name: setup golang
if: steps.detect_if_should_run.outputs.result == 'true'
uses: actions/setup-go@v4
with:
go-version: '^1.19'

- name: run integration test ${{ matrix.test }}
if: steps.detect_if_should_run.outputs.result == 'true'
run: make test.integration
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -134,7 +136,6 @@ jobs:
# somewhat defeats the purpose of uploading those reports. Why bother uploading
# if we don't care if the upload's successful?
- name: Upload coverage to Codecov
if: steps.detect_if_should_run.outputs.result == 'true'
uses: Wandalen/wretry.action@v1.0.36
with:
action: codecov/codecov-action@v3
Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ require (
github.com/stretchr/testify v1.8.2
golang.org/x/oauth2 v0.7.0
golang.org/x/sync v0.1.0
google.golang.org/api v0.118.0
google.golang.org/api v0.119.0
k8s.io/api v0.27.1
k8s.io/apiextensions-apiserver v0.27.1
k8s.io/apimachinery v0.27.1
Expand All @@ -36,7 +36,7 @@ require (
sigs.k8s.io/yaml v1.3.0
)

require github.com/google/s2a-go v0.1.0 // indirect
require github.com/google/s2a-go v0.1.2 // indirect

require (
cloud.google.com/go/compute v1.19.0 // indirect
Expand Down Expand Up @@ -139,7 +139,7 @@ require (
golang.org/x/text v0.9.0 // indirect
golang.org/x/time v0.3.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20230403163135-c38d8f061ccd // indirect
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect
google.golang.org/grpc v1.54.0 // indirect
google.golang.org/protobuf v1.30.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
Expand Down
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,8 @@ github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLe
github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec=
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
github.com/google/s2a-go v0.1.0 h1:3Qm0liEiCErViKERO2Su5wp+9PfMRiuS6XB5FvpKnYQ=
github.com/google/s2a-go v0.1.0/go.mod h1:OJpEgntRZo8ugHpF9hkoLJbS5dSI20XZeXJ9JVywLlM=
github.com/google/s2a-go v0.1.2 h1:WVtYAYuYxKeYajAmThMRYWP6K3wXkcqbGHeUgeubUHY=
github.com/google/s2a-go v0.1.2/go.mod h1:OJpEgntRZo8ugHpF9hkoLJbS5dSI20XZeXJ9JVywLlM=
github.com/google/safetext v0.0.0-20220905092116-b49f7bc46da2/go.mod h1:Tv1PlzqC9t8wNnpPdctvtSUOPUUg4SHeE6vR1Ir2hmg=
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4=
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ=
Expand Down Expand Up @@ -680,8 +680,8 @@ google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz513
google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg=
google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE=
google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8=
google.golang.org/api v0.118.0 h1:FNfHq9Z2GKULxu7cEhCaB0wWQHg43UpomrrN+24ZRdE=
google.golang.org/api v0.118.0/go.mod h1:76TtD3vkgmZ66zZzp72bUUklpmQmKlhh6sYtIjYK+5E=
google.golang.org/api v0.119.0 h1:Dzq+ARD6+8jmd5wknJE1crpuzu1JiovEU6gCp9PkoKA=
google.golang.org/api v0.119.0/go.mod h1:CrSvlNEFCFLae9ZUtL1z+61+rEBD7J/aCYwVYKZoWFU=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
Expand Down Expand Up @@ -728,8 +728,8 @@ google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6D
google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20230403163135-c38d8f061ccd h1:sLpv7bNL1AsX3fdnWh9WVh7ejIzXdOc1RRHGeAmeStU=
google.golang.org/genproto v0.0.0-20230403163135-c38d8f061ccd/go.mod h1:UUQDJDOlWu4KYeJZffbWgBkS1YFobzKbLVfK69pe0Ak=
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 h1:KpwkzHKEF7B9Zxg18WzOa7djJ+Ha5DzthMyZYQfEn2A=
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1/go.mod h1:nKE/iIaLqn2bQwXBg8f1g2Ylh6r5MN5CmZvuzZCgsCU=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
Expand Down
1 change: 1 addition & 0 deletions test/integration/enterprise_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
)

func TestKongEnterprisePostgres(t *testing.T) {
SkipEnterpriseTestIfNoEnv(t)
t.Parallel()

t.Log("preparing kong enterprise secrets")
Expand Down
11 changes: 11 additions & 0 deletions test/integration/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ package integration

import (
"context"
"os"
"testing"
)

// -----------------------------------------------------------------------------
Expand All @@ -15,3 +17,12 @@ var (
// ctx is a common context that can be used between tests
ctx = context.Background()
)

// SkipEnterpriseTestIfNoEnv skips test cases that requires an enterprise license
// if environment variable KTF_TEST_RUN_ENTERPRISE_CASES is not set.
// The function should be called at the beginning of test cases requiring an enterprise license.
func SkipEnterpriseTestIfNoEnv(t *testing.T) {
if os.Getenv("KTF_TEST_RUN_ENTERPRISE_CASES") != "true" {
t.Skip("skipped the test requiring kong enterprise license")
}
}

0 comments on commit 9f9923f

Please sign in to comment.