Skip to content

Commit

Permalink
chore(ci) add unreleased image tests (#242)
Browse files Browse the repository at this point in the history
* chore(ci) add unreleased image tests

* Apply suggestions from code review

Co-authored-by: Patryk Małek <patryk.malek@konghq.com>

* Update .github/workflows/integration-test-enterprise-nightly.yaml

Co-authored-by: Patryk Małek <patryk.malek@konghq.com>

Co-authored-by: Patryk Małek <patryk.malek@konghq.com>
  • Loading branch information
rainest and pmalek authored Jan 20, 2023
1 parent e05a12f commit 4b75690
Show file tree
Hide file tree
Showing 6 changed files with 102 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .ci/setup_kong.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

KONG_IMAGE=kong:${KONG_VERSION}
KONG_IMAGE=${KONG_IMAGE_REPO:-kong}:${KONG_IMAGE_TAG:-3.0.0}
NETWORK_NAME=kong-test

PG_CONTAINER_NAME=pg
Expand Down
7 changes: 6 additions & 1 deletion .ci/setup_kong_ee.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

KONG_IMAGE=kong/kong-gateway:${KONG_VERSION}
KONG_IMAGE=${KONG_IMAGE_REPO:-kong/kong-gateway}:${KONG_IMAGE_TAG:-3.0.0.0}
NETWORK_NAME=kong-test

PG_CONTAINER_NAME=pg
Expand Down Expand Up @@ -34,6 +34,11 @@ waitKongAPI() {
done
}

if [[ -v TEST_KONG_PULL_USERNAME ]]; then
echo "${TEST_KONG_PULL_PASSWORD}" | docker login --username "${TEST_KONG_PULL_USERNAME}" --password-stdin
fi


# Start a PostgreSQL container
docker run --rm -d --name $PG_CONTAINER_NAME \
--network=$NETWORK_NAME \
Expand Down
51 changes: 51 additions & 0 deletions .github/workflows/integration-test-enterprise-nightly.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: 'Integration Test : Enterprise Nightly'

on:
push:
branches:
- 'main'
- 'release/*'
pull_request:
branches:
- '*'

jobs:
test-enterprise:
continue-on-error: true
env:
KONG_ADMIN_TOKEN: kong
KONG_IMAGE_REPO: "kong/kong-gateway-internal"
KONG_IMAGE_TAG: "master-alpine"
KONG_ANONYMOUS_REPORTS: "off"
TEST_KONG_PULL_USERNAME: ${{ secrets.GHA_DOCKERHUB_PULL_USER }}
TEST_KONG_PULL_PASSWORD: ${{ secrets.GHA_KONG_ORG_DOCKERHUB_PUBLIC_TOKEN }}
runs-on: ubuntu-latest
steps:
# This will set KONG_LINCENSE_DATA environment variable.
- uses: Kong/kong-license@9fb64ad7be1ed2b121a70990783d7c0869e531d5
id: license_step
with:
password: ${{ secrets.PULP_PASSWORD }}
- name: Setup go
uses: actions/setup-go@v3
with:
go-version: '^1.19'
- name: Checkout repository
uses: actions/checkout@v3
- uses: actions/cache@v3.2.3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Setup Kong
run: make setup-kong-ee
- name: Run tests
run: make test-coverage-enterprise
- name: Upload Code Coverage
uses: codecov/codecov-action@v3.1.1
with:
name: codecov-enterprise-nightly
flags: enterprise-nightly,integration,enterprise
fail_ci_if_error: true

2 changes: 1 addition & 1 deletion .github/workflows/integration-test-enterprise.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
- '3.0.1.0'
- '3.1.0.0'
env:
KONG_VERSION: ${{ matrix.kong_version }}
KONG_IMAGE_TAG: ${{ matrix.kong_version }}
KONG_ANONYMOUS_REPORTS: "off"
KONG_ADMIN_TOKEN: kong
runs-on: ubuntu-latest
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/integration-test-nightly.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: 'Integration Test : Community Nightly'

on:
push:
branches:
- 'main'
- 'release/*'
pull_request:
branches:
- '*'

jobs:
test:
env:
KONG_IMAGE_REPO: "kong/kong"
KONG_IMAGE_TAG: "master-alpine"
KONG_ANONYMOUS_REPORTS: "off"
runs-on: ubuntu-latest
steps:
- name: Setup go
uses: actions/setup-go@v3
with:
go-version: '^1.19'
- name: Checkout repository
uses: actions/checkout@v3
- uses: actions/cache@v3.2.3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Setup Kong
run: make setup-kong
- name: Run tests
run: make test-coverage
- name: Upload Code Coverage
uses: codecov/codecov-action@v3.1.1
with:
name: codecov-nightly
flags: nightly,integration,community
fail_ci_if_error: true

2 changes: 1 addition & 1 deletion .github/workflows/integration-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- '3.0.1'
- '3.1.0'
env:
KONG_VERSION: ${{ matrix.kong_version }}
KONG_IMAGE_TAG: ${{ matrix.kong_version }}
KONG_ANONYMOUS_REPORTS: "off"
runs-on: ubuntu-latest
steps:
Expand Down

0 comments on commit 4b75690

Please sign in to comment.