e2e: add script to generate multiversion-tests

This commit is contained in:
William Banfield
2022-12-06 12:50:29 -05:00
parent ac48630fdb
commit a76f742107
5 changed files with 30 additions and 4 deletions
+1 -1
View File
@@ -29,7 +29,7 @@ jobs:
- name: Generate testnets
working-directory: test/e2e
# When changing -g, also change the matrix groups above
run: ./build/generator -g 5 -d networks/nightly/
run: ./generate-multiversion.sh -g 5 -d networks/nightly/
- name: Run ${{ matrix.p2p }} p2p testnets
working-directory: test/e2e
+1 -1
View File
@@ -40,7 +40,7 @@ jobs:
- name: Generate testnets
working-directory: test/e2e
# When changing -g, also change the matrix groups above
run: ./build/generator -g 2 -d networks/nightly
run: ./generate-multiversion.sh -g 2 -d networks/nightly
- name: Run testnets in group ${{ matrix.group }}
working-directory: test/e2e
+1 -1
View File
@@ -40,7 +40,7 @@ jobs:
- name: Generate testnets
working-directory: test/e2e
# When changing -g, also change the matrix groups above
run: ./build/generator -g 5 -d networks/nightly/
run: ./generate-multiversion.sh -g 5 -d networks/nightly/
- name: Run ${{ matrix.p2p }} p2p testnets
working-directory: test/e2e
+1 -1
View File
@@ -34,7 +34,7 @@ jobs:
- name: Generate testnets
working-directory: test/e2e
# When changing -g, also change the matrix groups above
run: ./build/generator -g 5 -d networks/nightly/
run: ./generate-multiversion.sh -g 5 -d networks/nightly/
- name: Run ${{ matrix.p2p }} p2p testnets
working-directory: test/e2e
+26
View File
@@ -0,0 +1,26 @@
#!/bin/sh
set -euo pipefail
ARGS=$@
FLAGS=${ARGS:=-g 4 -d networks/nightly}
# This lists all tags that are reachable from the current commit, sorted by
# increasing semver version.
SORTED_TAGS=`git tag -l --merge HEAD --sort="v:refname"`
# Extracts the major and minor version of the most recent -dev tagged version.
# For example, on the backport branch for v0.32, the most recent dev tag will contain v0.32.0-dev.
# v0.32 is then extracted from this tag.
BRANCH_MINOR_VERSION=`echo "$SORTED_TAGS" | grep '^v[0-9]\+\.[0-9]\+\.[0-9]\+\(-dev[0-9]*\)$' | tail -n 1 | sed -n 's/^\(v[0-9]\+\.[0-9]\+\).*/\1/p'`
LATEST_RELEASE_VERSION=`echo "$SORTED_TAGS" | grep '^v[0-9]\+\.[0-9]\+\.[0-9]\+$' | tail -n 1`
# Check to see if the major and minor version of the latest release version are
# the same as those of the current branch. This ensures that the multi-version testing
# is only run on branches with a tagged release of the same major and minor version
# and not on branches that do not yet have releases such as new backport branches
# and the main branch.
if [ `echo "$LATEST_RELEASE_VERSION" | grep "^$BRANCH_MINOR_VERSION"` ]; then
FLAGS="$FLAGS --multi-version $LATEST_RELEASE_VERSION"
fi
./build/generator $FLAGS