| 1 |
name: MQTT External Tests |
| 2 |
on: [pull_request] |
| 3 |
|
| 4 |
permissions: |
| 5 |
contents: read |
| 6 |
|
| 7 |
jobs: |
| 8 |
test: |
| 9 |
env: |
| 10 |
GOPATH: /home/runner/work/nats-server |
| 11 |
GO111MODULE: "on" |
| 12 |
runs-on: ${{ vars.GHA_WORKER_SMALL || 'ubuntu-latest' }} |
| 13 |
steps: |
| 14 |
- name: Checkout code |
| 15 |
uses: actions/checkout@v6 |
| 16 |
with: |
| 17 |
path: src/github.com/nats-io/nats-server |
| 18 |
|
| 19 |
- name: Setup Go |
| 20 |
uses: actions/setup-go@v6 |
| 21 |
with: |
| 22 |
go-version: stable |
| 23 |
cache-dependency-path: src/github.com/nats-io/nats-server/go.sum |
| 24 |
|
| 25 |
- name: Set up testing tools and environment |
| 26 |
shell: bash --noprofile --norc -eo pipefail {0} |
| 27 |
id: setup |
| 28 |
run: | |
| 29 |
wget https://github.com/hivemq/mqtt-cli/releases/download/v4.20.0/mqtt-cli-4.20.0.deb |
| 30 |
sudo apt install ./mqtt-cli-4.20.0.deb |
| 31 |
go install github.com/ConnectEverything/[email protected] |
| 32 |
|
| 33 |
- name: Run tests (3 times to detect flappers) |
| 34 |
shell: bash --noprofile --norc -eo pipefail {0} |
| 35 |
run: | |
| 36 |
cd src/github.com/nats-io/nats-server |
| 37 |
go test -v --count=3 --run='TestXMQTT' ./server |
| 38 |
|
| 39 |
- name: Run tests with --race |
| 40 |
shell: bash --noprofile --norc -eo pipefail {0} |
| 41 |
run: | |
| 42 |
cd src/github.com/nats-io/nats-server |
| 43 |
go test -v --race --failfast --run='TestXMQTT' ./server |
| 44 |
|
| 45 |
- name: Run benchmarks |
| 46 |
shell: bash --noprofile --norc -eo pipefail {0} |
| 47 |
run: | |
| 48 |
cd src/github.com/nats-io/nats-server |
| 49 |
go test --run='-' --count=3 --bench 'BenchmarkXMQTT' --benchtime=100x ./server |
| 50 |
|
| 51 |
# TODO: compare benchmarks |