compatibility test between last released and current for java python php (#6441)
* compatibility tests between last released and the current version
This commit is contained in:
parent
5db5c26ae4
commit
d1eeb852fc
@ -34,35 +34,13 @@ cd $(dirname $0)
|
|||||||
# these tests).
|
# these tests).
|
||||||
TEST_VERSION=3.0.0
|
TEST_VERSION=3.0.0
|
||||||
|
|
||||||
LAST_RELEASED=3.9.0
|
|
||||||
|
|
||||||
# The old version of protobuf that we are testing compatibility against. This
|
# The old version of protobuf that we are testing compatibility against. This
|
||||||
# is usually the same as TEST_VERSION (i.e., we use the tests extracted from
|
# is usually the same as TEST_VERSION (i.e., we use the tests extracted from
|
||||||
# that version to test compatibility of the newest runtime against it), but it
|
# that version to test compatibility of the newest runtime against it), but it
|
||||||
# is also possible to use this same test set to test the compatibiilty of the
|
# is also possible to use this same test set to test the compatibiilty of the
|
||||||
# latest version against other versions.
|
# latest version against other versions.
|
||||||
case "$1" in
|
OLD_VERSION=$1
|
||||||
""|3.0.0)
|
OLD_VERSION_PROTOC=http://repo1.maven.org/maven2/com/google/protobuf/protoc/$OLD_VERSION/protoc-$OLD_VERSION-linux-x86_64.exe
|
||||||
OLD_VERSION=3.0.0
|
|
||||||
OLD_VERSION_PROTOC=http://repo1.maven.org/maven2/com/google/protobuf/protoc/3.0.0/protoc-3.0.0-linux-x86_64.exe
|
|
||||||
;;
|
|
||||||
3.0.2)
|
|
||||||
OLD_VERSION=3.0.2
|
|
||||||
OLD_VERSION_PROTOC=http://repo1.maven.org/maven2/com/google/protobuf/protoc/3.0.2/protoc-3.0.2-linux-x86_64.exe
|
|
||||||
;;
|
|
||||||
3.1.0)
|
|
||||||
OLD_VERSION=3.1.0
|
|
||||||
OLD_VERSION_PROTOC=http://repo1.maven.org/maven2/com/google/protobuf/protoc/3.1.0/protoc-3.1.0-linux-x86_64.exe
|
|
||||||
;;
|
|
||||||
$LAST_RELEASED)
|
|
||||||
OLD_VERSION=$LAST_RELEASED
|
|
||||||
OLD_VERSION_PROTOC=http://repo1.maven.org/maven2/com/google/protobuf/protoc/$OLD_VERSION/protoc-$OLD_VERSION-linux-x86_64.exe
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "[ERROR]: Unknown version number: $1"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
echo "Running compatibility tests with $OLD_VERSION"
|
echo "Running compatibility tests with $OLD_VERSION"
|
||||||
|
|
||||||
|
@ -17,41 +17,13 @@ TEST_VERSION=`grep "^ <version>.*</version>" pom.xml | sed "s| <version>\(.*\)
|
|||||||
# that version to test compatibility of the newest runtime against it), but it
|
# that version to test compatibility of the newest runtime against it), but it
|
||||||
# is also possible to use this same test set to test the compatibiilty of the
|
# is also possible to use this same test set to test the compatibiilty of the
|
||||||
# latest version against other versions.
|
# latest version against other versions.
|
||||||
case "$1" in
|
OLD_VERSION=$1
|
||||||
""|2.5.0)
|
OLD_VERSION_PROTOC=https://repo1.maven.org/maven2/com/google/protobuf/protoc/$OLD_VERSION/protoc-$OLD_VERSION-linux-x86_64.exe
|
||||||
OLD_VERSION=2.5.0
|
|
||||||
OLD_VERSION_PROTOC=https://github.com/xfxyjwf/protobuf-compiler-release/raw/master/v2.5.0/linux/protoc
|
|
||||||
;;
|
|
||||||
2.6.1)
|
|
||||||
OLD_VERSION=2.6.1
|
|
||||||
OLD_VERSION_PROTOC=https://repo1.maven.org/maven2/com/google/protobuf/protoc/2.6.1-build2/protoc-2.6.1-build2-linux-x86_64.exe
|
|
||||||
;;
|
|
||||||
3.0.0-beta-1)
|
|
||||||
OLD_VERSION=3.0.0-beta-1
|
|
||||||
OLD_VERSION_PROTOC=https://repo1.maven.org/maven2/com/google/protobuf/protoc/3.0.0-beta-1/protoc-3.0.0-beta-1-linux-x86_64.exe
|
|
||||||
;;
|
|
||||||
3.0.0-beta-2)
|
|
||||||
OLD_VERSION=3.0.0-beta-2
|
|
||||||
OLD_VERSION_PROTOC=https://repo1.maven.org/maven2/com/google/protobuf/protoc/3.0.0-beta-2/protoc-3.0.0-beta-2-linux-x86_64.exe
|
|
||||||
;;
|
|
||||||
3.0.0-beta-3)
|
|
||||||
OLD_VERSION=3.0.0-beta-3
|
|
||||||
OLD_VERSION_PROTOC=https://repo1.maven.org/maven2/com/google/protobuf/protoc/3.0.0-beta-3/protoc-3.0.0-beta-3-linux-x86_64.exe
|
|
||||||
;;
|
|
||||||
3.0.0-beta-4)
|
|
||||||
OLD_VERSION=3.0.0-beta-4
|
|
||||||
OLD_VERSION_PROTOC=https://repo1.maven.org/maven2/com/google/protobuf/protoc/3.0.0-beta-4/protoc-3.0.0-beta-4-linux-x86_64.exe
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "[ERROR]: Unknown version number: $1"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# Extract the latest protobuf version number.
|
# Extract the latest protobuf version number.
|
||||||
VERSION_NUMBER=`grep "^ <version>.*</version>" ../../pom.xml | sed "s| <version>\(.*\)</version>|\1|"`
|
VERSION_NUMBER=`grep "^ <version>.*</version>" ../../pom.xml | sed "s| <version>\(.*\)</version>|\1|"`
|
||||||
|
|
||||||
echo "Running compatibility tests between $VERSION_NUMBER and $OLD_VERSION"
|
echo "Running compatibility tests between current $VERSION_NUMBER and released $OLD_VERSION"
|
||||||
|
|
||||||
# Check protoc
|
# Check protoc
|
||||||
[ -f ../../../src/protoc ] || {
|
[ -f ../../../src/protoc ] || {
|
||||||
|
@ -21,6 +21,8 @@ function generate_proto() {
|
|||||||
|
|
||||||
$PROTOC1 --php_out=generated proto/test_include.proto
|
$PROTOC1 --php_out=generated proto/test_include.proto
|
||||||
$PROTOC2 --php_out=generated \
|
$PROTOC2 --php_out=generated \
|
||||||
|
-I../../src -I. \
|
||||||
|
proto/empty/echo.proto \
|
||||||
proto/test.proto \
|
proto/test.proto \
|
||||||
proto/test_no_namespace.proto \
|
proto/test_no_namespace.proto \
|
||||||
proto/test_prefix.proto \
|
proto/test_prefix.proto \
|
||||||
@ -34,6 +36,7 @@ function generate_proto() {
|
|||||||
proto/test_reserved_message_upper.proto \
|
proto/test_reserved_message_upper.proto \
|
||||||
proto/test_service.proto \
|
proto/test_service.proto \
|
||||||
proto/test_service_namespace.proto \
|
proto/test_service_namespace.proto \
|
||||||
|
proto/test_wrapper_type_setters.proto \
|
||||||
proto/test_descriptors.proto
|
proto/test_descriptors.proto
|
||||||
|
|
||||||
pushd ../../src
|
pushd ../../src
|
||||||
@ -67,22 +70,13 @@ set -ex
|
|||||||
# Change to the script's directory.
|
# Change to the script's directory.
|
||||||
cd $(dirname $0)
|
cd $(dirname $0)
|
||||||
|
|
||||||
# The old version of protobuf that we are testing compatibility against.
|
OLD_VERSION=$1
|
||||||
case "$1" in
|
OLD_VERSION_PROTOC=http://repo1.maven.org/maven2/com/google/protobuf/protoc/$OLD_VERSION/protoc-$OLD_VERSION-linux-x86_64.exe
|
||||||
""|3.5.0)
|
|
||||||
OLD_VERSION=3.5.0
|
|
||||||
OLD_VERSION_PROTOC=http://repo1.maven.org/maven2/com/google/protobuf/protoc/$OLD_VERSION/protoc-$OLD_VERSION-linux-x86_64.exe
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "[ERROR]: Unknown version number: $1"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# Extract the latest protobuf version number.
|
# Extract the latest protobuf version number.
|
||||||
VERSION_NUMBER=`grep "PHP_PROTOBUF_VERSION" ../ext/google/protobuf/protobuf.h | sed "s|#define PHP_PROTOBUF_VERSION \"\(.*\)\"|\1|"`
|
VERSION_NUMBER=`grep "PHP_PROTOBUF_VERSION" ../ext/google/protobuf/protobuf.h | sed "s|#define PHP_PROTOBUF_VERSION \"\(.*\)\"|\1|"`
|
||||||
|
|
||||||
echo "Running compatibility tests between $VERSION_NUMBER and $OLD_VERSION"
|
echo "Running compatibility tests between current $VERSION_NUMBER and released $OLD_VERSION"
|
||||||
|
|
||||||
# Check protoc
|
# Check protoc
|
||||||
[ -f ../../src/protoc ] || {
|
[ -f ../../src/protoc ] || {
|
||||||
|
@ -14,41 +14,13 @@ TEST_VERSION=2.5.0
|
|||||||
# that version to test compatibility of the newest runtime against it), but it
|
# that version to test compatibility of the newest runtime against it), but it
|
||||||
# is also possible to use this same test set to test the compatibiilty of the
|
# is also possible to use this same test set to test the compatibiilty of the
|
||||||
# latest version against other versions.
|
# latest version against other versions.
|
||||||
case "$1" in
|
OLD_VERSION=$1
|
||||||
""|2.5.0)
|
OLD_VERSION_PROTOC=http://repo1.maven.org/maven2/com/google/protobuf/protoc/$OLD_VERSION/protoc-$OLD_VERSION-linux-x86_64.exe
|
||||||
OLD_VERSION=2.5.0
|
|
||||||
OLD_VERSION_PROTOC=https://github.com/xfxyjwf/protobuf-compiler-release/raw/master/v2.5.0/linux/protoc
|
|
||||||
;;
|
|
||||||
2.6.1)
|
|
||||||
OLD_VERSION=2.6.1
|
|
||||||
OLD_VERSION_PROTOC=http://repo1.maven.org/maven2/com/google/protobuf/protoc/2.6.1-build2/protoc-2.6.1-build2-linux-x86_64.exe
|
|
||||||
;;
|
|
||||||
3.0.0-beta-1)
|
|
||||||
OLD_VERSION=3.0.0-beta-1
|
|
||||||
OLD_VERSION_PROTOC=http://repo1.maven.org/maven2/com/google/protobuf/protoc/3.0.0-beta-1/protoc-3.0.0-beta-1-linux-x86_64.exe
|
|
||||||
;;
|
|
||||||
3.0.0-beta-2)
|
|
||||||
OLD_VERSION=3.0.0-beta-2
|
|
||||||
OLD_VERSION_PROTOC=http://repo1.maven.org/maven2/com/google/protobuf/protoc/3.0.0-beta-2/protoc-3.0.0-beta-2-linux-x86_64.exe
|
|
||||||
;;
|
|
||||||
3.0.0-beta-3)
|
|
||||||
OLD_VERSION=3.0.0-beta-3
|
|
||||||
OLD_VERSION_PROTOC=http://repo1.maven.org/maven2/com/google/protobuf/protoc/3.0.0-beta-3/protoc-3.0.0-beta-3-linux-x86_64.exe
|
|
||||||
;;
|
|
||||||
3.0.0-beta-4)
|
|
||||||
OLD_VERSION=3.0.0-beta-4
|
|
||||||
OLD_VERSION_PROTOC=http://repo1.maven.org/maven2/com/google/protobuf/protoc/3.0.0-beta-4/protoc-3.0.0-beta-4-linux-x86_64.exe
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "[ERROR]: Unknown version number: $1"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# Extract the latest protobuf version number.
|
# Extract the latest protobuf version number.
|
||||||
VERSION_NUMBER=`grep "^__version__ = '.*'" ../../google/protobuf/__init__.py | sed "s|__version__ = '\(.*\)'|\1|"`
|
VERSION_NUMBER=`grep "^__version__ = '.*'" ../../google/protobuf/__init__.py | sed "s|__version__ = '\(.*\)'|\1|"`
|
||||||
|
|
||||||
echo "Running compatibility tests between $VERSION_NUMBER and $OLD_VERSION"
|
echo "Running compatibility tests between current $VERSION_NUMBER and released $OLD_VERSION"
|
||||||
|
|
||||||
# Check protoc
|
# Check protoc
|
||||||
[ -f ../../../src/protoc ] || {
|
[ -f ../../../src/protoc ] || {
|
||||||
|
11
tests.sh
11
tests.sh
@ -6,6 +6,8 @@
|
|||||||
|
|
||||||
# For when some other test needs the C++ main build, including protoc and
|
# For when some other test needs the C++ main build, including protoc and
|
||||||
# libprotobuf.
|
# libprotobuf.
|
||||||
|
LAST_RELEASED=3.9.0
|
||||||
|
|
||||||
internal_build_cpp() {
|
internal_build_cpp() {
|
||||||
if [ -f src/protoc ]; then
|
if [ -f src/protoc ]; then
|
||||||
# Already built.
|
# Already built.
|
||||||
@ -148,7 +150,6 @@ build_csharp() {
|
|||||||
# Run csharp compatibility test between 3.0.0 and the current version.
|
# Run csharp compatibility test between 3.0.0 and the current version.
|
||||||
csharp/compatibility_tests/v3.0.0/test.sh 3.0.0
|
csharp/compatibility_tests/v3.0.0/test.sh 3.0.0
|
||||||
|
|
||||||
LAST_RELEASED=3.9.0
|
|
||||||
# Run csharp compatibility test between last released and the current version.
|
# Run csharp compatibility test between last released and the current version.
|
||||||
csharp/compatibility_tests/v3.0.0/test.sh $LAST_RELEASED
|
csharp/compatibility_tests/v3.0.0/test.sh $LAST_RELEASED
|
||||||
}
|
}
|
||||||
@ -233,6 +234,9 @@ build_java_compatibility() {
|
|||||||
# 3.0.0-beta-4 and the current version.
|
# 3.0.0-beta-4 and the current version.
|
||||||
cd java/compatibility_tests/v2.5.0
|
cd java/compatibility_tests/v2.5.0
|
||||||
./test.sh 3.0.0-beta-4
|
./test.sh 3.0.0-beta-4
|
||||||
|
|
||||||
|
# Test the last released and current version.
|
||||||
|
./test.sh $LAST_RELEASED
|
||||||
}
|
}
|
||||||
build_java_linkage_monitor() {
|
build_java_linkage_monitor() {
|
||||||
# Linkage Monitor checks compatibility with other Google libraries
|
# Linkage Monitor checks compatibility with other Google libraries
|
||||||
@ -406,6 +410,9 @@ build_python_compatibility() {
|
|||||||
./test.sh 2.5.0
|
./test.sh 2.5.0
|
||||||
# Test between 3.0.0-beta-1 and the current version.
|
# Test between 3.0.0-beta-1 and the current version.
|
||||||
./test.sh 3.0.0-beta-1
|
./test.sh 3.0.0-beta-1
|
||||||
|
|
||||||
|
# Test between last released and current version.
|
||||||
|
./test.sh $LAST_RELEASED
|
||||||
}
|
}
|
||||||
|
|
||||||
build_ruby23() {
|
build_ruby23() {
|
||||||
@ -662,7 +669,7 @@ build_php7.0_mac() {
|
|||||||
|
|
||||||
build_php_compatibility() {
|
build_php_compatibility() {
|
||||||
internal_build_cpp
|
internal_build_cpp
|
||||||
php/tests/compatibility_test.sh
|
php/tests/compatibility_test.sh $LAST_RELEASED
|
||||||
}
|
}
|
||||||
|
|
||||||
build_php7.1() {
|
build_php7.1() {
|
||||||
|
@ -49,20 +49,9 @@ def RewriteTextFile(filename, line_rewriter):
|
|||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
|
|
||||||
def UpdateCsharp():
|
RewriteTextFile('tests.sh',
|
||||||
RewriteTextFile('csharp/compatibility_tests/v3.0.0/test.sh',
|
lambda line : re.sub(
|
||||||
lambda line : re.sub(
|
r'LAST_RELEASED=.*$',
|
||||||
r'LAST_RELEASED=.*$',
|
'LAST_RELEASED=%s' % NEW_VERSION,
|
||||||
'LAST_RELEASED=%s' % NEW_VERSION,
|
line))
|
||||||
line))
|
|
||||||
|
|
||||||
def UpdateTests():
|
|
||||||
RewriteTextFile('tests.sh',
|
|
||||||
lambda line : re.sub(
|
|
||||||
r'LAST_RELEASED=.*$',
|
|
||||||
'LAST_RELEASED=%s' % NEW_VERSION,
|
|
||||||
line))
|
|
||||||
|
|
||||||
|
|
||||||
UpdateCsharp()
|
|
||||||
UpdateTests()
|
|
||||||
|
Loading…
Reference in New Issue
Block a user