Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Issue #975: Web-based application upgrader
* Upgrade ThinkUp via the web
* Added beta channel option in Application Settings
  • Loading branch information
Mark Wilkie authored and ginatrapani committed Mar 16, 2012
1 parent e99dbd8 commit 732660e
Show file tree
Hide file tree
Showing 43 changed files with 1,220 additions and 180 deletions.
6 changes: 3 additions & 3 deletions .gitignore
@@ -1,7 +1,8 @@
webapp/config.inc.php
webapp/config.inc.bak.php
webapp/data/
data/
!tests/data
!webapp/data/README.md
tests/config.tests.inc.php
.*
extras/cron/config
Expand All @@ -11,6 +12,5 @@ extras/scripts/lic_header.py
extras/scripts/test-pull-postback-conf
webapp/test_installer/*
webapp/plugins/twitterrealtime/streaming/*.pid
build/*
docs/build/*
build/
extras/dev/ramdisk/osx_make_ramdisk_db.conf
1 change: 1 addition & 0 deletions docs/source/install/index.rst
Expand Up @@ -10,6 +10,7 @@ everything you need to know to get ThinkUp up and running on your web server.
quickstart
install
advancedconfig
update
upgrade
backup
perms
Expand Down
23 changes: 23 additions & 0 deletions docs/source/install/update.rst
@@ -0,0 +1,23 @@
Web Based Update Guide
===============================

The following is a general tutorial for how to update ThinkUp
to the latest version using the web based update tools

Prerequisites
-------------
- All of your ThinkUp application files and directories must be writable by the web server user.
- You must have at least 100 Megabytes of free disk space available to perform a web based update.

Run the web based update
------------------------
To run the web based update you just need to navigate to the update url form within tyour ThinkUP instance:
http://younstall.exampl.com/youthinkuppath/install/update.php

Troubleshooting
------------------------
The update tool should alert you to any issues you may have while trying to perform a web based update.
The two most common issue most likely to occur are:

- Invalid file permissions: Your ThinkUp install directory and all its files must be writeable by the web server user.
- Not enough free file space: You will need to have at least 100 megabytes of free space to perform a web based update.
4 changes: 2 additions & 2 deletions extras/scripts/generate-distribution
Expand Up @@ -24,7 +24,7 @@ rm -rf build/thinkup/_lib/extlib/simpletest/
rm -rf build/thinkup/test_installer/
rm -rf build/thinkup/data/*
cp -R webapp/data/README.md build/thinkup/data/.
rm build/thinkup/config.inc.php
rm -rf build/thinkup/config.inc.php

# Clean out dev/alpha plugins which shouldn't go to users
rm -rf build/thinkup/plugins/hellothinkup/
Expand All @@ -34,4 +34,4 @@ rm -rf build/thinkup/plugins/twitterrealtime/
cd build/
zip -r thinkup.zip thinkup
zip -d thinkup.zip __MACOSX* *.DS_Store *.ecoder_permissions_check.txt
rm -rf thinkup
rm -rf thinkup
6 changes: 3 additions & 3 deletions tests/TestOfBackupController.php
Expand Up @@ -105,14 +105,14 @@ public function testLoadBackupViewCLIWarn() {
$this->assertNull($v_mgr->getTemplateDataItem('high_table_row_count') ) ;

// table row counts are bad
$old_count = UpgradeController::$WARN_TABLE_ROW_COUNT;
UpgradeController::$WARN_TABLE_ROW_COUNT = 2;
$old_count = UpgradeDatabaseController::$WARN_TABLE_ROW_COUNT;
UpgradeDatabaseController::$WARN_TABLE_ROW_COUNT = 2;
$results = $controller->control();
$this->assertPattern('/we recommend that you use the/', $results);
$table_counts = $v_mgr->getTemplateDataItem('high_table_row_count');
$this->assertNotNull($table_counts);
$this->assertNotNull(3, $table_counts['count']); // tu_plugins, defaults to three
UpgradeController::$WARN_TABLE_ROW_COUNT = $old_count;
UpgradeDatabaseController::$WARN_TABLE_ROW_COUNT = $old_count;
}

public function XtestBackupCrawlerHasMutex() {
Expand Down
39 changes: 37 additions & 2 deletions tests/TestOfCheckVersionController.php
Expand Up @@ -76,8 +76,8 @@ public function testOptedOut() {
$results = $controller->go();
$this->assertNoPattern('/You must <a href="\/session\/login.php">log in<\/a> to do this/', $results);
$this->assertPattern('/var ROOT = \'thinkup_version\'/', $results);
$this->assertPattern('/var CONTENT_URL = \'http:\/\/thinkupapp.com\/version.php\?v='.$THINKUP_VERSION.
'\&usage=n/', $results);
$this->assertPattern('/var CONTENT_URL = \'http:\/\/thinkupapp.com\/version.php\?usage=n\&v='.$THINKUP_VERSION.
'/', $results);
}

public function testNotOptedOut() {
Expand All @@ -91,4 +91,39 @@ public function testNotOptedOut() {
$this->assertNoPattern('/var CONTENT_URL = \'http:\/\/thinkupapp.com\/version.php?v='.$THINKUP_VERSION.
'\&usage=n/', $results);
}

public function testInBetaNotOptedOut() {
include THINKUP_WEBAPP_PATH.'install/version.php';
$bvalues = array('namespace' => OptionDAO::APP_OPTIONS, 'option_name' => 'is_subscribed_to_beta',
'option_value' => 'true');
$bdata = FixtureBuilder::build('options', $bvalues);

$this->simulateLogin('me@example.com');
$controller = new CheckVersionController(true);

$results = $controller->go();
$this->assertPattern('/var CONTENT_URL = \'http:\/\/thinkupapp.com\/version.php\?channel=beta\&v='.
$THINKUP_VERSION.'/', $results);
$this->assertNoPattern('/var CONTENT_URL = \'http:\/\/thinkupapp.com\/version.php?v='.$THINKUP_VERSION.
'\&usage=n/', $results);
}

public function testInBetaOptedOut() {
include THINKUP_WEBAPP_PATH.'install/version.php';
$bvalues = array('namespace' => OptionDAO::APP_OPTIONS, 'option_name' => 'is_subscribed_to_beta',
'option_value' => 'true');
$bdata = FixtureBuilder::build('options', $bvalues);
$bvalues1 = array('namespace' => OptionDAO::APP_OPTIONS, 'option_name' => 'is_opted_out_usage_stats',
'option_value' => 'true');
$bdata2= FixtureBuilder::build('options', $bvalues);

$this->simulateLogin('me@example.com');
$controller = new CheckVersionController(true);

$results = $controller->go();
$this->assertPattern('/var CONTENT_URL = \'http:\/\/thinkupapp.com\/version.php\?channel=beta\&v='.
$THINKUP_VERSION.'/', $results);
$this->assertNoPattern('/var CONTENT_URL = \'http:\/\/thinkupapp.com\/version.php?v='.$THINKUP_VERSION.
'\&usage=n/', $results);
}
}
1 change: 1 addition & 0 deletions tests/TestOfTestController.php
Expand Up @@ -80,6 +80,7 @@ public function testControl() {
public function testCacheKeyNoRequestParams() {
$config = Config::getInstance();
$config->setValue('cache_pages', true);
$this->debug($config->getValue('datadir_path'));
$controller = new TestController(true);
$results = $controller->go();

Expand Down

0 comments on commit 732660e

Please sign in to comment.