Skip to content

Commit

Permalink
Merge pull request #240 from Elbehery/rebase-etcd-3.5.11-openshift-4.12
Browse files Browse the repository at this point in the history
OCPBUGS-27102: Rebase etcd 3.5.11 openshift 4.12
  • Loading branch information
openshift-merge-bot[bot] committed Jan 19, 2024
2 parents 6c571f4 + 908a566 commit bb43fb5
Show file tree
Hide file tree
Showing 96 changed files with 3,187 additions and 1,307 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/e2e.yaml
@@ -1,11 +1,8 @@
name: E2E
on: [push, pull_request]
jobs:
goversion:
uses: ./.github/workflows/go-version.yaml
test:
runs-on: ubuntu-latest
needs: goversion
strategy:
fail-fast: true
matrix:
Expand All @@ -14,9 +11,11 @@ jobs:
- linux-386-e2e
steps:
- uses: actions/checkout@v2
- id: goversion
run: echo "goversion=$(cat .go-version)" >> "$GITHUB_OUTPUT"
- uses: actions/setup-go@v2
with:
go-version: ${{ needs.goversion.outputs.goversion }}
go-version: ${{ steps.goversion.outputs.goversion }}
- run: date
- env:
TARGET: ${{ matrix.target }}
Expand All @@ -26,10 +25,10 @@ jobs:
echo "${TARGET}"
case "${TARGET}" in
linux-amd64-e2e)
PASSES='build release e2e' MANUAL_VER=v3.4.7 CPU='4' EXPECT_DEBUG='true' COVER='false' RACE='true' ./test.sh
CPU='4' EXPECT_DEBUG='true' COVER='false' RACE='true' make test-e2e-release
;;
linux-386-e2e)
GOARCH=386 PASSES='build e2e' CPU='4' EXPECT_DEBUG='true' COVER='false' RACE='true' ./test.sh
GOARCH=386 CPU='4' EXPECT_DEBUG='true' COVER='false' RACE='true' make test-e2e
;;
*)
echo "Failed to find target"
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/functional.yaml
@@ -1,21 +1,20 @@
name: functional-tests
on: [push, pull_request]
jobs:
goversion:
uses: ./.github/workflows/go-version.yaml
test:
runs-on: ubuntu-latest
needs: goversion
strategy:
fail-fast: true
matrix:
target:
- linux-amd64-functional
steps:
- uses: actions/checkout@v2
- id: goversion
run: echo "goversion=$(cat .go-version)" >> "$GITHUB_OUTPUT"
- uses: actions/setup-go@v2
with:
go-version: ${{ needs.goversion.outputs.goversion }}
go-version: ${{ steps.goversion.outputs.goversion }}
- run: date
- env:
TARGET: ${{ matrix.target }}
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/grpcproxy.yaml
@@ -1,21 +1,20 @@
name: grpcProxy-tests
on: [push, pull_request]
jobs:
goversion:
uses: ./.github/workflows/go-version.yaml
test:
runs-on: ubuntu-latest
needs: goversion
strategy:
fail-fast: true
matrix:
target:
- linux-amd64-grpcproxy
steps:
- uses: actions/checkout@v2
- id: goversion
run: echo "goversion=$(cat .go-version)" >> "$GITHUB_OUTPUT"
- uses: actions/setup-go@v2
with:
go-version: ${{ needs.goversion.outputs.goversion }}
go-version: ${{ steps.goversion.outputs.goversion }}
- run: date
- env:
TARGET: ${{ matrix.target }}
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/release.yaml
@@ -1,16 +1,15 @@
name: Release
on: [push, pull_request]
jobs:
goversion:
uses: ./.github/workflows/go-version.yaml
main:
runs-on: ubuntu-latest
needs: goversion
steps:
- uses: actions/checkout@v2
- id: goversion
run: echo "goversion=$(cat .go-version)" >> "$GITHUB_OUTPUT"
- uses: actions/setup-go@v2
with:
go-version: ${{ needs.goversion.outputs.goversion }}
go-version: ${{ steps.goversion.outputs.goversion }}
- name: release
run: |
set -euo pipefail
Expand Down
70 changes: 70 additions & 0 deletions .github/workflows/tests-template.yaml
@@ -0,0 +1,70 @@
---
name: Reusable Tests Workflow
on:
workflow_call:
inputs:
arch:
required: true
type: string
runs-on:
required: true
type: string
targets:
required: false
type: string

jobs:
test:
runs-on: ${{ inputs.runs-on }}
# this is to prevent arm64 jobs from running at forked projects
if: inputs.arch == 'amd64' || github.repository == 'etcd-io/etcd'
strategy:
fail-fast: false
matrix:
target: ${{ fromJSON(inputs.targets) }}
steps:
- uses: actions/checkout@v2
- id: goversion
run: echo "goversion=$(cat .go-version)" >> "$GITHUB_OUTPUT"
- uses: actions/setup-go@v2
with:
go-version: ${{ steps.goversion.outputs.goversion }}
- run: date
- env:
TARGET: ${{ matrix.target }}
run: |
set -euo pipefail
echo "${TARGET}"
case "${TARGET}" in
linux-integration-1-cpu)
GOARCH=${{ inputs.arch }} CPU=1 RACE='false' make test-integration
;;
linux-integration-2-cpu)
GOARCH=${{ inputs.arch }} CPU=2 RACE='false' make test-integration
;;
linux-integration-4-cpu)
GOARCH=${{ inputs.arch }} CPU=4 RACE='false' make test-integration
;;
linux-unit-4-cpu-race)
GOARCH=${{ inputs.arch }} RACE='true' CPU='4' GO_TEST_FLAGS='-p=2' make test-unit
;;
linux-386-unit-1-cpu)
GOOS=linux GOARCH=386 CPU=1 GO_TEST_FLAGS='-p=4' make test-unit
;;
all-build)
GOARCH=amd64 PASSES='build' ./test.sh
GOARCH=386 PASSES='build' ./test.sh
GO_BUILD_FLAGS='-v -mod=readonly' GOOS=darwin GOARCH=amd64 ./build.sh
GO_BUILD_FLAGS='-v -mod=readonly' GOOS=darwin GOARCH=arm64 ./build.sh
GO_BUILD_FLAGS='-v -mod=readonly' GOOS=windows GOARCH=amd64 ./build.sh
GO_BUILD_FLAGS='-v -mod=readonly' GOARCH=arm ./build.sh
GO_BUILD_FLAGS='-v -mod=readonly' GOARCH=arm64 ./build.sh
GO_BUILD_FLAGS='-v -mod=readonly' GOARCH=ppc64le ./build.sh
GO_BUILD_FLAGS='-v -mod=readonly' GOARCH=s390x ./build.sh
;;
*)
echo "Failed to find target"
exit 1
;;
esac
83 changes: 20 additions & 63 deletions .github/workflows/tests.yaml
@@ -1,66 +1,23 @@
name: Tests
on: [push, pull_request]
jobs:
goversion:
uses: ./.github/workflows/go-version.yaml
test:
runs-on: ubuntu-latest
needs: goversion
strategy:
fail-fast: false
matrix:
target:
- linux-amd64-fmt
- linux-amd64-integration-1-cpu
- linux-amd64-integration-2-cpu
- linux-amd64-integration-4-cpu
- linux-amd64-unit-4-cpu-race
- all-build
- linux-386-unit-1-cpu
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: ${{ needs.goversion.outputs.goversion }}
- run: date
- env:
TARGET: ${{ matrix.target }}
run: |
set -euo pipefail
echo "${TARGET}"
case "${TARGET}" in
linux-amd64-fmt)
GOARCH=amd64 PASSES='fmt bom dep' ./test.sh
;;
linux-amd64-integration-1-cpu)
GOARCH=amd64 CPU=1 PASSES='integration' RACE='false' ./test.sh
;;
linux-amd64-integration-2-cpu)
GOARCH=amd64 CPU=2 PASSES='integration' RACE='false' ./test.sh
;;
linux-amd64-integration-4-cpu)
GOARCH=amd64 CPU=4 PASSES='integration' RACE='false' ./test.sh
;;
linux-amd64-unit-4-cpu-race)
GOARCH=amd64 PASSES='unit' RACE='true' CPU='4' ./test.sh -p=2
;;
all-build)
GOARCH=amd64 PASSES='build' ./test.sh
GOARCH=386 PASSES='build' ./test.sh
GO_BUILD_FLAGS='-v -mod=readonly' GOOS=darwin GOARCH=amd64 ./build.sh
GO_BUILD_FLAGS='-v -mod=readonly' GOOS=darwin GOARCH=arm64 ./build.sh
GO_BUILD_FLAGS='-v -mod=readonly' GOOS=windows GOARCH=amd64 ./build.sh
GO_BUILD_FLAGS='-v -mod=readonly' GOARCH=arm ./build.sh
GO_BUILD_FLAGS='-v -mod=readonly' GOARCH=arm64 ./build.sh
GO_BUILD_FLAGS='-v -mod=readonly' GOARCH=ppc64le ./build.sh
GO_BUILD_FLAGS='-v -mod=readonly' GOARCH=s390x ./build.sh
;;
linux-386-unit-1-cpu)
GOARCH=386 PASSES='unit' RACE='false' CPU='1' ./test -p=4
;;
*)
echo "Failed to find target"
exit 1
;;
esac
amd64:
uses: ./.github/workflows/tests-template.yaml
with:
arch: amd64
runs-on: ubuntu-latest
targets: "['linux-integration-1-cpu',
'linux-integration-2-cpu',
'linux-integration-4-cpu',
'linux-unit-4-cpu-race',
'linux-386-unit-1-cpu',
'all-build']"
arm64:
uses: ./.github/workflows/tests-template.yaml
with:
arch: arm64
runs-on: actuated-arm64-8cpu-32gb
targets: "['linux-integration-1-cpu',
'linux-integration-2-cpu',
'linux-integration-4-cpu',
'linux-unit-4-cpu-race']"
2 changes: 1 addition & 1 deletion .go-version
@@ -1 +1 @@
1.19.9
1.20.12
33 changes: 33 additions & 0 deletions Documentation/dev-guide/apispec/swagger/rpc.swagger.json
Expand Up @@ -1276,6 +1276,39 @@
}
},
"/v3/maintenance/hash": {
"post": {
"tags": [
"Maintenance"
],
"summary": "Hash computes the hash of whole backend keyspace,\nincluding key, lease, and other buckets in storage.\nThis is designed for testing ONLY!\nDo not rely on this in production with ongoing transactions,\nsince Hash operation does not hold MVCC locks.\nUse \"HashKV\" API instead for \"key\" bucket consistency checks.",
"operationId": "Maintenance_Hash",
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/etcdserverpbHashRequest"
}
}
],
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/etcdserverpbHashResponse"
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
}
}
}
},
"/v3/maintenance/hashkv": {
"post": {
"tags": [
"Maintenance"
Expand Down
18 changes: 17 additions & 1 deletion Makefile
Expand Up @@ -55,7 +55,7 @@ docker-remove:



GO_VERSION ?= 1.19.9
GO_VERSION ?= $(shell cat .go-version)
ETCD_VERSION ?= $(shell git rev-parse --short HEAD || echo "GitNotFound")

TEST_SUFFIX = $(shell date +%s | base64 | head -c 15)
Expand Down Expand Up @@ -161,6 +161,22 @@ test-full:
$(info log-file: test-$(TEST_SUFFIX).log)
PASSES="fmt build release unit integration functional e2e grpcproxy" ./test.sh 2<&1 | tee test-$(TEST_SUFFIX).log

.PHONY: test-unit
test-unit:
PASSES="unit" ./test.sh $(GO_TEST_FLAGS)

.PHONY: test-integration
test-integration:
PASSES="integration" ./test.sh $(GO_TEST_FLAGS)

.PHONY: test-e2e
test-e2e:
PASSES="build e2e" ./test.sh $(GO_TEST_FLAGS)

.PHONY: test-e2e-release
test-e2e-release:
PASSES="build release e2e" ./test.sh $(GO_TEST_FLAGS)

ensure-docker-test-image-exists:
make pull-docker-test || ( echo "WARNING: Container Image not found in registry, building locally"; make build-docker-test )

Expand Down
2 changes: 1 addition & 1 deletion api/etcdserverpb/gw/rpc.pb.gw.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit bb43fb5

Please sign in to comment.