Exemplo n.º 1
0
 /**
  * @return string
  */
 protected static function getPythonBinary()
 {
     if (SettingsServer::isWindows()) {
         return "C:\\Python27\\python.exe";
     }
     if (SystemTestCase::isTravisCI()) {
         return 'python2.6';
     }
     return 'python';
 }
Exemplo n.º 2
0
 /**
  * Tests that the Piwik files are not too big, to ensure the downloadable ZIP package is not too large
  */
 public function test_TotalPiwikFilesSize_isWithinReasonnableSize()
 {
     if (!SystemTestCase::isTravisCI()) {
         // Don't run the test on local dev machine, as we may have other files (not in GIT) that would fail this test
         $this->markTestSkipped("Skipped this test on local dev environment.");
     }
     $maximumTotalFilesizesExpectedInMb = 50;
     $minimumTotalFilesizesExpectedInMb = 38;
     $minimumExpectedFilesCount = 7000;
     $filesizes = $this->getAllFilesizes();
     $sumFilesizes = array_sum($filesizes);
     $filesOrderedBySize = $filesizes;
     arsort($filesOrderedBySize);
     $this->assertLessThan($maximumTotalFilesizesExpectedInMb * 1024 * 1024, $sumFilesizes, sprintf("Sum of all files should be less than {$maximumTotalFilesizesExpectedInMb} Mb.\n                    \nGot total file sizes of: %d Mb.\n                    \nBiggest files: %s", $sumFilesizes / 1024 / 1024, var_export(array_slice($filesOrderedBySize, 0, 100, $preserveKeys = true), true)));
     $this->assertGreaterThan($minimumExpectedFilesCount, count($filesizes), "Expected at least {$minimumExpectedFilesCount} files should be included in Piwik.");
     $this->assertGreaterThan($minimumTotalFilesizesExpectedInMb * 1024 * 1024, $sumFilesizes, "expected to have at least {$minimumTotalFilesizesExpectedInMb} Mb of files in Piwik codebase.");
 }