Skip to content
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
98 changes: 98 additions & 0 deletions .github/workflows/event-gateway-integration-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# --------------------------------------------------------------------
# Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com).
#
# WSO2 LLC. licenses this file to you under the Apache License,
# Version 2.0 (the "License"); you may not use this file except
# in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# --------------------------------------------------------------------

name: Event Gateway Integration Test

on:
workflow_dispatch:
pull_request:
branches:
- main
paths:
- 'event-gateway/**'
- 'gateway/gateway-controller/**'
- 'common/**'
- 'sdk/**'
- '.github/workflows/event-gateway-integration-test.yml'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true

jobs:
integration-test:
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
with:
persist-credentials: false
- name: Set up Go
uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0
with:
go-version: '1.26.2'
cache-dependency-path: '**/go.sum'

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0

- name: Read version
id: version
run: echo "version=$(cat event-gateway/VERSION)" >> $GITHUB_OUTPUT

- name: Build event-gateway-controller image
run: make -C event-gateway build-event-gateway-controller VERSION=${{ steps.version.outputs.version }}

- name: Build event-gateway-runtime image
run: make -C event-gateway build-gateway-runtime VERSION=${{ steps.version.outputs.version }}
Comment thread
coderabbitai[bot] marked this conversation as resolved.

- name: Build webhook-listener image
run: docker build -t event-gateway/webhook-listener:local event-gateway/webhook-listener

- name: Run integration tests
run: make -C event-gateway/it test

- name: Upload compose logs
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
if: always()
with:
name: compose-logs
path: event-gateway/it/logs/
retention-days: 7

- name: Debug on failure - Dump logs
if: failure()
run: |
echo "=== Docker Containers ==="
docker ps -a

echo ""
echo "=== event-gateway/it/logs Directory Contents ==="
if [ -d event-gateway/it/logs ]; then
if [ "$(ls -A event-gateway/it/logs)" ]; then
for f in event-gateway/it/logs/*; do
echo ""
echo "--- Contents of $f ---"
cat "$f"
done
else
echo "No log files found in event-gateway/it/logs."
fi
else
echo "Directory event-gateway/it/logs does not exist."
fi
2 changes: 2 additions & 0 deletions event-gateway/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ build-event-gateway-controller: ## Build event-gateway-controller Docker image
--build-arg GIT_COMMIT=$$(git rev-parse --short HEAD 2>/dev/null || echo "unknown") \
--target production \
-t $(EVENT_GATEWAY_CONTROLLER_IMAGE):$(VERSION) \
-t $(EVENT_GATEWAY_CONTROLLER_IMAGE):latest \
--load \
.
@rm -rf ../gateway/gateway-controller/target
Expand Down Expand Up @@ -127,6 +128,7 @@ build-and-push-multiarch-event-gateway-controller: ## Build and push event-gatew
--build-arg GIT_COMMIT=$$(git rev-parse --short HEAD 2>/dev/null || echo "unknown") \
--target production \
-t $(EVENT_GATEWAY_CONTROLLER_IMAGE):$(VERSION) \
-t $(EVENT_GATEWAY_CONTROLLER_IMAGE):latest \
--push \
.
@rm -rf ../gateway/gateway-controller/target
Expand Down
4 changes: 2 additions & 2 deletions event-gateway/docker-compose.dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

services:
gateway-controller:
image: ghcr.io/wso2/api-platform/event-gateway-controller:0.6.0-SNAPSHOT
image: ghcr.io/wso2/api-platform/event-gateway-controller:latest
command: ["-config", "/etc/gateway-controller/config.toml"]
ports:
- "9090:9090" # Management API
Expand All @@ -45,7 +45,7 @@ services:
- egw-network

event-gateway:
image: ghcr.io/wso2/api-platform/event-gateway-runtime:0.6.0-SNAPSHOT
image: ghcr.io/wso2/api-platform/event-gateway-runtime:latest
ports:
- "8080:8080" # WebSub HTTP
- "8443:8443" # WebSub HTTPS
Expand Down
3 changes: 3 additions & 0 deletions event-gateway/gateway-runtime/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ build-docker: ## Build Docker image
--build-arg VERSION=$(VERSION) \
--build-arg GIT_COMMIT=$(GIT_COMMIT) \
-t $(IMAGE_NAME):$(VERSION) \
-t $(IMAGE_NAME):latest \
-f Dockerfile .
@rm -rf target
@echo "✓ Built $(IMAGE_NAME):$(VERSION)"
Expand All @@ -117,6 +118,7 @@ build-debug: ## Build Docker image with Delve remote debugger (port 2345)
--build-arg VERSION=$(VERSION) \
--build-arg GIT_COMMIT=$(GIT_COMMIT) \
-t $(IMAGE_NAME)-debug:$(VERSION) \
-t $(IMAGE_NAME)-debug:latest \
-f Dockerfile.debug .
@rm -rf target
@echo "✓ Built $(IMAGE_NAME)-debug:$(VERSION) (Delve on :2345)"
Expand All @@ -139,6 +141,7 @@ build-and-push-multiarch: ## Build and push Docker image for multiple architectu
--build-arg VERSION=$(VERSION) \
--build-arg GIT_COMMIT=$(GIT_COMMIT) \
-t $(IMAGE_NAME):$(VERSION) \
-t $(IMAGE_NAME):latest \
-f Dockerfile .
@rm -rf target
@echo "✓ Built and pushed $(IMAGE_NAME):$(VERSION) for linux/amd64,linux/arm64"
Expand Down
58 changes: 58 additions & 0 deletions event-gateway/it/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# --------------------------------------------------------------------
# Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com).
#
# WSO2 LLC. licenses this file to you under the Apache License,
# Version 2.0 (the "License"); you may not use this file except
# in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# --------------------------------------------------------------------

# Event Gateway Integration Tests
SHELL := /bin/bash

.DEFAULT_GOAL := help

.PHONY: help
help: ## Show available targets
@echo 'Event Gateway Integration Tests'
@echo ''
@echo 'Usage:'
@echo ' make test Run the full integration test suite'
@echo ' make test-health Run only health-check scenarios'
@echo ' make test-websub Run only WebSub management scenarios'
@echo ' make test-e2e Run only end-to-end WebSub flow scenarios'
@echo ' make tidy Run go mod tidy'
@echo ' make clean Remove generated logs and test artefacts'

.PHONY: test
test: ## Run all integration tests
go test -v -timeout 10m ./...

.PHONY: test-health
test-health: ## Run health check feature only
IT_FEATURE_PATHS=health.feature go test -v -timeout 5m ./...

.PHONY: test-websub
test-websub: ## Run WebSub API management feature only
IT_FEATURE_PATHS=websub-api-management.feature go test -v -timeout 5m ./...

.PHONY: test-e2e
test-e2e: ## Run WebSub end-to-end feature only
IT_FEATURE_PATHS=websub-e2e.feature go test -v -timeout 10m ./...

.PHONY: tidy
tidy: ## Tidy go modules
go mod tidy

.PHONY: clean
clean: ## Remove generated artefacts
rm -rf logs/
37 changes: 37 additions & 0 deletions event-gateway/it/features/health.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# --------------------------------------------------------------------
# Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com).
#
# WSO2 LLC. licenses this file to you under the Apache License,
# Version 2.0 (the "License"); you may not use this file except
# in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# --------------------------------------------------------------------

Feature: Event Gateway Health Checks
As an operator
I want to verify that event gateway services are healthy
So that I can ensure the gateway is operational

Background:
Given the event gateway services are running

Scenario: Event gateway liveness probe returns UP
When I send a GET request to the event gateway health endpoint
Then the response status code should be 200
And the response should be valid JSON
And the response should indicate UP status

Scenario: Event gateway readiness probe returns READY
When I send a GET request to the event gateway ready endpoint
Then the response status code should be 200
And the response should be valid JSON
And the response should indicate READY status
Loading
Loading