From 1aeeed930aba17a58bb085ed85b4497b5ced56da Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 8 Dec 2019 09:44:05 +0300 Subject: [PATCH] remove a bunch of obsolete files --- .gitlab-ci.yml | 44 ----- tests/ApiTest.php | 256 ---------------------------- utils/gitlab-ci/check-schema.sh | 5 - utils/gitlab-ci/config-template.php | 207 ---------------------- utils/gitlab-ci/nginx-default | 81 --------- utils/gitlab-ci/php-lint.sh | 5 - utils/gitlab-ci/phpmd-ruleset.xml | 20 --- utils/gitlab-ci/phpmd.sh | 8 - 8 files changed, 626 deletions(-) delete mode 100644 .gitlab-ci.yml delete mode 100644 tests/ApiTest.php delete mode 100644 utils/gitlab-ci/check-schema.sh delete mode 100644 utils/gitlab-ci/config-template.php delete mode 100644 utils/gitlab-ci/nginx-default delete mode 100644 utils/gitlab-ci/php-lint.sh delete mode 100644 utils/gitlab-ci/phpmd-ruleset.xml delete mode 100644 utils/gitlab-ci/phpmd.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index cd5ecb0d4..000000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,44 +0,0 @@ -phpmd: - image: php:5.6 - when: manual - script: - - sh utils/gitlab-ci/php-lint.sh - - curl -o /usr/bin/phpmd -L http://static.phpmd.org/php/2.6.0/phpmd.phar - - chmod +x /usr/bin/phpmd - - sh utils/gitlab-ci/phpmd.sh - -schema: - image: fox/selenium-ci - when: manual - script: - - /etc/init.d/postgresql start - - /usr/local/sbin/init-database.sh - - sh ./utils/gitlab-ci/check-schema.sh - -phpunit_basic: - image: fox/selenium-ci - when: manual - script: - - /etc/init.d/postgresql start - - /usr/local/sbin/init-database.sh - - sh ./utils/gitlab-ci/check-schema.sh - - cp utils/gitlab-ci/config-template.php config.php - - su -s /bin/bash www-data -c "php ./update.php --debug-feed 1" - - wget -O /usr/bin/phpunit https://phar.phpunit.de/phpunit-5.7.phar - - chmod +x /usr/bin/phpunit - - phpunit tests/*.php - -phpunit_functional: - image: fox/selenium-ci - when: manual - script: - - /etc/init.d/postgresql start - - /etc/init.d/nginx start - - /etc/init.d/php5-fpm start - - /usr/local/sbin/init-database.sh - - sh ./utils/gitlab-ci/check-schema.sh - - ln -s `pwd` ../../tt-rss - - cp utils/gitlab-ci/config-template.php config.php - - chmod -R 777 cache lock feed-icons - - /usr/local/sbin/init-selenium.sh - - phpunit tests/functional/*.php diff --git a/tests/ApiTest.php b/tests/ApiTest.php deleted file mode 100644 index 24f474e51..000000000 --- a/tests/ApiTest.php +++ /dev/null @@ -1,256 +0,0 @@ -$method(); - $rv = json_decode(ob_get_contents(), true); - ob_end_clean(); - - $this->assertEquals(API::STATUS_OK, $rv['status']); - - return $rv; - } - - public function testBasicAuth() { - $this->assertEquals(true, - authenticate_user("admin", "password")); - } - - public function testVersion() { - - $ret = $this->apiCall([], "getVersion"); - - $this->assertStringStartsWith( - VERSION_STATIC, - $ret['content']['version']); - } - - public function testLogin() { - - $ret = $this->apiCall(["op" => "login", - "user" => "admin", - "password" => "password"], "login"); - - $this->assertNotEmpty($ret['content']['session_id']); - } - - public function testGetUnread() { - $this->testLogin(); - $ret = $this->apiCall([],"getUnread"); - - $this->assertNotEmpty($ret['content']['unread']); - } - - public function testGetFeeds() { - $this->testLogin(); - $ret = $this->apiCall([], "getFeeds"); - - $this->assertInternalType('array', $ret['content']); - - $this->assertEquals("http://tt-rss.org/forum/rss.php", - $ret['content'][0]['feed_url']); - - } - - public function testGetCategories() { - $this->testLogin(); - $ret = $this->apiCall([], "getCategories"); - - $this->assertInternalType('array', $ret['content']); - - $this->assertGreaterThanOrEqual(2, sizeof($ret['content'])); - - foreach ($ret['content'] as $cat) { - - $this->assertNotEmpty($cat['title']); - $this->assertNotNull($cat['id']); - $this->assertGreaterThanOrEqual(0, $cat['unread']); - - $this->assertContains($cat['title'], - ['Special', 'Labels', 'Uncategorized']); - } - } - - public function testGetHeadlines() { - $this->testLogin(); - $ret = $this->apiCall(['feed_id' => -4, 'view_mode' => 'adaptive'], "getHeadlines"); - - $this->assertInternalType('array', $ret['content']); - - foreach ($ret['content'] as $hl) { - $this->assertInternalType('array', $hl); - - $this->assertNotEmpty($hl['guid']); - $this->assertNotEmpty($hl['title']); - $this->assertNotEmpty($hl['link']); - } - - $ret = $this->apiCall(['feed_id' => 1, 'view_mode' => 'all_articles'], "getHeadlines"); - - $this->assertInternalType('array', $ret['content']); - - foreach ($ret['content'] as $hl) { - $this->assertInternalType('array', $hl); - - $this->assertNotEmpty($hl['guid']); - $this->assertNotEmpty($hl['title']); - $this->assertNotEmpty($hl['link']); - } - } - - public function testArticle() { - - $this->testLogin(); - $ret = $this->apiCall(['feed_id' => -4], "getHeadlines"); - - $this->assertInternalType('array', $ret['content'][0]); - $article_id = $ret['content'][0]['id']; - $title = $ret['content'][0]['title']; - - $ret = $this->apiCall(['article_id' => $article_id], "getArticle"); - - $this->assertInternalType('array', $ret['content']); - $this->assertNotEmpty($ret['content'][0]['content']); - $this->assertEquals($title, $ret['content'][0]['title']); - } - - public function testCounters() { - - $this->testLogin(); - $ret = $this->apiCall(['output_mode' => 'flc'], "getCounters"); - - $this->assertInternalType('array', $ret['content']); - - foreach ($ret['content'] as $ctr) { - $this->assertInternalType('array', $ctr); - - $this->assertNotNull($ctr['id']); - $this->assertGreaterThanOrEqual(0, $ctr['counter']); - } - } - - public function testGetConfig() { - - $this->testLogin(); - $ret = $this->apiCall([], "getConfig"); - - $this->assertInternalType('array', $ret['content']); - - foreach ($ret['content'] as $k => $v) { - $this->assertInternalType('string', $k); - $this->assertNotEmpty($k); - } - } - - public function testBasicPrefs() { - - $this->testLogin(); - $ret = $this->apiCall(['pref_name' => 'ENABLE_API_ACCESS'], "getPref"); - $this->assertEquals(1, $ret['content']['value']); - - set_pref('ENABLE_API_ACCESS', false, 1); - - $ret = $this->apiCall(['pref_name' => 'ENABLE_API_ACCESS'], "getPref"); - $this->assertEquals(0, $ret['content']['value']); - - set_pref('ENABLE_API_ACCESS', true, 1); - - $ret = $this->apiCall(['pref_name' => 'ENABLE_API_ACCESS'], "getPref"); - $this->assertEquals(1, $ret['content']['value']); - } - - public function testFeedTree() { - - $this->testLogin(); - $ret = $this->apiCall([], "getFeedTree"); - $this->assertInternalType('array', $ret['content']); - - // root - foreach ($ret['content'] as $tr) { - $this->assertInternalType('array', $tr); - - $this->assertInternalType('array', $tr['items']); - - // cats - foreach ($tr['items'] as $cr) { - $this->assertInternalType('array', $cr['items']); - - $this->assertNotEmpty($cr['id']); - $this->assertNotEmpty($cr['name']); - - // feeds - foreach ($cr['items'] as $fr) { - $this->assertNotEmpty($fr['id']); - $this->assertNotEmpty($fr['name']); - } - } - } - } - - - public function testLabels() { - // create label - - Labels::create('Test', '', '', 1); - - $this->testLogin(); - $ret = $this->apiCall([], "getLabels"); - $this->assertInternalType('array', $ret['content']); - - $this->assertEquals('Test', $ret['content'][0]['caption']); - $label_feed_id = $ret['content'][0]['id']; - $label_id = Labels::feed_to_label_id($label_feed_id); - - $this->assertLessThan(0, $label_feed_id); - $this->assertGreaterThan(0, $label_id); - - // assign/remove label to article - - $ret = $this->apiCall(['feed_id' => -4, 'view_mode' => 'adaptive'], "getHeadlines"); - $this->assertInternalType('array', $ret['content'][0]); - $article_id = $ret['content'][0]['id']; - - $ret = $this->apiCall(['article_ids' => $article_id, - 'label_id' => $label_feed_id, "assign" => "true"], - "setArticleLabel"); - - $ret = $this->apiCall(['article_id' => $article_id], "getArticle"); - $this->assertContains($label_feed_id, $ret['content'][0]['labels'][0]); - - $ret = $this->apiCall(['article_ids' => $article_id, - 'label_id' => $label_feed_id, "assign" => "false"], - "setArticleLabel"); - - $ret = $this->apiCall(['article_id' => $article_id], "getArticle"); - $this->assertEmpty($ret['content'][0]['labels']); - - // clean up and check - - Labels::remove($label_id, 1); - - $ret = $this->apiCall([], "getLabels"); - $this->assertEmpty($ret['content']); - } - - -} diff --git a/utils/gitlab-ci/check-schema.sh b/utils/gitlab-ci/check-schema.sh deleted file mode 100644 index a7e63ae01..000000000 --- a/utils/gitlab-ci/check-schema.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -export PGPASSWORD=test - -psql -h localhost -q -U test test < schema/ttrss_schema_pgsql.sql diff --git a/utils/gitlab-ci/config-template.php b/utils/gitlab-ci/config-template.php deleted file mode 100644 index abe34442e..000000000 --- a/utils/gitlab-ci/config-template.php +++ /dev/null @@ -1,207 +0,0 @@ - System), syslog - logs to system log. - // Setting this to blank uses PHP logging (usually to http server - // error.log). - - define('CONFIG_VERSION', 26); - // Expected config version. Please update this option in config.php - // if necessary (after migrating all new options from this file). - - // vim:ft=php diff --git a/utils/gitlab-ci/nginx-default b/utils/gitlab-ci/nginx-default deleted file mode 100644 index 1989af927..000000000 --- a/utils/gitlab-ci/nginx-default +++ /dev/null @@ -1,81 +0,0 @@ -## -# You should look at the following URL's in order to grasp a solid understanding -# of Nginx configuration files in order to fully unleash the power of Nginx. -# http://wiki.nginx.org/Pitfalls -# http://wiki.nginx.org/QuickStart -# http://wiki.nginx.org/Configuration -# -# Generally, you will want to move this file somewhere, and start with a clean -# file but keep this around for reference. Or just disable in sites-enabled. -# -# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples. -## - -# Default server configuration -# -server { - listen 80 default_server; - listen [::]:80 default_server; - - # SSL configuration - # - # listen 443 ssl default_server; - # listen [::]:443 ssl default_server; - # - # Self signed certs generated by the ssl-cert package - # Don't use them in a production server! - # - # include snippets/snakeoil.conf; - - root /builds/; - - # Add index.php to the list if you are using PHP - index index.php index.html index.htm index.nginx-debian.html; - - server_name _; - - location / { - # First attempt to serve request as file, then - # as directory, then fall back to displaying a 404. - try_files $uri $uri/ =404; - autoindex on; - } - - # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 - # - location ~ \.php$ { - include snippets/fastcgi-php.conf; - - # With php5-cgi alone: - #fastcgi_pass 127.0.0.1:9000; - # With php5-fpm: - fastcgi_pass unix:/var/run/php5-fpm.sock; - } - - # deny access to .htaccess files, if Apache's document root - # concurs with nginx's one - # - #location ~ /\.ht { - # deny all; - #} -} - - -# Virtual Host configuration for example.com -# -# You can move that to a different file under sites-available/ and symlink that -# to sites-enabled/ to enable it. -# -#server { -# listen 80; -# listen [::]:80; -# -# server_name example.com; -# -# root /var/www/example.com; -# index index.html; -# -# location / { -# try_files $uri $uri/ =404; -# } -#} diff --git a/utils/gitlab-ci/php-lint.sh b/utils/gitlab-ci/php-lint.sh deleted file mode 100644 index 9bd513f88..000000000 --- a/utils/gitlab-ci/php-lint.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -set -e - -exec find . -name "*.php" -not -path "*/lib/*" -print0 | xargs -0 -n1 php -l diff --git a/utils/gitlab-ci/phpmd-ruleset.xml b/utils/gitlab-ci/phpmd-ruleset.xml deleted file mode 100644 index d2c010fbc..000000000 --- a/utils/gitlab-ci/phpmd-ruleset.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - phpmd - - - - - - - - - diff --git a/utils/gitlab-ci/phpmd.sh b/utils/gitlab-ci/phpmd.sh deleted file mode 100644 index 7541db840..000000000 --- a/utils/gitlab-ci/phpmd.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -set -e - -phpmd include,classes,plugins text utils/gitlab-ci/phpmd-ruleset.xml - -FILES=$(ls -dm *.php | tr -d " "| tr -d "\n") -phpmd $FILES text utils/gitlab-ci/phpmd-ruleset.xml