Skip to content

Commit

Permalink
Release v1.08, alert if user account does not have write permission
Browse files Browse the repository at this point in the history
  • Loading branch information
Qarj committed Jun 8, 2017
1 parent fc84e5f commit 45c45f0
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 17 deletions.
8 changes: 8 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion MANUAL.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# WebInject Framework 1.07 Manual
# WebInject Framework 1.08 Manual

# wif.config

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# WebInject Framework 1.05
# WebInject Framework 1.08

Automated regression testing framework for
* managing WebInject configuration
Expand Down
36 changes: 21 additions & 15 deletions wif.pl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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 );

Expand Down Expand Up @@ -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);
Expand All @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 45c45f0

Please sign in to comment.