Index: openacs-4/packages/acs-automated-testing/tcl/coverage-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-automated-testing/tcl/coverage-procs.tcl,v
diff -u -r1.1.2.9 -r1.1.2.10
--- openacs-4/packages/acs-automated-testing/tcl/coverage-procs.tcl 27 Feb 2021 20:17:05 -0000 1.1.2.9
+++ openacs-4/packages/acs-automated-testing/tcl/coverage-procs.tcl 28 Feb 2021 16:56:17 -0000 1.1.2.10
@@ -130,6 +130,7 @@
}
return "procs $procs covered $procs_covered coverage [format {%0.2f} $coverage]"
}
+
ad_proc -private aa::percentage_to_color {
percentage
} {
Index: openacs-4/packages/acs-automated-testing/tcl/example-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-automated-testing/tcl/example-procs.tcl,v
diff -u -r1.4.2.1 -r1.4.2.2
--- openacs-4/packages/acs-automated-testing/tcl/example-procs.tcl 18 Feb 2021 14:41:14 -0000 1.4.2.1
+++ openacs-4/packages/acs-automated-testing/tcl/example-procs.tcl 28 Feb 2021 16:56:17 -0000 1.4.2.2
@@ -9,12 +9,12 @@
ad_library {
Example procedures with which to demonstrate the acs-automated-testing
automated testing platform.
-
+
@author Peter Harper (peter.harper@open-msg.com)
@creation-date 24 July 2001
@cvs-id $Id$
}
-
+
ad_proc -private aa_example_write_audit_entry {
name
value
@@ -25,7 +25,7 @@
ns_log debug "aa_example_write_audit_entry: Auditing: $name, $value"
return 1
}
-
+
ad_proc -public aa_example_write_audit_entries {
entries
} {
Index: openacs-4/packages/acs-automated-testing/www/index.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-automated-testing/www/index.tcl,v
diff -u -r1.9 -r1.9.2.1
--- openacs-4/packages/acs-automated-testing/www/index.tcl 9 May 2018 15:33:28 -0000 1.9
+++ openacs-4/packages/acs-automated-testing/www/index.tcl 28 Feb 2021 16:56:17 -0000 1.9.2.1
@@ -23,15 +23,15 @@
aa_test::parse_test_file -path $test_path -array test
array set testcase_failure $test(testcase_failure)
set service(num_errors) [array size testcase_failure]
- }
-
- set admin_login_url [export_vars -base "$service(url)/register/auto-login" {{email {$service(adminemail)}} {password {$service(adminpassword)}}}]
+ }
+ set admin_login_url [export_vars -base "$service(url)/register/auto-login" {{email {$service(adminemail)}} {password {$service(adminpassword)}}}]
+
multirow append servers \
$service(path) \
- $admin_login_url \
+ $admin_login_url \
[export_vars -base server { path }] \
- $service(url) \
+ $service(url) \
$service(name) \
$service(description) \
$service(install_end_timestamp) \
Index: openacs-4/packages/acs-automated-testing/www/server.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-automated-testing/www/server.tcl,v
diff -u -r1.4 -r1.4.2.1
--- openacs-4/packages/acs-automated-testing/www/server.tcl 7 Aug 2017 23:47:46 -0000 1.4
+++ openacs-4/packages/acs-automated-testing/www/server.tcl 28 Feb 2021 16:56:17 -0000 1.4.2.1
@@ -11,21 +11,23 @@
set test_path [aa_test::test_file_path -install_file_path $path]
set has_test_report_p [file exists $test_path]
-multirow create testcase_failures testcase_id count
+multirow create testcase_failures testcase_id count
if { $has_test_report_p } {
aa_test::parse_test_file -path $test_path -array test
array set testcase_failure $test(testcase_failure)
foreach testcase_id [array names testcase_failure] {
- multirow append testcase_failures $testcase_id $testcase_failure($testcase_id)
+ multirow append testcase_failures $testcase_id $testcase_failure($testcase_id)
}
}
set page_title "Control Page for Server $service(name)"
set context [list $page_title]
-set admin_login_url [export_vars -base "$service(url)/register/auto-login" {{email {$service(adminemail)}} {password {$service(adminpassword)}}}]
+set admin_login_url [export_vars -base "$service(url)/register/auto-login" {
+ {email {$service(adminemail)}} {password {$service(adminpassword)}}
+}]
set rebuild_url [export_vars -base rebuild-server { { server $service(name) } }]
set rebuild_log_url "/rebuild-$service(name).log"
Index: openacs-4/packages/acs-automated-testing/www/admin/index.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-automated-testing/www/admin/index.tcl,v
diff -u -r1.16.2.10 -r1.16.2.11
--- openacs-4/packages/acs-automated-testing/www/admin/index.tcl 28 Feb 2021 16:42:10 -0000 1.16.2.10
+++ openacs-4/packages/acs-automated-testing/www/admin/index.tcl 28 Feb 2021 16:56:17 -0000 1.16.2.11
@@ -106,7 +106,7 @@
set global_test_coverage_percent [dict get $global_test_coverage coverage]
set global_test_coverage_level [aa::coverage::proc_coverage_level $global_test_coverage_percent]
set global_test_coverage_color [aa::percentage_to_color $global_test_coverage_percent]
-
+
#
# Prepare the template data for a view_by "package"
#
Index: openacs-4/packages/acs-automated-testing/www/admin/proc-coverage.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-automated-testing/www/admin/proc-coverage.tcl,v
diff -u -r1.5.2.3 -r1.5.2.4
--- openacs-4/packages/acs-automated-testing/www/admin/proc-coverage.tcl 28 Feb 2021 16:42:10 -0000 1.5.2.3
+++ openacs-4/packages/acs-automated-testing/www/admin/proc-coverage.tcl 28 Feb 2021 16:56:17 -0000 1.5.2.4
@@ -38,7 +38,7 @@
set title "Test coverage of $package_key"
set context [list \
[list "./index?by_package_key=$package_key&view_by=testcase" "Package $package_key"] \
- "Test coverage"]
+ "Test coverage"]
set proc_list [aa::coverage::proc_list -package_key $package_key]
set test_coverage [aa::coverage::proc_coverage -package_key $package_key]
set list_elements [list]
Index: openacs-4/packages/acs-automated-testing/www/admin/record-test.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-automated-testing/www/admin/record-test.tcl,v
diff -u -r1.5.2.3 -r1.5.2.4
--- openacs-4/packages/acs-automated-testing/www/admin/record-test.tcl 11 Aug 2020 20:44:38 -0000 1.5.2.3
+++ openacs-4/packages/acs-automated-testing/www/admin/record-test.tcl 28 Feb 2021 16:56:17 -0000 1.5.2.4
@@ -1,9 +1,9 @@
# packages/acs-automated-testing/www/admin/record-test.tcl
ad_page_contract {
-
+
Creates test cases and add them to a library
-
+
@author Enrique Catalan (enrique.catalan@quest.ie)
@creation-date 2007-08-21
@cvs-id $Id$
@@ -18,17 +18,17 @@
# Todo
# This is a first attempt of integrating the TwtR
# with oacs. I think it is a good point to start
-# but in the ToDo list would be really useful to
+# but in the ToDo list would be really useful to
# have:
# - Parsing the Test code to replace fixed values with
# Random ones (i.e. names, descriptions, intervals,
-# etc.). We might need to change TwtR src.
+# etc.). We might need to change TwtR src.
# - Modify the js code of TwtR to be able to print
# the code in this form to avoid users copy&paste it
-# - Find a way to get fixed date values and replace
-# them with dynamic date values
+# - Find a way to get fixed date values and replace
+# them with dynamic date values
# - Might be useful to keep record in the db to this
-# kind if testing procs, for statistics just
+# kind if testing procs, for statistics just
# or more control
set title "Record a new test"
@@ -38,114 +38,114 @@
ad_form -name new_test -method post -export {package_key return_url} \
-form {
- test_id:key
- { test_name:text
- {label "Test Name"}
- {html {size 50}}
- }
- { test_description:text
- {label "Short Description"}
- {html {size 70}}
- }
- { search_str:text,optional
- {label "Search String"}
- {html {size 50}}
- {help_text "Sometimes, you might need this string to check if the test is successful or no (i.e. testing Warning messages)
If you want to check more than one string, use a comma to separate the different strings"}
- }
- { login_type:integer(select)
- {label "Login Type"}
- {options {{admin -1} {newuser -2} {searched_user 0}}}
- }
- { login_id:party_search(party_search),optional
- {label "Type a keyword to find a user"}
- }
- { test_code:text(textarea),nospell
- {html {cols 90 rows 50}}
- {label "Test Code"}
- {help_text "The test code itself, usually generated by the TwtR pluging for Firefox (http://www.km.co.at/km/twtr)"}
- }
+ test_id:key
+ { test_name:text
+ {label "Test Name"}
+ {html {size 50}}
+ }
+ { test_description:text
+ {label "Short Description"}
+ {html {size 70}}
+ }
+ { search_str:text,optional
+ {label "Search String"}
+ {html {size 50}}
+ {help_text "Sometimes, you might need this string to check if the test is successful or no (i.e. testing Warning messages)
If you want to check more than one string, use a comma to separate the different strings"}
+ }
+ { login_type:integer(select)
+ {label "Login Type"}
+ {options {{admin -1} {newuser -2} {searched_user 0}}}
+ }
+ { login_id:party_search(party_search),optional
+ {label "Type a keyword to find a user"}
+ }
+ { test_code:text(textarea),nospell
+ {html {cols 90 rows 50}}
+ {label "Test Code"}
+ {help_text "The test code itself, usually generated by the TwtR pluging for Firefox (http://www.km.co.at/km/twtr)"}
+ }
} \
-validate {
- { test_name
- { $test_name ne "" }
- {The name can not contain special characters, whitespaces or be null}
- }
- { login_type
- { 1 }
- {You forgot to search the user}
- }
+ { test_name
+ { $test_name ne "" }
+ {The name can not contain special characters, whitespaces or be null}
+ }
+ { login_type
+ { 1 }
+ {You forgot to search the user}
+ }
} \
-new_request {
- set test_name ""
- set test_description ""
- set test_code ""
- set search_str ""
+ set test_name ""
+ set test_description ""
+ set test_code ""
+ set search_str ""
} \
-new_data {
-
- # Open the automated tests Tcl file
- # of this package key and add the
- # test code to the script, then
- # do an eval to load the test proc.
- # Get the test directory
- set pkg_test_path "[acs_package_root_dir $package_key]/tcl/test/"
+ # Open the automated tests Tcl file
+ # of this package key and add the
+ # test code to the script, then
+ # do an eval to load the test proc.
- # Create or Open the test cases file and add the
- # code
- set file_name "$package_key-recorded-test-procs.tcl"
- set full_path "${pkg_test_path}${file_name}"
+ # Get the test directory
+ set pkg_test_path "[acs_package_root_dir $package_key]/tcl/test/"
- # Get the namespace
- set package_namespace "${package_key}::twt"
+ # Create or Open the test cases file and add the
+ # code
+ set file_name "$package_key-recorded-test-procs.tcl"
+ set full_path "${pkg_test_path}${file_name}"
+ # Get the namespace
+ set package_namespace "${package_key}::twt"
+
if {$login_id eq ""} {
if {$login_type == -2} {
-# set login_code "twt::user::create"
- set login_code "
+# set login_code "twt::user::create"
+ set login_code "
array set user_info \[twt::user::create\]
twt::user::login \$user_info(email) \$user_info(password)
"
} elseif {$login_type == -1} {
-# set login_code "twt::user::create -admin"
- set login_code "
+# set login_code "twt::user::create -admin"
+ set login_code "
array set user_info \[twt::user::create -admin\]
twt::user::login \$user_info(email) \$user_info(password)
"
}
} else {
set login_code "ad_user_login -forever $login_id"
}
-
- if { ![file exists $full_path] } {
- # file does not exist yet
- set file [open $full_path w+]
- puts $file "
+ if { ![file exists $full_path] } {
+ # file does not exist yet
+ set file [open $full_path w+]
+
+ puts $file "
ad_library {
- This library was generated automatically for Automated tests
+ This library was generated automatically for Automated tests
for ${package_key}
- @author Automatically generated (Ref ${creation_user} )
+ @author Automatically generated (Ref ${creation_user} )
@creation-date [clock format [clock seconds] -format {%Y-%m-%d %H:%M}]
}
namespace eval ${package_namespace} {}
"
- } else {
- # file exists, let us do the job =)
- set file [open $full_path a]
- }
+ } else {
+ # file exists, let us do the job =)
+ set file [open $full_path a]
+ }
# To be able to use these cases on other server instances
- # we need to replace the URL generated by TwtR
- # with the URL provided by ad_url, we could do
+ # we need to replace the URL generated by TwtR
+ # with the URL provided by ad_url, we could do
# a string map or use the regexp or regsub like
#regsub {::tclwebtest::do_request
# \{http://([^:/]+)(:([0-9]*))?} $line [ad_url] new_line2
- puts $file "
+ puts $file "
#------------------------------------------
# Code for case ${test_name}
#------------------------------------------
@@ -169,13 +169,13 @@
if { \[string ne $search_str \"\"\] } {
set string_list \[split \$search_str \",\"\]
foreach item \$string_list {
- if { \[catch {tclwebtest::assert text \$item} errmsg\] } {
- aa_error \"Text \$item was not found!: \$errmsg\"
- incr errors
- } else {
- aa_log \"Good news! :), Text \$item was found!\"
- }
+ if { \[catch {tclwebtest::assert text \$item} errmsg\] } {
+ aa_error \"Text \$item was not found!: \$errmsg\"
+ incr errors
+ } else {
+ aa_log \"Good news! :), Text \$item was found!\"
}
+ }
}
# if no errors, test has passed
if { !\$errors } {
@@ -184,8 +184,8 @@
aa_log \"Finishing ${package_namespace}::${test_name}\"
twt::user::logout
aa_display_result \
- -response \$response \
- -explanation \"for test: ${test_name} \"
+ -response \$response \
+ -explanation \"for test: ${test_name} \"
}
#------------------------------------------
# End of code for case ${test_name}
Index: openacs-4/packages/acs-automated-testing/tcl/test/acs-automated-testing-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-automated-testing/tcl/test/acs-automated-testing-procs.tcl,v
diff -u -r1.10.2.7 -r1.10.2.8
--- openacs-4/packages/acs-automated-testing/tcl/test/acs-automated-testing-procs.tcl 28 Feb 2021 16:41:21 -0000 1.10.2.7
+++ openacs-4/packages/acs-automated-testing/tcl/test/acs-automated-testing-procs.tcl 28 Feb 2021 16:57:02 -0000 1.10.2.8
@@ -10,7 +10,7 @@
-procs {
aa_equals
aa_false
- aa_log
+ aa_log
aa_run_with_teardown
aa_section
aa_true
@@ -195,7 +195,7 @@
aa_equals
aa_runseries
- aa_register_case
+ aa_register_case
} \
aa__coverage_proc_coverage_level {
@@ -225,7 +225,7 @@
} {
dict set cases aa_test_category { stress 1 all 0 security_risk 1 }
dict set cases aa_test_view_by {testcase 1 package 1 stress 0 " " 0}
-
+
foreach filter [dict keys $cases] {
foreach { value result } [dict get $cases $filter] {
if { $result } {