tests: Fix building incorrect etcd version and make switch strict

Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
storage-doc
Marek Siarkowicz 2023-04-03 14:33:27 +02:00
parent 7c7f636aea
commit 9c72ecb1f9
4 changed files with 27 additions and 22 deletions

View File

@ -6,25 +6,25 @@ on:
schedule: schedule:
- cron: '25 9 * * *' # runs every day at 09:25 UTC - cron: '25 9 * * *' # runs every day at 09:25 UTC
jobs: jobs:
test-main: main:
# GHA has a maximum amount of 6h execution time, we try to get done within 3h # GHA has a maximum amount of 6h execution time, we try to get done within 3h
uses: ./.github/workflows/robustness-template.yaml uses: ./.github/workflows/robustness-template.yaml
with: with:
ref: main etcdBranch: main
count: 100 count: 100
testTimeout: 200m testTimeout: 200m
artifactName: test-main artifactName: main
test-35: release-35:
uses: ./.github/workflows/robustness-template.yaml uses: ./.github/workflows/robustness-template.yaml
with: with:
ref: release-3.5 etcdBranch: release-3.5
count: 100 count: 100
testTimeout: 200m testTimeout: 200m
artifactName: test-35 artifactName: release-35
test-34: release-34:
uses: ./.github/workflows/robustness-template.yaml uses: ./.github/workflows/robustness-template.yaml
with: with:
ref: release-3.4 etcdBranch: release-3.4
count: 100 count: 100
testTimeout: 200m testTimeout: 200m
artifactName: test-34 artifactName: release-34

View File

@ -2,7 +2,7 @@ name: Reusable Robustness Workflow
on: on:
workflow_call: workflow_call:
inputs: inputs:
ref: etcdBranch:
required: true required: true
type: string type: string
count: count:
@ -27,11 +27,12 @@ jobs:
go-version: '1.19.7' go-version: '1.19.7'
- name: build - name: build
env: env:
GITHUB_REF: ${{ inputs.ref }} ETCD_BRANCH: "${{ inputs.etcdBranch }}"
run: | run: |
set -euo pipefail set -euo pipefail
case "${GITHUB_REF}" in mkdir -p bin
case "${ETCD_BRANCH}" in
release-3.5) release-3.5)
make /tmp/etcd-release-3.5-failpoints/bin/etcd make /tmp/etcd-release-3.5-failpoints/bin/etcd
cp /tmp/etcd-release-3.5-failpoints/bin/etcd bin/etcd cp /tmp/etcd-release-3.5-failpoints/bin/etcd bin/etcd
@ -40,10 +41,14 @@ jobs:
make /tmp/etcd-release-3.4-failpoints/bin/etcd make /tmp/etcd-release-3.4-failpoints/bin/etcd
cp /tmp/etcd-release-3.4-failpoints/bin/etcd bin/etcd cp /tmp/etcd-release-3.4-failpoints/bin/etcd bin/etcd
;; ;;
*) main)
make gofail-enable make gofail-enable
make build make build
;; ;;
*)
echo "Failed to find target ${ETCD_BRANCH}"
exit 1
;;
esac esac
./bin/etcd --version ./bin/etcd --version
- name: test-robustness - name: test-robustness

View File

@ -2,10 +2,10 @@ name: Robustness
on: [push, pull_request] on: [push, pull_request]
permissions: read-all permissions: read-all
jobs: jobs:
test: main:
uses: ./.github/workflows/robustness-template.yaml uses: ./.github/workflows/robustness-template.yaml
with: with:
ref: ${{ github.ref }} etcdBranch: main
count: 15 count: 15
testTimeout: 30m testTimeout: 30m
artifactName: test artifactName: main

View File

@ -41,7 +41,7 @@ install-gofail:
# Build previous releases for robustness tests # Build previous releases for robustness tests
/tmp/etcd-v3.6.0-failpoints/bin: /tmp/etcd-v3.6.0-failpoints/bin: install-gofail
rm -rf /tmp/etcd-v3.6.0-failpoints/ rm -rf /tmp/etcd-v3.6.0-failpoints/
mkdir -p /tmp/etcd-v3.6.0-failpoints/ mkdir -p /tmp/etcd-v3.6.0-failpoints/
cd /tmp/etcd-v3.6.0-failpoints/; \ cd /tmp/etcd-v3.6.0-failpoints/; \
@ -52,7 +52,7 @@ install-gofail:
/tmp/etcd-v3.5.2-failpoints/bin: /tmp/etcd-v3.5.2-failpoints/bin:
/tmp/etcd-v3.5.4-failpoints/bin: /tmp/etcd-v3.5.4-failpoints/bin:
/tmp/etcd-v3.5.5-failpoints/bin: /tmp/etcd-v3.5.5-failpoints/bin:
/tmp/etcd-v3.5.%-failpoints/bin: /tmp/etcd-v3.5.%-failpoints/bin: install-gofail
rm -rf /tmp/etcd-v3.5.$*-failpoints/ rm -rf /tmp/etcd-v3.5.$*-failpoints/
mkdir -p /tmp/etcd-v3.5.$*-failpoints/ mkdir -p /tmp/etcd-v3.5.$*-failpoints/
cd /tmp/etcd-v3.5.$*-failpoints/; \ cd /tmp/etcd-v3.5.$*-failpoints/; \
@ -63,7 +63,7 @@ install-gofail:
(cd etcdutl; go get go.etcd.io/gofail@${GOFAIL_VERSION}); \ (cd etcdutl; go get go.etcd.io/gofail@${GOFAIL_VERSION}); \
FAILPOINTS=true ./build; FAILPOINTS=true ./build;
/tmp/etcd-release-3.5-failpoints/bin/etcd: /tmp/etcd-release-3.5-failpoints/bin/etcd: install-gofail
rm -rf /tmp/etcd-release-3.5-failpoints/ rm -rf /tmp/etcd-release-3.5-failpoints/
mkdir -p /tmp/etcd-release-3.5-failpoints/ mkdir -p /tmp/etcd-release-3.5-failpoints/
cd /tmp/etcd-release-3.5-failpoints/; \ cd /tmp/etcd-release-3.5-failpoints/; \
@ -75,7 +75,7 @@ install-gofail:
FAILPOINTS=true ./build; FAILPOINTS=true ./build;
/tmp/etcd-v3.4.23-failpoints/bin: /tmp/etcd-v3.4.23-failpoints/bin:
/tmp/etcd-v3.4.%-failpoints/bin: /tmp/etcd-v3.4.%-failpoints/bin: install-gofail
rm -rf /tmp/etcd-v3.4.$*-failpoints/ rm -rf /tmp/etcd-v3.4.$*-failpoints/
mkdir -p /tmp/etcd-v3.4.$*-failpoints/ mkdir -p /tmp/etcd-v3.4.$*-failpoints/
cd /tmp/etcd-v3.4.$*-failpoints/; \ cd /tmp/etcd-v3.4.$*-failpoints/; \
@ -83,7 +83,7 @@ install-gofail:
go get go.etcd.io/gofail@${GOFAIL_VERSION}; \ go get go.etcd.io/gofail@${GOFAIL_VERSION}; \
FAILPOINTS=true ./build; FAILPOINTS=true ./build;
/tmp/etcd-release-3.4-failpoints/bin/etcd: /tmp/etcd-release-3.4-failpoints/bin/etcd: install-gofail
rm -rf /tmp/etcd-release-3.4-failpoints/ rm -rf /tmp/etcd-release-3.4-failpoints/
mkdir -p /tmp/etcd-release-3.4-failpoints/ mkdir -p /tmp/etcd-release-3.4-failpoints/
cd /tmp/etcd-release-3.4-failpoints/; \ cd /tmp/etcd-release-3.4-failpoints/; \