Merge lp:~percona-dev/percona-server/fix_install_tests into lp:~percona-dev/percona-server/5.1.57

Proposed by Oleg Tsarev on 2011-05-27
Status: Merged
Approved by: Valentine Gostev on 2011-05-27
Approved revision: 225
Merged at revision: 233
Proposed branch: lp:~percona-dev/percona-server/fix_install_tests
Merge into: lp:~percona-dev/percona-server/5.1.57
Diff against target: 49 lines (+22/-10)
1 file modified
install_tests.sh (+22/-10)
To merge this branch: bzr merge lp:~percona-dev/percona-server/fix_install_tests
Reviewer Review Type Date Requested Status
Valentine Gostev (community) qa 2011-05-27 Approve on 2011-05-27
Laurynas Biveinis (community) 2011-05-27 Approve on 2011-05-27
Stewart Smith 2011-05-27 Pending
Review via email: mp+62591@code.launchpad.net

This proposal supersedes a proposal from 2011-05-26.

Description of the change

BEFORE-FIX behaviour: ,/install_tests.sh always install all files from mysql-test/
AFTER-FIX behavior: ./install_tests.sh install tests just for patches listed in "series" file and from mysql-test/.
For every "name.patch" patch we have directory "mysql-test/name.patch/" with tests for this patch.
This script help to maintain patches, merge between different versions, backport patches with tests and so one.
My change fix bug #782391
Also script print statistics of patch applying.

To post a comment you must log in.
Valentine Gostev (longbow) wrote : Posted in a previous version of this proposal

looks ok

review: Approve (qa)

Looks good to me

review: Approve
Valentine Gostev (longbow) wrote :

looks fine

review: Approve (qa)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'install_tests.sh'
2--- install_tests.sh 2011-04-09 15:21:53 +0000
3+++ install_tests.sh 2011-05-27 02:29:53 +0000
4@@ -1,23 +1,35 @@
5 #!/bin/sh
6
7-set -ue
8+set -u
9
10 MYSQL_VERSION="$(grep ^MYSQL_VERSION= "Makefile" \
11 | cut -d = -f 2)"
12 export PERCONA_SERVER="Percona-Server-$MYSQL_VERSION"
13
14+install_file_type()
15+{
16+ for file in `ls $1/*.$2 2>/dev/null`; do
17+ test -f $file && install -m 644 $file ${PERCONA_SERVER}/mysql-test/$3
18+ done;
19+}
20+do_install_path()
21+{
22+ install_file_type $1 test t
23+ install_file_type $1 opt t
24+ install_file_type $1 result r
25+ install_file_type $1 require r
26+ install_file_type $1 inc include
27+}
28 install_path()
29 {
30- echo "Installing mysql-test files: $2"
31- find $1 -iname '*.test' -exec install -m 644 {} ${PERCONA_SERVER}/mysql-test/t/ ';'
32- find $1 -iname '*.opt' -exec install -m 644 {} ${PERCONA_SERVER}/mysql-test/t/ ';'
33- find $1 -iname '*.result' -exec install -m 644 {} ${PERCONA_SERVER}/mysql-test/r/ ';'
34- find $1 -iname '*.require' -exec install -m 644 {} ${PERCONA_SERVER}/mysql-test/r/ ';'
35- find $1 -iname '*.inc' -exec install -m 644 {} ${PERCONA_SERVER}/mysql-test/include/ ';'
36+ echo "[$3/$4] Installing mysql-test files: $2"
37+ test -d $1 && do_install_path $1 $2
38 }
39-
40-install_path mysql-test "global"
41+let current=1;
42+count=`wc -l series`;
43+install_path mysql-test "global" $current $count
44 for test_name in `cat series`; do
45- test -d mysql-test/$test_name && install_path mysql-test/$test_name $test_name
46+ let current=$current+1;
47+ install_path mysql-test/$test_name $test_name $current $count
48 done
49 echo "Done"

Subscribers

People subscribed via source and target branches