Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: do matrix over Envoy and EG versions for integration tests #126

Merged
merged 7 commits into from
Jan 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 21 additions & 7 deletions .github/workflows/commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,17 @@ jobs:
run: make test-controller

test_extproc:
name: External Processor Test
name: External Processor Test (Envoy ${{ matrix.name }})
# Not all the cases in E2E require secrets, so we run for all the events.
if: (github.event_name != 'pull_request_target' || contains(github.event.pull_request.labels.*.name, 'safe to test'))
strategy:
fail-fast: false
matrix:
include:
- name: v1.33.0
envoy_version: envoyproxy/envoy:v1.33.0
- name: latest
envoy_version: envoyproxy/envoy-dev:latest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -126,14 +134,11 @@ jobs:
~/go/bin
key: extproc-tests-${{ hashFiles('**/go.mod', '**/go.sum', '**/Makefile') }}
- name: Install Envoy
env:
# TODO: use the latest envoy after 1.33 is released.
ENVOY_VERSION: envoyproxy/envoy-dev:latest
run: |
export ENVOY_BIN_DIR=$HOME/envoy/bin
mkdir -p $ENVOY_BIN_DIR
docker run -v $ENVOY_BIN_DIR:/tmp/coraza -w /tmp/coraza \
--entrypoint /bin/cp ${ENVOY_VERSION} /usr/local/bin/envoy .
docker run -v $ENVOY_BIN_DIR:/tmp/ci -w /tmp/ci \
--entrypoint /bin/cp ${{ matrix.envoy_version }} /usr/local/bin/envoy .
echo $ENVOY_BIN_DIR >> $GITHUB_PATH
- name: Run unit tests
env:
Expand All @@ -145,8 +150,16 @@ jobs:
test_e2e:
# Not all the cases in E2E require secrets, so we run for all the events.
if: (github.event_name != 'pull_request_target' || contains(github.event.pull_request.labels.*.name, 'safe to test'))
name: E2E Test
name: E2E Test (Envoy Gateway ${{ matrix.name }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- name: v1.2.5
envoy_gateway_version: v1.2.5
- name: latest
envoy_gateway_version: v0.0.0-latest
steps:
- uses: actions/checkout@v4
if: github.event_name != 'pull_request_target'
Expand All @@ -170,6 +183,7 @@ jobs:
- uses: docker/setup-buildx-action@v3
- name: Run E2E tests
env:
EG_VERSION: ${{ matrix.envoy_gateway_version }}
TEST_AWS_ACCESS_KEY_ID: ${{ secrets.AWS_BEDROCK_USER_AWS_ACCESS_KEY_ID }}
TEST_AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_BEDROCK_USER_AWS_SECRET_ACCESS_KEY }}
TEST_OPENAI_API_KEY: ${{ secrets.ENVOY_AI_GATEWAY_OPENAI_API_KEY }}
Expand Down
10 changes: 9 additions & 1 deletion tests/e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ const (
egDefaultPort = 10080
)

var egVersion = func() string {
if v, ok := os.LookupEnv("EG_VERSION"); ok {
return v
} else {
return "v0.0.0-latest" // This defaults to the latest dev version.
}
}()

func initLog(msg string) {
fmt.Printf("\u001b[32m=== INIT LOG: %s\u001B[0m\n", msg)
}
Expand Down Expand Up @@ -113,7 +121,7 @@ func initEnvoyGateway(ctx context.Context) (err error) {
}()
initLog("\tHelm Install")
helm := exec.CommandContext(ctx, "helm", "upgrade", "-i", "eg",
"oci://docker.io/envoyproxy/gateway-helm", "--version", "v0.0.0-latest",
"oci://docker.io/envoyproxy/gateway-helm", "--version", egVersion,
"-n", "envoy-gateway-system", "--create-namespace")
helm.Stdout = os.Stdout
helm.Stderr = os.Stderr
Expand Down
Loading