Skip to content
Open
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
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ jobs:
go test -coverprofile=coverage.out ./...
go tool cover -func=coverage.out

- name: Run shell regression tests
run: make shell-tests

lint:
name: Lint
runs-on: ubuntu-latest
Expand Down
12 changes: 10 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ PCI_IDS_NVIDIA=pkg/networkoperatorplugin/internal/pciids/nvidia.ids
NIC_CONFIG_CRDS_DIR=pkg/nicconfigdaemon/assets/crds
NIC_CONFIG_OPERATOR_MODULE=github.com/Mellanox/nic-configuration-operator

.PHONY: all build clean test coverage deps lint docker-build docker-build-local docker-run update-readme download-sosreport update-pci-ids sync-network-operator-releases sync-nic-config-crds release release-snapshot help
.PHONY: all build clean test shell-tests coverage deps lint docker-build docker-build-local docker-run update-readme download-sosreport update-pci-ids sync-network-operator-releases sync-nic-config-crds release release-snapshot help

## Build the binary
build:
Expand Down Expand Up @@ -74,6 +74,14 @@ clean:
test:
$(GOTEST) -v ./...

## Run shell regression tests
shell-tests:
@for script in tests/*.sh; do \
[ -f "$$script" ] || continue; \
echo "Running $$script..."; \
bash "$$script"; \
done

## Run tests with coverage
coverage:
$(GOTEST) -v -coverprofile=coverage.out ./...
Expand Down Expand Up @@ -137,7 +145,7 @@ dev-install: build
dev-setup: deps lint-check test

## CI pipeline
ci: deps lint test build
ci: deps lint test shell-tests build

## Update README with help section
update-readme: build
Expand Down
4 changes: 2 additions & 2 deletions profiles/spectrum-x-ra2.2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ profile:
### Prerequisites

1. Kubernetes cluster with SR-IOV capable nodes
2. NVIDIA Network Operator v26.1.0 or later
2. NVIDIA Network Operator v26.4.0 or later
3. ConnectX-8, ConnectX-9, or BlueField-3 SuperNIC adapters
4. Firmware compatible with Spectrum-X RA2.2

Expand All @@ -189,7 +189,7 @@ helm repo update
helm install network-operator nvidia/network-operator \
--namespace nvidia-network-operator \
--create-namespace \
--version v26.1.0 \
--version v26.4.0 \
-f myValues.yaml \
--wait
```
Expand Down
18 changes: 18 additions & 0 deletions tests/test_spectrum_x_readme_versions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash
set -euo pipefail

README="profiles/spectrum-x-ra2.2/README.md"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Regression test bypasses automation

The new README assertions are not invoked by any CI workflow or Make test target, so future version regressions can pass CI unless someone runs this script manually.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!


# RA2.2 must not reference the RA2.1 Network Operator version
if grep -q 'v26\.1\.0' "$README"; then
echo "ERROR: $README still references Network Operator v26.1.0 (RA2.1)" >&2
exit 1
fi

# RA2.2 requires Network Operator 26.4+
if ! grep -q 'v26\.4\.0' "$README"; then
echo "ERROR: $README does not reference the required Network Operator v26.4.0" >&2
exit 1
fi

echo "OK: $README references the correct Network Operator version for RA2.2"