diff --git a/CHANGES.md b/CHANGES.md index c0fbbb9..c837ab9 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -5,6 +5,14 @@ Tim Buckland, https://github.com/Qarj/WebInjectFramework --------------------------------- ## Release History: +### Version 1.08 - Jun 8, 2017 +* optimisations - create less temporary files +* exit 1 if webinject.pl exits 1 +* example wif.config removed from project, but wif.pl can now create a default one if missing +* example on how to alert in Slack channel if regression batch fails +* moved some functionality to webinject.pl for performance reasons +* alert if user account does not have appropriate write permissions + ### Version 1.05 - Jun 12, 2016 * testonly and liveonly was replaced by runon in webinject, wif.pl needs to write out the environment to the webinject config to support this * selenium server location was using a hard coded value rather than the config value diff --git a/MANUAL.md b/MANUAL.md index 20dad5e..06e456f 100644 --- a/MANUAL.md +++ b/MANUAL.md @@ -1,4 +1,4 @@ -# WebInject Framework 1.07 Manual +# WebInject Framework 1.08 Manual # wif.config diff --git a/README.md b/README.md index 1360d86..a34b9b0 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# WebInject Framework 1.05 +# WebInject Framework 1.08 Automated regression testing framework for * managing WebInject configuration diff --git a/wif.pl b/wif.pl index ff47346..fba4d7a 100644 --- a/wif.pl +++ b/wif.pl @@ -8,7 +8,7 @@ use warnings; use vars qw/ $VERSION /; -$VERSION = '1.07'; +$VERSION = '1.08'; # WebInjectFramework is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -547,13 +547,13 @@ sub publish_static_files { _copy ( 'content/root/*', $web_server_location_full); # xsl and css stylesheets plus images - make_path ( $web_server_location_full.'/content/' ) ; + _make_path ( $web_server_location_full.'/content/' ) ; _copy ( 'content/*.css', $web_server_location_full.'/content/' ); _copy ( 'content/*.xsl', $web_server_location_full.'/content/' ); _copy ( 'content/*.jpg', $web_server_location_full.'/content/' ); # javascripts - make_path ( $web_server_location_full.'/scripts/' ) ; + _make_path ( $web_server_location_full.'/scripts/' ) ; _copy ( 'scripts/*.js', $web_server_location_full.'/scripts/' ); return; @@ -1109,9 +1109,7 @@ sub _get_largest_end_time { sub write_pending_result { my ($_run_number) = @_; - make_path( "$today_home/All_Batches" ); - - make_path( "$today_home/All_Batches/$opt_batch" ); + _make_path( "$today_home/All_Batches/$opt_batch" ); _write_pending_record( "$today_home/All_Batches/$opt_batch/$testfile_parent_folder_name".'_'."$testfile_name".'_'."$_run_number".'.txt', $_run_number ); @@ -1245,20 +1243,28 @@ sub check_testfile_xml_parses_ok { return; } +#------------------------------------------------------------------ +sub _make_path { + + my ($_path) = @_; + + make_path( "$_path", {error => \my $err} ); + + if (@$err) { die "\nThis user account needs permission to create $_path\n" }; + + return; +} + #------------------------------------------------------------------ sub create_run_number { if (not -e "$web_server_location_full" ) { - die "Web server location of $web_server_location_full does not exist\n"; + die "\nWeb server location of $web_server_location_full does not exist\n"; } # if they do not exist already, folders are created for this test file for todays date - make_path( "$web_server_location_full/$opt_environment" ); - make_path( "$web_server_location_full/$opt_environment/$yyyy" ); - make_path( "$web_server_location_full/$opt_environment/$yyyy/$mm" ); - make_path( "$today_home" ); - make_path( "$today_home/$testfile_parent_folder_name" ); - make_path( "$today_home/$testfile_parent_folder_name/$testfile_name" ); + _make_path( "$web_server_location_full/$opt_environment/$yyyy/$mm" ); + _make_path( "$today_home/$testfile_parent_folder_name/$testfile_name" ); my $_run_number_full = "$today_home/$testfile_parent_folder_name/$testfile_name/Run_Number.txt"; _lock_file($_run_number_full); @@ -1267,7 +1273,7 @@ sub create_run_number { # create a folder for this run number my $_this_run_home = "$today_home/$testfile_parent_folder_name/$testfile_name/results_$_run_number/"; - make_path( $_this_run_home ); + _make_path( $_this_run_home ); return $_run_number, $_this_run_home; } @@ -1582,7 +1588,7 @@ sub create_temp_folder { $_random = sprintf '%05d', $_random; # add some leading zeros my $_random_folder = $opt_target . '_' . $testfile_name . '_' . $_random; - make_path 'temp/' . $_random_folder or die "\n\nCould not create temporary folder temp/$_random_folder\n"; + _make_path ('temp/' . $_random_folder); return $_random_folder; }