Changeset 2a08cb6 in sasview


Ignore:
Timestamp:
Sep 15, 2016 8:33:57 AM (8 years ago)
Author:
Piotr Rozyczko <rozyczko@…>
Branches:
ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
Children:
a40be8c
Parents:
c89e649
git-author:
Piotr Rozyczko <rozyczko@…> (08/18/16 07:36:55)
git-committer:
Piotr Rozyczko <rozyczko@…> (09/15/16 08:33:57)
Message:

Updated deployment test script

File:
1 edited

Legend:

Unmodified
Added
Removed
  • build_tools/sasview_deploy_test.au3

    r4fc7293 r2a08cb6  
    66; 
    77; 0 - OK 
    8 ; 1 - Installer failure 
    9 ; 2 - Problems running SasView (simple fitting) 
    10 ; 3 - Uninstaller failure 
     8; 1 - Download failure 
     9; 2 - Installer failure 
     10; 3 - Problems running SasView (simple fitting) 
     11; 4 - Uninstaller failure 
    1112 
    1213#include <Constants.au3> 
    1314#include <FileConstants.au3> 
    1415#include <MsgBoxConstants.au3> 
     16#include <InetConstants.au3> 
    1517#include <WinAPIFiles.au3> 
    1618 
     
    1921 
    2022; Modifiable globals 
    21 Global $fInstallerLocation = "C:\util\setupSasView.exe" 
     23if $CmdLine[0] == 0 Then 
     24   ; Expected command line with the build number as argument 
     25   Exit (-1) 
     26EndIf 
     27 
     28Local $lBuildNumber = $CmdLine[1] 
     29;Global $fInstallerLocation = "C:\util\setupSasView.exe" ; debug and testing location 
     30Global $fInstallerLocation = @TempDir & "\setupSasView.exe" 
     31Global $fRemoteInstallerLocation = "https://jenkins.esss.dk/sasview/job/SasView_Win7_Test/" & $lBuildNumber & "/artifact/sasview/dist/setupSasView.exe" 
     32Global $fUninstallerLocation = "C:\Program Files (x86)\SasView\unins000.exe" 
    2233Global $lTimeout = 10          ; 10 sec timeout for waiting on windows 
    2334Global $lInstallTimeout = 120  ; 2 min timeout for the installation process 
     
    2839 
    2940;; MAIN SCRIPT 
     41Download() 
    3042Install() 
    3143RunSasView() 
    3244Uninstall() 
     45 
    3346Exit(0) 
    3447 
    3548;============================================================== 
     49Func Download() 
     50   ; Download the file in the background with the selected option of 'force a reload from the remote site.' 
     51   ConsoleWrite("Downloading...." & @CRLF) 
     52   Local $iFailFlag = 1 
     53   Local $hDownload = InetGet($fRemoteInstallerLocation, $fInstallerLocation, $INET_FORCERELOAD) 
     54 
     55    ; Close the handle returned by InetGet. 
     56    InetClose($hDownload) 
     57        Assert($hDownload, $iFailFlag) 
     58        ConsoleWrite("Installer downloaded successfully to " & $fInstallerLocation & @CRLF) 
     59 
     60EndFunc 
     61 
    3662Func Install() 
    3763   ;;;;; APPLICATION INSTALLED ;;;;;;; 
    3864   Local $sSetupWindow = "Setup - SasView" 
    39  
     65   Local $iFailFlag = 2 
    4066   ; Run setup 
    4167   if FileExists($fInstallerLocation) Then 
    4268          $installerPID = Run($fInstallerLocation) 
    43           Assert($installerPID, 1) 
     69          Assert($installerPID, $iFailFlag) 
    4470          Sleep(1000) 
    4571   Else 
    4672          ;$Error = ObjEvent(AutoIt.Error, "Setup file does not exist","123") 
    47           Exit(1) 
     73          Exit($iFailFlag) 
    4874   EndIf 
    4975 
    5076   ; License click through 
     77   WinActivate($sSetupWindow) ; <-- REQUIRED when connecting from another host 
    5178   Local $test = WinWaitActive($sSetupWindow, "License Agreement", $lTimeout) 
    5279   ;ConsoleWrite("license agreement: " & $test) 
    53    Assert($test, 1) 
     80   Assert($test, $iFailFlag) 
    5481   sleep(1000) 
    5582 
     
    5986   Sleep(1000) 
    6087   $test = WinWaitActive($sSetupWindow, "Select Destination Location", $lTimeout) 
    61    Assert($test, 1) 
     88   Assert($test, $iFailFlag) 
    6289   Send("{ENTER}") 
    6390 
     
    6592   Sleep(1000) 
    6693   $test = WinWaitActive($sSetupWindow, "Select Additional Tasks", $lTimeout) 
    67    Assert($test, 1) 
     94   Assert($test, $iFailFlag) 
    6895   Send("{ENTER}") 
    6996 
     
    7198   Sleep(1000) 
    7299   $test = WinWaitActive($sSetupWindow, "Ready to Install", $lTimeout) 
    73    Assert($test, 1) 
     100   Assert($test, $iFailFlag) 
    74101   Send("{ENTER}") 
    75102 
     
    77104   Sleep(5000) 
    78105   $test = WinWaitActive($sSetupWindow, "Completing the SasView Setup Wizard", $lInstallTimeout) 
    79    Assert($test, 1) 
     106   Assert($test, $iFailFlag) 
    80107   Send("{ENTER}") 
    81108   ;ConsoleWrite("Installed" & @CRLF) 
     
    88115   ; Start app - DEBUG ONLY 
    89116   ;;Run("C:\Program Files (x86)\SasView\SasView.exe") 
    90  
     117   Local $iFailFlag = 2 
    91118   ; Wait for the window 
    92119   Sleep(1000) 
    93120   Local $hWnd = WinWaitActive("SasView  - Fitting -", "", $lTimeout) 
    94    Assert($hWnd, 2) 
     121   Assert($hWnd, $iFailFlag) 
    95122 
    96123   ;;;;; Load a File 
     
    98125   Send("!{f}{ENTER}") 
    99126   WinWaitActive("Choose a file", "", $lTimeout) 
    100    Assert($hWnd, 2) 
     127   Assert($hWnd, $iFailFlag) 
    101128   Sleep(200) 
    102129 
     
    119146 
    120147   Local $hEnd = WinWaitActive("Confirm Exit", "", $lTimeout) 
    121    Assert($hEnd, 2) 
     148   Assert($hEnd, $iFailFlag) 
    122149   ControlClick($hEnd, "", "[CLASS:Button; INSTANCE:1]") 
    123150 
    124151   Local $sv_closed = WinWaitClose($hWnd, "", $lTimeout) 
    125    Assert($sv_closed, 2) 
     152   Assert($sv_closed, $iFailFlag) 
    126153 
    127154EndFunc 
     
    129156Func Uninstall() 
    130157;;;;; UNINSTALL ;;;;;;; 
    131    $installerPID = Run("C:\Program Files (x86)\SasView\unins000.exe") 
     158   Local $iFailFlag = 3 
     159   $installerPID = Run($fUninstallerLocation) 
     160   Assert($installerPID, $iFailFlag) 
    132161 
    133162   Local $sSetupWindow = "SasView Uninstall" 
    134163 
    135164   Local $test = WinWaitActive($sSetupWindow, "", $lTimeout) 
    136    Assert($test, 3) 
     165   Assert($test, $iFailFlag) 
    137166   Send("{TAB}{ENTER}") 
    138167 
    139168   WinActivate("SasView Uninstal") 
    140169   $test = WinWaitActive($sSetupWindow, "SasView was successfully removed", $lTimeout) 
    141    Assert($test, 3) 
     170   Assert($test, $iFailFlag) 
    142171   Send("{ENTER}") 
    143172 
Note: See TracChangeset for help on using the changeset viewer.