← Back to team overview

mvhub-dev team mailing list archive

[Merge] lp:~leegoodrich/mvhub/fix_testing_hostname into lp:mvhub

 

Lee Goodrich has proposed merging lp:~leegoodrich/mvhub/fix_testing_hostname into lp:mvhub.

Requested reviews:
  mvhub-dev (mvhub-dev)


Fixed the get_testing_website_name subroutine in TestHelper to return 
the name of the website as defined in either mvh.conf or nsp.conf 
in the SITE.website_name parameter. This replaces the old method of 
constructing the hostname based on whether the host was brave or some 
other computer.
-- 
https://code.launchpad.net/~leegoodrich/mvhub/fix_testing_hostname/+merge/22813
Your team mvhub-dev is subscribed to branch lp:mvhub.
=== modified file 'lib-mvhub/t/lib/TestHelper.pm'
--- lib-mvhub/t/lib/TestHelper.pm	2010-04-01 18:19:48 +0000
+++ lib-mvhub/t/lib/TestHelper.pm	2010-04-05 17:35:32 +0000
@@ -6,6 +6,7 @@
 
 use Carp;
 use DBI;
+use File::Basename;
 use MIME::Base64;
 use Test::More;
 
@@ -129,18 +130,11 @@
     croak '$ENV{USER} not defined '
         if not defined $ENV{USER};
 
-    my $hostname = `hostname`;
-    chomp $hostname;
-    my $running_on_brave = $hostname eq 'brave';
-
-    if ($running_on_brave) {
-        return "$prefix.$ENV{USER}.testing123.net";
-    }
-
-    else {    # laptop ???
-        return "$prefix.$ENV{USER}.localhost";
-    }
-
+    my $conf_path = ( File::Basename::fileparse( $ENV{MV_CONFIG_FILE} ) )[1];
+    my $cfg       = MVHub::Utils::ConfigSimple::create_config_from(
+        "$conf_path/$prefix.conf");
+
+    return $cfg->param('SITE.website_name');
 }
 
 sub make_test_file {


Follow ups