chore: update e2e functional test to confirm each Rollout only has one child at the end; also consolidate some logic into a function #1832
Workflow file for this run
This file contains 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
name: CI | |
on: | |
push: | |
branches: | |
- "main" | |
pull_request: | |
branches: | |
- "main" | |
jobs: | |
codegen: | |
name: Codegen | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Restore go build cache | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/go-build | |
key: ${{ runner.os }}-go-build-v1-${{ hashFiles('**/go.mod') }} | |
- name: Setup Golang | |
uses: actions/[email protected] | |
with: | |
go-version: '1.23' | |
- name: Add bins to PATH | |
run: | | |
echo /home/runner/go/bin >> $GITHUB_PATH | |
echo /usr/local/bin >> $GITHUB_PATH | |
- name: Get dependencies | |
run: go mod download | |
- name: Make codegen | |
run: | | |
echo 'GOPATH=/home/runner/go' >> $GITHUB_ENV | |
make -B codegen | |
- name: Ensure nothing changed | |
run: git diff --exit-code | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
env: | |
GOPATH: /home/runner/go | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Golang | |
uses: actions/setup-go@v5 | |
with: | |
go-version: '1.23' | |
- name: golangci-lint | |
uses: golangci/golangci-lint-action@v6 | |
with: | |
version: v1.61 | |
args: --timeout=10m | |
unit-tests: | |
name: Unit Tests | |
runs-on: ubuntu-latest | |
timeout-minutes: 15 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Golang | |
uses: actions/[email protected] | |
with: | |
go-version: '1.23' | |
id: go | |
- name: Install MockGen | |
run: go install github.com/golang/mock/[email protected] | |
- name: Restore Go build cache | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/go-build | |
key: ${{ runner.os }}-go-build-v1-${{ github.run_id }} | |
- name: Get dependencies | |
run: go mod download | |
- name: Test | |
run: make test | |
- name: Upload coverage reports to Codecov | |
uses: codecov/[email protected] | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
slug: numaproj/numaplane | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Verify docker image | |
run: make image | |
e2e-tests: | |
name: E2E Tests | |
runs-on: ubuntu-latest | |
# We already have a timeout in "go test" call: we don't also need this | |
#timeout-minutes: 35 # If we start getting error in CI as "The operation was canceled", we need to increase this value. | |
strategy: | |
fail-fast: false | |
matrix: | |
strategy: ["pause-and-drain", "progressive", "no-strategy"] | |
case: ["functional"] | |
include: | |
- strategy: "pause-and-drain" | |
case: "ppnd" | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Restore go build cache | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/go-build | |
key: ${{ runner.os }}-go-build-v1-${{ hashFiles('**/go.mod') }} | |
- name: Setup Golang | |
uses: actions/[email protected] | |
with: | |
go-version: '1.23' | |
- name: Add bins to PATH | |
run: | | |
echo /home/runner/go/bin >> $GITHUB_PATH | |
echo /usr/local/bin >> $GITHUB_PATH | |
- name: Install k3d | |
run: | | |
curl -sfL https://raw.githubusercontent.com/rancher/k3d/main/install.sh | bash | |
echo 'k3d installed' | |
k3d --version | |
- name: Create a cluster | |
run: | | |
export PATH=$PATH:/usr/local/bin | |
k3d cluster create e2e --runtime-ulimit "nofile=65535:65535" | |
k3d kubeconfig get e2e > ~/.kube/config | |
echo '127.0.0.1 localhost' | sudo tee -a /etc/hosts | |
echo 'Waiting for the cluster to be ready...' | |
until kubectl cluster-info; do sleep 1; done | |
- name: Install Numaplane | |
env: | |
GOPATH: /home/runner/go | |
run: | |
KUBECONFIG=~/.kube/config VERSION=${{ github.sha }} DOCKER_PUSH=true STRATEGY=${{matrix.strategy}} make start | |
- name: Run e2e tests | |
env: | |
GOPATH: /home/runner/go | |
run: KUBECONFIG=~/.kube/config VERSION=${{ github.sha }} DOCKER_PUSH=true STRATEGY=${{matrix.strategy}} ENABLE_POD_LOGS=true make test-${{matrix.case}}-e2e | |
- name: Archive resource changes | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: resource-changes-${{matrix.strategy}}-${{matrix.case}} | |
path: | | |
tests/e2e/output/resources/ | |
retention-days: 7 | |
- name: Archive pod logs | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: pod-logs-${{matrix.strategy}}-${{matrix.case}} | |
path: | | |
tests/e2e/output/logs/ | |
retention-days: 7 |