3912 Joerg Bruehe 2012-07-24
Fix bug#14318456 SPEC FILE DOES NOT RUN THE TEST SUITE DURING RPM BUILD
Add a macro "runselftest" to the spec file for RPM builds.
If its value is 1 (the default), the test suite will be run during
the RPM build.
To prevent that, add this to the rpmbuild command line:
--define "runselftest 0"
Failures of the test suite will NOT make the RPM build fail!
@ support-files/mysql.spec.sh
Add the "runselftest" macro following the model provided by RedHat.
This code is similar to what we plan to use for ULN RPMs.
modified:
support-files/mysql.spec.sh
3911 Alexander Barkov 2012-07-24 [merge]
Merging from 5.1
modified:
sql/share/charsets/Index.xml
=== modified file 'support-files/mysql.spec.sh'
--- a/support-files/mysql.spec.sh 2012-06-08 14:31:03 +0000
+++ b/support-files/mysql.spec.sh 2012-07-24 10:32:14 +0000
@@ -252,6 +252,9 @@ Vendor: %{mysql_vendor}
Provides: msqlormysql MySQL-server mysql
BuildRequires: %{distro_buildreq}
+# Regression tests may take a long time, override the default to skip them
+%{!?runselftest:%global runselftest 1}
+
# Think about what you use here since the first step is to
# run a rm -rf
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@@ -403,6 +406,16 @@ For a description of MySQL see the base
##############################################################################
%build
+# Fail quickly and obviously if user tries to build as root
+%if %runselftest
+ if [ x"`id -u`" = x0 ]; then
+ echo "The MySQL regression tests may fail if run as root."
+ echo "If you really need to build the RPM as root, use"
+ echo "--define='runselftest 0' to skip the regression tests."
+ exit 1
+ fi
+%endif
+
# Be strict about variables, bail at earliest opportunity, etc.
set -eu
@@ -480,6 +493,13 @@ mkdir release
make ${MAKE_JFLAG} VERBOSE=1
)
+%if %runselftest
+ MTR_BUILD_THREAD=auto
+ export MTR_BUILD_THREAD
+
+ (cd release && make test-bt-fast || true)
+%endif
+
##############################################################################
%install
@@ -1146,6 +1166,14 @@ echo "====="
# merging BK trees)
##############################################################################
%changelog
+* Tue Jul 24 2012 Joerg Bruehe <joerg.bruehe@stripped>
+
+- Add a macro "runselftest":
+ if set to 1 (default), the test suite will be run during the RPM build;
+ this can be oveeridden via the command line by adding
+ --define "runselftest 0"
+ Failures of the test suite will NOT make the RPM build fail!
+
* Wed Sep 28 2011 Joerg Bruehe <joerg.bruehe@stripped>
- Fix duplicate mentioning of "mysql_plugin" and its manual page,
No bundle (reason: useless for push emails).
| Thread |
|---|
| • bzr push into mysql-5.5 branch (joerg.bruehe:3911 to 3912) Bug#14318456 | Joerg Bruehe | 25 Jul |