Merge lp:~brian.curtin/ubuntuone-control-panel/run-tests-buildout-cleanup into lp:ubuntuone-control-panel

Proposed by Brian Curtin on 2012-04-17
Status: Merged
Approved by: dobey on 2012-04-20
Approved revision: 315
Merged at revision: 315
Proposed branch: lp:~brian.curtin/ubuntuone-control-panel/run-tests-buildout-cleanup
Merge into: lp:ubuntuone-control-panel
Diff against target: 56 lines (+24/-7)
1 file modified
run-tests.bat (+24/-7)
To merge this branch: bzr merge lp:~brian.curtin/ubuntuone-control-panel/run-tests-buildout-cleanup
Reviewer Review Type Date Requested Status
dobey (community) Approve on 2012-04-20
Diego Sarmentero (community) 2012-04-17 Approve on 2012-04-20
Review via email: mp+102392@code.launchpad.net

Commit message

- Make run-tests.bat work with the new buildout environment.

Description of the change

Allow run-tests.bat to work with the new buildout environment.

This depends on lp:~brian.curtin/ubuntuone-windows-installer/buildout-env

To post a comment you must log in.
314. By Brian Curtin on 2012-04-18

Prefer TRIAL_TEMP_DIR

315. By Brian Curtin on 2012-04-18

Whoops, add TRIALTEMPEXISTS

Diego Sarmentero (diegosarmentero) wrote :

+1

review: Approve
dobey (dobey) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'run-tests.bat'
2--- run-tests.bat 2012-02-29 19:49:44 +0000
3+++ run-tests.bat 2012-04-18 17:55:14 +0000
4@@ -17,9 +17,23 @@
5 @ECHO off
6
7 SET MODULE="ubuntuone"
8-SET PYTHONEXEPATH="C:\Python27"
9+SET PYTHONEXEPATH=""
10 SET IGNORE_PATHS="ubuntuone\controlpanel\dbustests"
11 SET IGNORE_MODULES="test_linux.py, test_libsoup.py"
12+SET PYTHONPATH=..\ubuntu-sso-client;..\ubuntuone-client;.
13+
14+ECHO Checking for Python on the path
15+:: Look for Python from buildout
16+FOR %%A in (python.exe) do (SET PYTHONEXEPATH=%%~$PATH:A)
17+FOR %%B in (u1trial) do (SET TRIALPATH=%%~$PATH:B)
18+FOR %%C in (u1lint) do (SET LINTPATH=%%~$PATH:C)
19+FOR %%D in (pep8.exe) do (SET PEP8PATH=%%~$PATH:D)
20+
21+IF NOT "%PYTHONEXEPATH%" == "" GOTO :PYTHONPRESENT
22+ECHO Please ensure you have python installed
23+GOTO :END
24+
25+:PYTHONPRESENT
26
27 :: throw the first parameter away if is /skip-lint,
28 :: the way we do this is to ensure that /skip-lint
29@@ -47,18 +61,21 @@
30 :CONTINUEBATCH
31
32
33-"%PYTHONEXEPATH%\python.exe" setup.py build
34+"%PYTHONEXEPATH%" setup.py build
35 ECHO Running tests
36 :: execute the tests with a number of ignored linux only modules
37-"%PYTHONEXEPATH%\python.exe" "%PYTHONEXEPATH%\Scripts\u1trial" --reactor=qt4 --gui -p %IGNORE_PATHS% -i %IGNORE_MODULES% %PARAMS% %MODULE%
38+"%PYTHONEXEPATH%" "%TRIALPATH%" --reactor=qt4 --gui -p %IGNORE_PATHS% -i %IGNORE_MODULES% %PARAMS% %MODULE%
39 :: Clean the build from the setupt.py
40 ECHO Cleaning the generated code
41-"%PYTHONEXEPATH%\python.exe" setup.py clean
42+"%PYTHONEXEPATH%" setup.py clean
43
44 IF %SKIPLINT% == 1 GOTO :CLEAN
45 ECHO Performing style checks...
46-"%PYTHONEXEPATH%\python.exe" "%PYTHONEXEPATH%\Scripts\u1lint" --ignore ubuntuone\controlpanel\gui\qt\ui "%MODULE%"
47-"%PYTHONEXEPATH%\Scripts\pep8.exe" --exclude ".svn,CVS,.bzr,.hg,.git,*_ui.py,*_rc.py" --repeat . bin\*
48+"%PYTHONEXEPATH%" "%LINTPATH%" --ignore ubuntuone\controlpanel\gui\qt\ui "%MODULE%"
49+"%PEP8PATH%" --exclude ".svn,CVS,.bzr,.hg,.git,*_ui.py,*_rc.py" --repeat . bin\*
50 :CLEAN
51 :: Delete the temp folders
52-RMDIR /s /q _trial_temp
53+IF "%TRIAL_TEMP_DIR%" == "" GOTO :TRIALTEMPEXISTS
54+IF EXIST _trial_temp RMDIR /s /q _trial_temp
55+:TRIALTEMPEXISTS
56+IF EXIST "%TRIAL_TEMP_DIR%" RMDIR /s /q "%TRIAL_TEMP_DIR%"

Subscribers

People subscribed via source and target branches