Megatest

Check-in [1bb1c0782c]
Login
Overview
Comment:Improved ez test tests and mt_ezstep script
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 1bb1c0782c10799072294d547c2ab41a556e1d55
User & Date: matt on 2011-11-15 21:48:58
Other Links: manifest | tags
Context
2011-11-16
10:49
Fixed dashboard failing to update sometimes, minor tweak to Makefile check-in: d1ee9f149a user: mrwellan tags: trunk
2011-11-15
21:48
Improved ez test tests and mt_ezstep script check-in: 1bb1c0782c user: matt tags: trunk
20:42
Cleaned out some junk files check-in: 633d859e65 user: matt tags: trunk
Changes

Modified launch.scm from [d206050f69] to [31b7f8fd50].

166
167
168
169
170
171
172
173
174

175
176
177
178
179
180
181
182
183
184
185
186
							(logpro-used #f))
						   ;; NB// can safely assume we are in test-area directory
						   (debug:print 4 "ezsteps:\n stepname: " stepname " stepinfo: " stepinfo " stepparts: " stepparts
								" stepparms: " stepparms " stepcmd: " stepcmd)
						   
						   (if (file-exists? (conc stepname ".logpro"))(set! logpro-used #t))

						   ;; first source the previous environment
						   (let ((prev-env (conc ".ezsteps/" prevstep (if (string-search (regexp "csh") (get-environment-variable "SHELL")) ".csh" ".sh"))))

						     (if (and prevstep (file-exists? prev-env))
							 (set! script (conc script "source " prev-env))))
						   
						   ;; call the command using mt_ezstep
						   (set! script (conc script ";mt_ezstep " stepname " " stepcmd))

						   (debug:print 4 "script: " script)

						   (teststep-set-status! db run-id test-name stepname "start" "-" itemdat #f #f)
						   ;; now launch
						   (let ((pid (process-run script)))
						     (let processloop ((i 0))







|
|
>
|
|


|







166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
							(logpro-used #f))
						   ;; NB// can safely assume we are in test-area directory
						   (debug:print 4 "ezsteps:\n stepname: " stepname " stepinfo: " stepinfo " stepparts: " stepparts
								" stepparms: " stepparms " stepcmd: " stepcmd)
						   
						   (if (file-exists? (conc stepname ".logpro"))(set! logpro-used #t))

						   ;; ;; first source the previous environment
						   ;; (let ((prev-env (conc ".ezsteps/" prevstep (if (string-search (regexp "csh") 
						   ;;      							 (get-environment-variable "SHELL")) ".csh" ".sh"))))
						   ;;   (if (and prevstep (file-exists? prev-env))
						   ;;       (set! script (conc script "source " prev-env))))
						   
						   ;; call the command using mt_ezstep
						   (set! script (conc "mt_ezstep " stepname " " (if prevstep prevstep "-") " " stepcmd))

						   (debug:print 4 "script: " script)

						   (teststep-set-status! db run-id test-name stepname "start" "-" itemdat #f #f)
						   ;; now launch
						   (let ((pid (process-run script)))
						     (let processloop ((i 0))

Added tests/tests/ez_exit2_fail/testconfig version [fc174ee7f2].































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
[setup]

[ezsteps]
exit2       exit 2
lookithome  ls /home

[test_meta]
author matt
owner  bob
description This test runs two steps; the first exits with
     code 2 (a fail because not using logpro) and the second
     is a pass

tags first,single
reviewed 09/10/2011, by Matt

Deleted tests/tests/ez_warn/testconfig version [fc174ee7f2].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
[setup]

[ezsteps]
exit2       exit 2
lookithome  ls /home

[test_meta]
author matt
owner  bob
description This test runs two steps; the first exits with
     code 2 (a fail because not using logpro) and the second
     is a pass

tags first,single
reviewed 09/10/2011, by Matt
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<






























Modified tests/tests/ezlog_fail/lookittmp.logpro from [272f1780da] to [961ab4aef4].

1
2
3
4
5
6
7
8
;; (c) 2006,2007,2008,2009 Matthew Welland matt@kiatoa.com
;;  
;;   License GPL.


(expect:ignore   in "LogFileBody"  < 99 "Ignore the word error in comments" #/^\/\/.*error/)
(expect:warning  in "LogFileBody"  = 0 "Any warning" #/WARNING/)
(expect:error    in "LogFileBody"  = 0 "Any error"  (list #/ERROR/ #/.*/)) ;; force an error




<
<


1
2
3
4


5
6
;; (c) 2006,2007,2008,2009 Matthew Welland matt@kiatoa.com
;;  
;;   License GPL.



(expect:warning  in "LogFileBody"  = 0 "Any warning" #/WARNING/)
(expect:error    in "LogFileBody"  = 0 "Any error"  (list #/ERROR/ #/.*/)) ;; force an error

Modified utils/mt_ezstep from [41dcc3da03] to [e004bfd05c].

1
2
3
4
5
6
7
8
9
10
11
12
13
14


15
16
17
18
19





20
21
22
23
24
25
26
#!/bin/bash

if [ "$MT_CMDINFO" == "" ];then
  echo "ERROR: $0 should be run within a megatest test environment"
  exit
fi

# Purpose: This is for the [ezsteps] secton in your testconfig file.
#   DO NOT USE IN YOUR SCRIPTS!
#
# Call like this:
# mt_ezstep stepname command ....
# 
stepname=$1;shift


command=$*

allstatus=99
runstatus=99
logpropstatus=99






# source the environment from the previous step if it exists

# if a logpro file exists then use it otherwise just run the command, nb// was using 2>&1
if [ -e ${stepname}.logpro ];then
   $command 2>&1| logpro ${stepname}.logpro ${stepname}.html &> ${stepname}.log 
   allstatus=(${PIPESTATUS[0]} ${PIPESTATUS[1]})











|


>
>





>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash

if [ "$MT_CMDINFO" == "" ];then
  echo "ERROR: $0 should be run within a megatest test environment"
  exit
fi

# Purpose: This is for the [ezsteps] secton in your testconfig file.
#   DO NOT USE IN YOUR SCRIPTS!
#
# Call like this:
# mt_ezstep stepname prevstepname command ....
# 
stepname=$1;shift
prevstepname=$1;shift

command=$*

allstatus=99
runstatus=99
logpropstatus=99

prev_env=.ezsteps/${prevstepname}.sh
if [ -e $prev_env ];then
    source $prev_env
fi

# source the environment from the previous step if it exists

# if a logpro file exists then use it otherwise just run the command, nb// was using 2>&1
if [ -e ${stepname}.logpro ];then
   $command 2>&1| logpro ${stepname}.logpro ${stepname}.html &> ${stepname}.log 
   allstatus=(${PIPESTATUS[0]} ${PIPESTATUS[1]})