-
Notifications
You must be signed in to change notification settings - Fork 93
Go: Enable Testing with RC #3916
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 6 commits
d3fc726
45ec944
36d7db1
109a395
58bb119
a6b34f2
1e56bd2
38d043f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -39,6 +39,14 @@ on: | |||
description: "Run the full engine, host, and language version matrix" | ||||
type: boolean | ||||
default: false | ||||
rc-test: | ||||
description: "Run tests against a release candidate" | ||||
type: boolean | ||||
default: false | ||||
rc-version: | ||||
required: false | ||||
type: string | ||||
description: "RC Version number (Format: vX.Y.Z or vX.Y.Z-rcN)" | ||||
name: | ||||
required: false | ||||
type: string | ||||
|
@@ -118,8 +126,25 @@ jobs: | |||
${{ matrix.host.TARGET }}-glide-core | ||||
${{ matrix.host.TARGET }} | ||||
|
||||
- name: Install & test RC | ||||
working-directory: go | ||||
if: ${{ github.event.inputs.rc-test == 'true' }} | ||||
env: | ||||
RC_VERSION: ${{ github.event.inputs.rc-version }} | ||||
run: | | ||||
./scripts/rc-testing/rc-test.sh "$RC_VERSION" | ||||
make install-tools | ||||
make -k integ-test | ||||
|
||||
- name: Run Pubsub Tests on RC | ||||
working-directory: go | ||||
if: ${{ github.event.inputs.rc-test == 'true' && github.event.inputs.rc-version >= 'v2.0.0' }} | ||||
run: | | ||||
make -k pubsub-test | ||||
|
||||
- name: Install & build & test | ||||
working-directory: go | ||||
if: ${{ github.event.inputs.rc-test != 'true' }} | ||||
run: | | ||||
make install-tools build | ||||
make -k unit-test integ-test | ||||
|
@@ -150,6 +175,7 @@ jobs: | |||
lint: | ||||
timeout-minutes: 10 | ||||
runs-on: ubuntu-latest | ||||
if: ${{ github.event.inputs.rc-test != 'true' }} | ||||
steps: | ||||
- uses: actions/checkout@v4 | ||||
|
||||
|
@@ -173,7 +199,6 @@ jobs: | |||
restore-keys: | | ||||
x86_64-unknown-linux-gnu-glide-core | ||||
x86_64-unknown-linux-gnu | ||||
|
||||
- name: lint rust | ||||
uses: ./.github/workflows/lint-rust | ||||
with: | ||||
|
@@ -249,8 +274,19 @@ jobs: | |||
key: ${{ matrix.host.IMAGE }}-go | ||||
restore-keys: ${{ matrix.host.IMAGE }} | ||||
|
||||
- name: Install & test RC | ||||
working-directory: go | ||||
if: ${{ github.event.inputs.rc-test == 'true' }} | ||||
env: | ||||
RC_VERSION: ${{ github.event.inputs.rc-version }} | ||||
run: | | ||||
./scripts/rc-testing/rc-test.sh "$RC_VERSION" | ||||
make install-tools | ||||
make -k integ-test | ||||
edlng marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
|
||||
- name: Install & build & test | ||||
working-directory: go | ||||
if: ${{ github.event.inputs.rc-test != 'true' }} | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
And this step will run tests (yes, |
||||
run: | | ||||
make install-tools build | ||||
make -k unit-test integ-test | ||||
|
@@ -298,10 +334,14 @@ jobs: | |||
- name: Install zig | ||||
uses: ./.github/workflows/install-zig | ||||
|
||||
- name: Build and test | ||||
- name: test | ||||
working-directory: ./go | ||||
if: ${{ github.event.inputs.rc-test == 'true' }} | ||||
edlng marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
env: | ||||
RC_VERSION: ${{ github.event.inputs.rc-version }} | ||||
run: | | ||||
make install-tools build modules-test cluster-endpoints=${{ secrets.MEMDB_MODULES_ENDPOINT }} tls=true | ||||
./scripts/rc-testing/rc-test.sh "$RC_VERSION" | ||||
make install-tools modules-test cluster-endpoints=${{ secrets.MEMDB_MODULES_ENDPOINT }} tls=true | ||||
|
||||
- name: Upload test reports | ||||
if: always() | ||||
|
@@ -356,8 +396,19 @@ jobs: | |||
${{ matrix.host.TARGET }}-glide-core | ||||
${{ matrix.host.TARGET }} | ||||
|
||||
- name: Install & test RC | ||||
edlng marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
working-directory: go | ||||
if: ${{ github.event.inputs.rc-test == 'true' && github.event.inputs.rc-version >= 'v2.0.0' }} | ||||
env: | ||||
RC_VERSION: ${{ github.event.inputs.rc-version }} | ||||
run: | | ||||
./scripts/rc-testing/rc-test.sh "$RC_VERSION" | ||||
make install-tools | ||||
make -k long-timeout-test test-filter=TestLongTimeout | ||||
|
||||
- name: Install & build & test | ||||
working-directory: go | ||||
if: ${{ github.event.inputs.rc-test != 'true' }} | ||||
run: | | ||||
make install-tools build | ||||
make -k long-timeout-test test-filter=TestLongTimeout | ||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
# Check if version parameter is provided | ||
if [ $# -ne 1 ]; then | ||
echo "Usage: $0 <version>" | ||
echo "Example: $0 v1.3.4-rc2" | ||
exit 1 | ||
fi | ||
|
||
VERSION=$1 | ||
|
||
# Validate version format | ||
if ! [[ $VERSION =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-rc[0-9]+)?$ ]]; then | ||
echo "Error: Version must be in format vX.Y.Z or vX.Y.Z-rcN (e.g., v1.3.4-rc2)" | ||
exit 1 | ||
fi | ||
|
||
# Extract major and minor version for branch name | ||
if [[ $VERSION =~ ^v([0-9]+)\.([0-9]+)\.[0-9]+(-rc[0-9]+)?$ ]]; then | ||
edlng marked this conversation as resolved.
Show resolved
Hide resolved
|
||
MAJOR=${BASH_REMATCH[1]} | ||
MINOR=${BASH_REMATCH[2]} | ||
BRANCH="release-${MAJOR}.${MINOR}" | ||
|
||
echo "Testing release candidate: $VERSION" | ||
echo "Determined branch: $BRANCH" | ||
|
||
# Checkout release branch | ||
echo "Checking out $BRANCH branch..." | ||
git fetch origin $BRANCH | ||
git checkout $BRANCH | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No need to checkout a branch. GHA already has a branch selector, but we can run new tests with an old RC with your script. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it might be required. Go mod tidy doesn't seem to work too well when things have been moved around or added. Adding the branch makes it more stable Ex. trying to run 1.3.4-rc2 on more recent branches go.mod has been updated
go: finding module for package github.com/valkey-io/valkey-glide/go/api/server-modules/glidejson
go: finding module for package github.com/valkey-io/valkey-glide/go/api/server-modules/glidejson/options
go: github.com/valkey-io/valkey-glide/go-test-rc/api/server-modules/glidejson imports
github.com/valkey-io/valkey-glide/go/api/server-modules/glidejson/options: module github.com/valkey-io/valkey-glide/go@latest found (v1.3.4), but does not contain package github.com/valkey-io/valkey-glide/go/api/server-modules/glidejson/options
go: github.com/valkey-io/valkey-glide/go-test-rc/integTest tested by
github.com/valkey-io/valkey-glide/go-test-rc/integTest.test imports
github.com/valkey-io/valkey-glide/go/api/server-modules/glidejson: module github.com/valkey-io/valkey-glide/go@latest found (v1.3.4), but does not contain package github.com/valkey-io/valkey-glide/go/api/server-modules/glidejson There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. but then again if we were to apply the patch and then switch to another release branch, conflicts start happening 😨 |
||
else | ||
echo "Error: Failed to extract version components" | ||
exit 1 | ||
fi | ||
|
||
# Modify go.mod file | ||
echo "Modifying go.mod file..." | ||
# Use sed to modify the module name and add the dependency after testify depending on MacOS or Linux | ||
os="$(uname -s)" | ||
if [ "$os" = "Linux" ]; then | ||
# Linux | ||
sed -i -e 's|module github.com/valkey-io/valkey-glide/go|module github.com/valkey-io/valkey-glide/go-test-rc|' go.mod | ||
sed -i -e '/github.com\/stretchr\/testify/a\\tgithub.com/valkey-io/valkey-glide/go '"$VERSION"'' go.mod | ||
if [ $MAJOR -lt "2" ]; then # Fix for release version 1 branches | ||
sed -i -e 's|"redis-cli",|CLI_COMMAND,|g' ../utils/cluster_manager.py | ||
fi | ||
else | ||
# MacOS | ||
sed -i '' -e 's|module github.com/valkey-io/valkey-glide/go|module github.com/valkey-io/valkey-glide/go-test-rc|' go.mod | ||
sed -i '' -e '/github.com\/stretchr\/testify/ a\ | ||
github.com\/valkey-io\/valkey-glide\/go '"$VERSION"'' go.mod | ||
if [ $MAJOR -lt "2" ]; then # Fix for release version 1 branches | ||
sed -i '' -e 's|"redis-cli",|CLI_COMMAND,|g' ../utils/cluster_manager.py | ||
fi | ||
fi | ||
|
||
echo "go.mod has been updated" | ||
go mod tidy |
Uh oh!
There was an error while loading. Please reload this page.