From 38ff8ff418198a0465a18e0f0a58b0f4435f428a Mon Sep 17 00:00:00 2001 From: Lev Brouk Date: Wed, 4 Dec 2024 06:30:12 -0800 Subject: [PATCH 1/7] GITHUB only run what I need --- .github/workflows/tests.yaml | 256 +---------------------------------- 1 file changed, 2 insertions(+), 254 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 09249ff0d50..f0fc154f89e 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -10,131 +10,8 @@ concurrency: cancel-in-progress: true jobs: - lint: - name: Lint - runs-on: ${{ vars.GHA_WORKER_SMALL }} - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Install Go - uses: actions/setup-go@v5 - with: - go-version: stable - - - name: Run golangci-lint - uses: golangci/golangci-lint-action@v6 - with: - skip-cache: true - skip-pkg-cache: true - skip-build-cache: true - args: --timeout=5m --config=.golangci.yml - - build-latest: - name: Build (Latest Go) - runs-on: ${{ vars.GHA_WORKER_SMALL }} - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Install Go - uses: actions/setup-go@v5 - with: - go-version: stable - - - name: Build NATS Server - run: go build - - build-supported: - name: Build (Minimum Go) - runs-on: ${{ vars.GHA_WORKER_SMALL }} - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Install Go - uses: actions/setup-go@v5 - with: - go-version-file: "go.mod" - - - name: Build NATS Server - run: go build - - # Using GitHub-supplied workers for Windows for now. - # Note that the below testing steps depend on the Linux build - # only, as the Windows builds take a fair bit longer to set up. - build-windows: - name: Build (Minimum Go, ${{ matrix.os }}) - strategy: - fail-fast: false - matrix: - os: [windows-2019, windows-2022] - runs-on: ${{ matrix.os }} - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Install Go - uses: actions/setup-go@v5 - with: - go-version-file: "go.mod" - - - name: Build NATS Server - run: go build - - store: - name: Store tests - needs: [build-latest, build-supported, lint] - runs-on: ${{ vars.GHA_WORKER_MEDIUM }} - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Install Go - uses: actions/setup-go@v5 - with: - go-version: stable - - - name: Run unit tests - run: | - go test -race -v -run=TestMemStore ./server/... -count=1 -vet=off -timeout=30m -failfast - go test -race -v -run=TestFileStore ./server/... -count=1 -vet=off -timeout=30m -failfast - - js-no-cluster: - name: JetStream tests - needs: [build-latest, build-supported, lint] - runs-on: ${{ vars.GHA_WORKER_LARGE }} - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Install Go - uses: actions/setup-go@v5 - with: - go-version: stable - - - name: Run unit tests - run: go test -race -v -run=TestJetStream ./server/... -tags=skip_js_cluster_tests,skip_js_cluster_tests_2,skip_js_cluster_tests_3,skip_js_cluster_tests_4,skip_js_super_cluster_tests -count=1 -vet=off -timeout=30m -failfast - js-cluster-1: - name: JetStream Cluster tests (1) - needs: [build-latest, build-supported, lint] - runs-on: ${{ vars.GHA_WORKER_LARGE }} - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Install Go - uses: actions/setup-go@v5 - with: - go-version: stable - - - name: Run unit tests - run: go test -race -v -run=TestJetStreamCluster ./server/... -tags=skip_js_cluster_tests_2,skip_js_cluster_tests_3,skip_js_cluster_tests_4 -count=1 -vet=off -timeout=30m -failfast - - js-cluster-2: - name: JetStream Cluster tests (2) - needs: [build-latest, build-supported, lint] + name: Lev MQTT test runs-on: ${{ vars.GHA_WORKER_LARGE }} steps: - name: Checkout @@ -146,133 +23,4 @@ jobs: go-version: stable - name: Run unit tests - run: go test -race -v -run=TestJetStreamCluster ./server/... -tags=skip_js_cluster_tests,skip_js_cluster_tests_3,skip_js_cluster_tests_4 -count=1 -vet=off -timeout=30m -failfast - - js-cluster-3: - name: JetStream Cluster tests (3) - needs: [build-latest, build-supported, lint] - runs-on: ${{ vars.GHA_WORKER_LARGE }} - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Install Go - uses: actions/setup-go@v5 - with: - go-version: stable - - - name: Run unit tests - run: go test -race -v -run=TestJetStreamCluster ./server/... -tags=skip_js_cluster_tests,skip_js_cluster_tests_2,skip_js_cluster_tests_4 -count=1 -vet=off -timeout=30m -failfast - - js-cluster-4: - name: JetStream Cluster tests (4) - needs: [build-latest, build-supported, lint] - runs-on: ${{ vars.GHA_WORKER_LARGE }} - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Install Go - uses: actions/setup-go@v5 - with: - go-version: stable - - - name: Run unit tests - run: go test -race -v -run=TestJetStreamCluster ./server/... -tags=skip_js_cluster_tests,skip_js_cluster_tests_2,skip_js_cluster_tests_3 -count=1 -vet=off -timeout=30m -failfast - - js-supercluster: - name: JetStream Supercluster tests - needs: [build-latest, build-supported, lint] - runs-on: ${{ vars.GHA_WORKER_LARGE }} - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Install Go - uses: actions/setup-go@v5 - with: - go-version: stable - - - name: Run unit tests - run: go test -race -v -run=TestJetStreamSuperCluster ./server/... -count=1 -vet=off -timeout=30m -failfast - - no-race: - name: No-race tests - needs: [build-latest, build-supported, lint] - runs-on: ${{ vars.GHA_WORKER_LARGE }} - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Install Go - uses: actions/setup-go@v5 - with: - go-version: stable - - - name: Run unit tests - run: go test -v -p=1 -run=TestNoRace ./... -count=1 -vet=off -timeout=30m -failfast - - mqtt: - name: MQTT tests - needs: [build-latest, build-supported, lint] - runs-on: ${{ vars.GHA_WORKER_MEDIUM }} - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Install Go - uses: actions/setup-go@v5 - with: - go-version: stable - - - name: Run unit tests - run: go test -race -v -run=TestMQTT ./server/... -count=1 -vet=off -timeout=30m -failfast - - msgtrace: - name: MsgTrace tests - needs: [build-latest, build-supported, lint] - runs-on: ${{ vars.GHA_WORKER_MEDIUM }} - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Install Go - uses: actions/setup-go@v5 - with: - go-version: stable - - - name: Run unit tests - run: go test -race -v -run=TestMsgTrace ./server/... -count=1 -vet=off -timeout=30m -failfast - - server-pkg-non-js: - name: Non-JetStream/MQTT/MsgTrace tests - needs: [build-latest, build-supported, lint] - runs-on: ${{ vars.GHA_WORKER_LARGE }} - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Install Go - uses: actions/setup-go@v5 - with: - go-version: stable - - - name: Run unit tests - run: go test -race -v -p=1 ./server/... -tags=skip_js_tests,skip_store_tests,skip_mqtt_tests,skip_msgtrace_tests -count=1 -vet=off -timeout=30m -failfast - timeout-minutes: 15 - - non-server-pkg: - name: Tests from all other packages - needs: [build-latest, build-supported, lint] - runs-on: ${{ vars.GHA_WORKER_MEDIUM }} - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Install Go - uses: actions/setup-go@v5 - with: - go-version: stable - - - name: Run unit tests - run: go test -race -v -p=1 ./conf/... ./internal/... ./logger/... ./test/... -count=1 -vet=off -timeout=30m -failfast + run: go test -race -v -run=TestMQTTSubRetained ./server/... -count=100 -timeout=30m -failfast From b7962a773c26c1d20ac5dba70dc7738d88c22e96 Mon Sep 17 00:00:00 2001 From: Lev Brouk Date: Wed, 4 Dec 2024 06:32:57 -0800 Subject: [PATCH 2/7] GITHUB only run what I need, +1 --- .github/workflows/tests.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index f0fc154f89e..76035183957 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -1,8 +1,8 @@ name: NATS Server Tests on: - # push: - # pull_request: + push: + pull_request: workflow_dispatch: concurrency: From 997bf81b39fb64bbc0df3b7880131d5d35d98312 Mon Sep 17 00:00:00 2001 From: Lev Brouk Date: Wed, 4 Dec 2024 06:37:15 -0800 Subject: [PATCH 3/7] GITHUB only run what I need, +2 --- .github/workflows/tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 76035183957..dd255a8452a 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -12,7 +12,7 @@ concurrency: jobs: js-cluster-1: name: Lev MQTT test - runs-on: ${{ vars.GHA_WORKER_LARGE }} + runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 From 6a401b923f1c6d706c19af75365eb0f8e98ee5aa Mon Sep 17 00:00:00 2001 From: Lev Brouk Date: Wed, 4 Dec 2024 06:38:15 -0800 Subject: [PATCH 4/7] GITHUB only run what I need, +3 --- .github/workflows/mqtt-test.yaml | 82 ++++++++++++++++---------------- .github/workflows/tests.yaml | 4 +- 2 files changed, 43 insertions(+), 43 deletions(-) diff --git a/.github/workflows/mqtt-test.yaml b/.github/workflows/mqtt-test.yaml index 893837e6b60..364480c2d9a 100644 --- a/.github/workflows/mqtt-test.yaml +++ b/.github/workflows/mqtt-test.yaml @@ -1,48 +1,48 @@ -name: MQTT external test -on: [pull_request] +# name: MQTT external test +# on: [pull_request] -jobs: - test: - env: - GOPATH: /home/runner/work/nats-server - GO111MODULE: "on" - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - path: src/github.com/nats-io/nats-server +# jobs: +# test: +# env: +# GOPATH: /home/runner/work/nats-server +# GO111MODULE: "on" +# runs-on: ubuntu-latest +# steps: +# - name: Checkout code +# uses: actions/checkout@v4 +# with: +# path: src/github.com/nats-io/nats-server - - name: Setup Go - uses: actions/setup-go@v5 - with: - go-version-file: src/github.com/nats-io/nats-server/go.mod - cache-dependency-path: src/github.com/nats-io/nats-server/go.sum +# - name: Setup Go +# uses: actions/setup-go@v5 +# with: +# go-version-file: src/github.com/nats-io/nats-server/go.mod +# cache-dependency-path: src/github.com/nats-io/nats-server/go.sum - - name: Set up testing tools and environment - shell: bash --noprofile --norc -eo pipefail {0} - id: setup - run: | - wget https://github.com/hivemq/mqtt-cli/releases/download/v4.20.0/mqtt-cli-4.20.0.deb - sudo apt install ./mqtt-cli-4.20.0.deb - go install github.com/ConnectEverything/mqtt-test@v0.1.0 +# - name: Set up testing tools and environment +# shell: bash --noprofile --norc -eo pipefail {0} +# id: setup +# run: | +# wget https://github.com/hivemq/mqtt-cli/releases/download/v4.20.0/mqtt-cli-4.20.0.deb +# sudo apt install ./mqtt-cli-4.20.0.deb +# go install github.com/ConnectEverything/mqtt-test@v0.1.0 - - name: Run tests (3 times to detect flappers) - shell: bash --noprofile --norc -eo pipefail {0} - run: | - cd src/github.com/nats-io/nats-server - go test -v --count=3 --run='TestXMQTT' ./server +# - name: Run tests (3 times to detect flappers) +# shell: bash --noprofile --norc -eo pipefail {0} +# run: | +# cd src/github.com/nats-io/nats-server +# go test -v --count=3 --run='TestXMQTT' ./server - - name: Run tests with --race - shell: bash --noprofile --norc -eo pipefail {0} - run: | - cd src/github.com/nats-io/nats-server - go test -v --race --failfast --run='TestXMQTT' ./server +# - name: Run tests with --race +# shell: bash --noprofile --norc -eo pipefail {0} +# run: | +# cd src/github.com/nats-io/nats-server +# go test -v --race --failfast --run='TestXMQTT' ./server - - name: Run benchmarks - shell: bash --noprofile --norc -eo pipefail {0} - run: | - cd src/github.com/nats-io/nats-server - go test --run='-' --count=3 --bench 'BenchmarkXMQTT' --benchtime=100x ./server +# - name: Run benchmarks +# shell: bash --noprofile --norc -eo pipefail {0} +# run: | +# cd src/github.com/nats-io/nats-server +# go test --run='-' --count=3 --bench 'BenchmarkXMQTT' --benchtime=100x ./server - # TODO: compare benchmarks +# # TODO: compare benchmarks diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index dd255a8452a..89bd8a49477 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -2,8 +2,8 @@ name: NATS Server Tests on: push: - pull_request: - workflow_dispatch: + # pull_request: + # workflow_dispatch: concurrency: group: ${{ github.workflow }}-${{ github.ref }} From c33fcbec40c38432b767b7b2853436b3c7e30f6c Mon Sep 17 00:00:00 2001 From: Lev Brouk Date: Wed, 4 Dec 2024 06:38:46 -0800 Subject: [PATCH 5/7] GITHUB only run what I need, +4 --- .github/workflows/tests.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 89bd8a49477..13648b8a58a 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -1,8 +1,8 @@ name: NATS Server Tests on: - push: - # pull_request: + # push: + pull_request: # workflow_dispatch: concurrency: From e2779dcfefbda0bdb41ab1a79a541e3e33853e79 Mon Sep 17 00:00:00 2001 From: Lev Brouk Date: Wed, 4 Dec 2024 06:41:36 -0800 Subject: [PATCH 6/7] GITHUB only run what I need, +4 --- .github/workflows/tests.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 13648b8a58a..d7ab245a002 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -1,8 +1,8 @@ name: NATS Server Tests on: - # push: - pull_request: + push: + # pull_request: # workflow_dispatch: concurrency: @@ -23,4 +23,4 @@ jobs: go-version: stable - name: Run unit tests - run: go test -race -v -run=TestMQTTSubRetained ./server/... -count=100 -timeout=30m -failfast + run: go test -v -run=TestMQTTSubRetained ./server -count=10 -timeout=30m -failfast From 3f4f6a36969b76d7f6faf79688ab83788d009a9b Mon Sep 17 00:00:00 2001 From: Lev Brouk Date: Wed, 4 Dec 2024 06:44:01 -0800 Subject: [PATCH 7/7] GITHUB only run what I need, +5 --- .github/workflows/tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index d7ab245a002..bc8d230bf88 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -23,4 +23,4 @@ jobs: go-version: stable - name: Run unit tests - run: go test -v -run=TestMQTTSubRetained ./server -count=10 -timeout=30m -failfast + run: go test -race -v -run=TestMQTTSubRetained ./server -count=10 -timeout=30m -failfast