You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
62 lines
1.4 KiB
62 lines
1.4 KiB
name: "Kafka Gateway Tests"
|
|
|
|
on:
|
|
push:
|
|
branches: [ master ]
|
|
pull_request:
|
|
branches: [ master ]
|
|
|
|
concurrency:
|
|
group: ${{ github.head_ref }}/kafka-tests
|
|
cancel-in-progress: true
|
|
|
|
# Force different runners for better isolation
|
|
env:
|
|
FORCE_RUNNER_SEPARATION: true
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
kafka-unit-tests:
|
|
name: Kafka Unit Tests
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 5
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
container-id: [unit-tests-1]
|
|
container:
|
|
image: golang:1.21-alpine
|
|
options: --cpus 1.0 --memory 1g --hostname kafka-unit-${{ matrix.container-id }}
|
|
env:
|
|
GOMAXPROCS: 1
|
|
CGO_ENABLED: 0
|
|
CONTAINER_ID: ${{ matrix.container-id }}
|
|
steps:
|
|
- name: Set up Go 1.x
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: ^1.21
|
|
id: go
|
|
|
|
- name: Check out code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Container Environment
|
|
run: |
|
|
apk add --no-cache git
|
|
ulimit -n 1024
|
|
|
|
- name: Get dependencies
|
|
run: |
|
|
cd test/kafka
|
|
go mod download
|
|
|
|
- name: Run Kafka Gateway Unit Tests (Excluding Integration Tests)
|
|
run: |
|
|
cd test/kafka
|
|
# Set process limits for container isolation
|
|
ulimit -n 512
|
|
ulimit -u 100
|
|
go test -v -timeout 10s -run "^Test" -skip "KafkaGateway_APISequence|KafkaGoClient_BasicProduceConsume|KafkaGoClient_ConsumerGroups|Sarama" ./...
|