-
Notifications
You must be signed in to change notification settings - Fork 84
Event Gateway Integration test module #2019
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 }} | ||
|
|
||
| - 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 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.