Merge lp:~mandel/ubuntuone-client/skip-lint into lp:ubuntuone-client

Proposed by Manuel de la Peña
Status: Merged
Approved by: Manuel de la Peña
Approved revision: 1183
Merged at revision: 1181
Proposed branch: lp:~mandel/ubuntuone-client/skip-lint
Merge into: lp:ubuntuone-client
Diff against target: 130 lines (+66/-17)
1 file modified
run-tests.bat (+66/-17)
To merge this branch: bzr merge lp:~mandel/ubuntuone-client/skip-lint
Reviewer Review Type Date Requested Status
Diego Sarmentero (community) Approve
Roberto Alsina (community) Approve
Review via email: mp+89232@code.launchpad.net

Commit message

Adds the possibility to skip the lint checks on windows when passing the /skip-lint parameter to run-tests.bat.

Description of the change

Adds the possibility to skip the lint checks on windows when passing the /skip-lint parameter to run-tests.bat. The script now works as follows:

run-tests.bat /skip-lint trial_params

The above will skip the lint checks and will forward the trial parameters to u1trial, ans example of this is:

run-tests.bat /skip-lint -t test_get_homedir

if /skip-lint is not provided the scripts works as it used to

run-tests.bat -t test_get_homedir

To post a comment you must log in.
1183. By Manuel de la Peña

Made the batch more readable.

Revision history for this message
Roberto Alsina (ralsina) wrote :

+1

review: Approve
Revision history for this message
Diego Sarmentero (diegosarmentero) wrote :

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'run-tests.bat'
--- run-tests.bat 2012-01-12 13:06:51 +0000
+++ run-tests.bat 2012-01-19 13:29:22 +0000
@@ -1,6 +1,4 @@
1:: Author: Manuel de la Pena <manuel@canonical.com>1:: Copyright 2010-12 Canonical Ltd.
2::
3:: Copyright 2010 Canonical Ltd.
4::2::
5:: This program is free software: you can redistribute it and/or modify it3:: This program is free software: you can redistribute it and/or modify it
6:: under the terms of the GNU General Public License version 3, as published4:: under the terms of the GNU General Public License version 3, as published
@@ -13,53 +11,104 @@
13::11::
14:: You should have received a copy of the GNU General Public License along12:: You should have received a copy of the GNU General Public License along
15:: with this program. If not, see <http://www.gnu.org/licenses/>.13:: with this program. If not, see <http://www.gnu.org/licenses/>.
14
16@ECHO off15@ECHO off
16
17:: We could have Python 2.6 or 2.7 on Windows. In order to check availability,17:: We could have Python 2.6 or 2.7 on Windows. In order to check availability,
18:: we should first check for 2.7, and run the tests, otherwise fall back to 2.6.18:: we should first check for 2.7, and run the tests, otherwise fall back to 2.6.
19SET REGQUERY27="REG QUERY HKLM\Software\Python\PythonCore\2.7\InstallPath /ve"
20SET REGQUERY2732="REG QUERY HKLM\Software\Wow6432Node\Python\PythonCore\2.7\InstallPath /ve"
21SET REGQUERY26="REG QUERY HKLM\Software\Python\PythonCore\2.6\InstallPath /ve"
22SET REGQUERY2632="REG QUERY HKLM\Software\Wow6432Node\Python\PythonCore\2.6\InstallPath /ve"
19SET PYTHONEXEPATH=""23SET PYTHONEXEPATH=""
24
20:: This is very annoying; FOR /F will work differently depending on the output25:: This is very annoying; FOR /F will work differently depending on the output
21:: of reg which is not consistent between OS versions (XP, 7). We must choose26:: of reg which is not consistent between OS versions (XP, 7). We must choose
22:: the tokens according to OS version.27:: the tokens according to OS version.
23SET PYTHONPATHTOKENS=328SET PYTHONPATHTOKENS=3
24VER | FIND "XP" > nul29VER | FIND "XP" > nul
25IF %ERRORLEVEL% == 0 SET PYTHONPATHTOKENS=430IF %ERRORLEVEL% == 0 (
31 SET PYTHONPATHTOKENS=4)
32
26ECHO Checking if python 2.7 is in the system33ECHO Checking if python 2.7 is in the system
34
27:: Look for python 2.735:: Look for python 2.7
28FOR /F "tokens=%PYTHONPATHTOKENS%" %%A IN ('REG QUERY HKLM\Software\Python\PythonCore\2.7\InstallPath /ve') DO @SET PYTHONEXEPATH=%%A36FOR /F "tokens=%PYTHONPATHTOKENS%" %%A IN ('%REGQUERY27%') DO @SET PYTHONEXEPATH=%%A
29IF NOT %PYTHONEXEPATH% == "" GOTO :PYTHONPRESENT37
38IF NOT %PYTHONEXEPATH% == "" (
39 GOTO :PYTHONPRESENT)
40
30ECHO Checking if python 2.6 is in the system41ECHO Checking if python 2.6 is in the system
31:: we do not have python 2.7 in the system, try to find 2.642:: we do not have python 2.7 in the system, try to find 2.6
32FOR /F "tokens=%PYTHONPATHTOKENS%" %%A IN ('REG QUERY HKLM\Software\Python\PythonCore\2.6\InstallPath /ve') DO @SET PYTHONEXEPATH=%%A43FOR /F "tokens=%PYTHONPATHTOKENS%" %%A IN ('%REGQUERY26%') DO @SET PYTHONEXEPATH=%%A
33IF NOT %PYTHONEXEPATH% == "" GOTO :PYTHONPRESENT44
45IF NOT %PYTHONEXEPATH% == "" (
46 GOTO :PYTHONPRESENT)
3447
35:: we do not have python (2.6 or 2.7) this could hapen in the case that the48:: we do not have python (2.6 or 2.7) this could hapen in the case that the
36:: user installed the 32version in a 64 machine, let check if the software was installed in the wow key49:: user installed the 32version in a 64 machine, let check if the software was installed in the wow key
3750
38:: Look for python 2.7 in WoW6451:: Look for python 2.7 in WoW64
39ECHO Checking if python 2.7 32 is in the system52ECHO Checking if python 2.7 32 is in the system
40FOR /F "tokens=%PYTHONPATHTOKENS%" %%A IN ('REG QUERY HKLM\Software\Wow6432Node\Python\PythonCore\2.7\InstallPath /ve') DO @SET PYTHONEXEPATH=%%A53FOR /F "tokens=%PYTHONPATHTOKENS%" %%A IN ('%REGQUERY2732%') DO @SET PYTHONEXEPATH=%%A
41IF NOT %PYTHONEXEPATH% == "" GOTO :PYTHONPRESENT54
55IF NOT %PYTHONEXEPATH% == "" (
56 GOTO :PYTHONPRESENT)
57
42ECHO Checking if python 2.6 32 is in the system58ECHO Checking if python 2.6 32 is in the system
43:: we do not have python 2.7 in the system, try to find 2.659:: we do not have python 2.7 in the system, try to find 2.6
44FOR /F "tokens=%PYTHONPATHTOKENS%" %%A IN ('REG QUERY HKLM\Software\Wow6432Node\Python\PythonCore\2.6\InstallPath /ve') DO @SET PYTHONEXEPATH=%%A60FOR /F "tokens=%PYTHONPATHTOKENS%" %%A IN ('%REGQUERY2632%') DO @SET PYTHONEXEPATH=%%A
45IF NOT %PYTHONEXEPATH% == "" GOTO :PYTHONPRESENT61
62IF NOT %PYTHONEXEPATH% == "" (
63 GOTO :PYTHONPRESENT)
4664
47ECHO Please ensure you have python installed65ECHO Please ensure you have python installed
48GOTO :END66GOTO :END
4967
5068
51:PYTHONPRESENT69:PYTHONPRESENT
70
71:: throw the first parameter away if is /skip-lint,
72:: the way we do this is to ensure that /skip-lint
73:: is the first parameter and copy all the rest in a loop
74:: the main reason for that is that %* is not affected
75:: by SHIFT, that is, it allways have all passed parameters
76
77SET PARAMS=%*
78SET SKIPLINT=0
79IF "%1" == "/skip-lint" (
80 SET SKIPLINT=1
81 GOTO :CLEANPARAMS
82)ELSE (
83 GOTO :CONTINUEBATCH)
84:CLEANPARAMS
85
86SHIFT
87SET PARAMS=%1
88:GETREST
89SHIFT
90if [%1]==[] (
91 GOTO CONTINUEBATCH)
92SET PARAMS=%PARAMS% %1
93GOTO GETREST
94:CONTINUEBATCH
95
52ECHO Python found, executing the tests...96ECHO Python found, executing the tests...
53COPY windows\clientdefs.py ubuntuone\clientdefs.py97COPY windows\clientdefs.py ubuntuone\clientdefs.py
54COPY windows\logging.conf data\logging.conf98COPY windows\logging.conf data\logging.conf
55:: execute the tests with a number of ignored linux only modules99:: execute the tests with a number of ignored linux only modules
56"%PYTHONEXEPATH%\python.exe" "%PYTHONEXEPATH%\Scripts\u1trial" --reactor=twisted -c -p tests\platform\linux %* tests100"%PYTHONEXEPATH%\python.exe" "%PYTHONEXEPATH%\Scripts\u1trial" --reactor=twisted -c -p tests\platform\linux %PARAMS% tests
101
102IF %SKIPLINT% == 1 (
103 ECHO Skipping style checks
104 GOTO :CLEAN)
57"%PYTHONEXEPATH%\python.exe" "%PYTHONEXEPATH%\Scripts\u1lint"105"%PYTHONEXEPATH%\python.exe" "%PYTHONEXEPATH%\Scripts\u1lint"
58:: test for style if we can, if pep8 is not present, move to the end106:: test for style if we can, if pep8 is not present, move to the end
59IF EXIST "%PYTHONEXEPATH%\Scripts\pep8.exe"107IF EXIST "%PYTHONEXEPATH%\Scripts\pep8.exe" (
60"%PYTHONEXEPATH%\Scripts\pep8.exe" --repeat ubuntuone108 "%PYTHONEXEPATH%\Scripts\pep8.exe" --repeat ubuntuone
61ELSE109)ELSE (
62ECHO Style checks were not done110 ECHO Style checks were not done)
111:CLEAN
63:: Delete the temp folders112:: Delete the temp folders
64RMDIR /s /q _trial_temp113RMDIR /s /q _trial_temp
65RMDIR /s /q .coverage114RMDIR /s /q .coverage

Subscribers

People subscribed via source and target branches