From d99bdf562d63f99a6d68a48a650233d50e834003 Mon Sep 17 00:00:00 2001 From: Benjamin Brahmer Date: Thu, 10 Mar 2022 15:49:22 +0100 Subject: Use builtin php server to test the api rename integration to command Signed-off-by: Benjamin Brahmer --- .github/workflows/api-integration-tests.yml | 20 ++++- tests/command/explore.bats | 12 +++ tests/command/feeds.bats | 116 ++++++++++++++++++++++++++++ tests/command/folders.bats | 64 +++++++++++++++ tests/command/helpers/settings.bash | 4 + tests/command/items.bats | 84 ++++++++++++++++++++ tests/command/opml.bats | 26 +++++++ tests/integration/explore.bats | 12 --- tests/integration/feeds.bats | 116 ---------------------------- tests/integration/folders.bats | 64 --------------- tests/integration/helpers/settings.bash | 4 - tests/integration/items.bats | 84 -------------------- tests/integration/opml.bats | 26 ------- 13 files changed, 323 insertions(+), 309 deletions(-) create mode 100644 tests/command/explore.bats create mode 100644 tests/command/feeds.bats create mode 100644 tests/command/folders.bats create mode 100644 tests/command/helpers/settings.bash create mode 100644 tests/command/items.bats create mode 100644 tests/command/opml.bats delete mode 100644 tests/integration/explore.bats delete mode 100644 tests/integration/feeds.bats delete mode 100644 tests/integration/folders.bats delete mode 100644 tests/integration/helpers/settings.bash delete mode 100644 tests/integration/items.bats delete mode 100644 tests/integration/opml.bats diff --git a/.github/workflows/api-integration-tests.yml b/.github/workflows/api-integration-tests.yml index c9a1d4cc9..c1d7bb6f9 100644 --- a/.github/workflows/api-integration-tests.yml +++ b/.github/workflows/api-integration-tests.yml @@ -33,11 +33,11 @@ jobs: database: ['sqlite', 'pgsql', 'mysql'] experimental: [false] include: - - php-versions: 8.0 + - php-versions: '8.0' nextcloud: pre-release database: sqlite experimental: true - - php-versions: 8.1 + - php-versions: '8.1' nextcloud: pre-release database: sqlite experimental: true @@ -108,6 +108,19 @@ jobs: check-code: false force: ${{ matrix.experimental }} + - name: run api test + if: matrix.database == 'sqlite' + working-directory: ../server + run: | + php -S localhost:8080 > /tmp/webserver.log & + sleep 2 + + # Call folders api + curl -v -u admin:admin http://localhost:8080/index.php/apps/news/api/v1-2/folders + + # Kill php server + kill %1 + - name: Setup problem matchers for PHP run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" @@ -118,7 +131,7 @@ jobs: - name: Functional tests working-directory: ../server - run: bats apps/news/tests/integration + run: bats apps/news/tests/command - name: Prep PHP tests working-directory: ../server/apps/news @@ -127,3 +140,4 @@ jobs: - name: Feed tests working-directory: ../server/apps/news run: make feed-test + diff --git a/tests/command/explore.bats b/tests/command/explore.bats new file mode 100644 index 000000000..7407dc8a8 --- /dev/null +++ b/tests/command/explore.bats @@ -0,0 +1,12 @@ +#!/usr/bin/env bats + +load "helpers/settings" + +TESTSUITE="Explore" + +@test "[$TESTSUITE] Create new" { + curl --fail "$NC_FEED" + + run ./occ news:generate-explore --votes 100 "$NC_FEED" + [ "$status" -eq 0 ] +} \ No newline at end of file diff --git a/tests/command/feeds.bats b/tests/command/feeds.bats new file mode 100644 index 000000000..5ad52dc30 --- /dev/null +++ b/tests/command/feeds.bats @@ -0,0 +1,116 @@ +#!/usr/bin/env bats + +load "helpers/settings" + +TESTSUITE="Feeds" + +teardown() { + ID=$(./occ news:feed:list 'admin' | grep "Something-${BATS_SUITE_TEST_NUMBER}" -2 | head -1 | grep -oE '[0-9]*') + if [ -n "$ID" ]; then + ./occ news:feed:delete "$user" "$ID" + fi +} + +@test "[$TESTSUITE] Create new" { + run "./occ" news:feed:add "$user" "$NC_FEED" + [ "$status" -eq 0 ] + + if ! echo "$output" | grep '"ID":'; then + ret_status=$? + echo "Feed ID not returned" + return $ret_status + fi +} + +@test "[$TESTSUITE] Add feed without GUIDs" { + run ./occ news:feed:add "$user" "$NO_GUID_FEED" + [ "$status" -ne 0 ] + + if ! echo "$output" | grep "No parser can handle this stream"; then + ret_status=$? + echo "Malformed feed exception wasn't properly caught" + return $ret_status + fi +} + +@test "[$TESTSUITE] List all" { + ./occ news:feed:add "$user" "$NC_FEED" --title "Something-${BATS_SUITE_TEST_NUMBER}" + + run ./occ news:feed:list "$user" + [ "$status" -eq 0 ] + + if ! echo "$output" | grep "Something-${BATS_SUITE_TEST_NUMBER}"; then + ret_status=$? + echo "Feed not found in list" + return $ret_status + fi + +} + +@test "[$TESTSUITE] Favicon" { + ./occ news:feed:add "$user" "$NC_FEED" --title "Something-${BATS_SUITE_TEST_NUMBER}" + ./occ news:feed:add "$user" "$HEISE_FEED" --title "Something-${BATS_SUITE_TEST_NUMBER}" + + run ./occ news:feed:list "$user" + [ "$status" -eq 0 ] + + if ! echo "$output" | grep -F '"faviconLink": "https:\/\/nextcloud.com\/media\/screenshot-150x150.png"'; then + ret_status=$? + echo "Logo test failed" + return $ret_status + fi + + if ! echo "$output" | grep -F '"faviconLink": "https:\/\/www.heise.de\/favicon.ico"'; then + ret_status=$? + echo "Favicon test failed" + return $ret_status + fi +} + +@test "[$TESTSUITE] List all items" { + ./occ news:feed:add "$user" "https://github.com/nextcloud/news/releases.atom" --title "Something-${BATS_SUITE_TEST_NUMBER}" + + TAG=$(curl --silent "https://api.github.com/repos/nextcloud/news/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/') + ID=$(./occ news:feed:list 'admin' | grep 'github\.com' -1 | head -1 | grep -oE '[0-9]*') + + run ./occ news:item:list-feed "$user" "$ID" --limit 200 + [ "$status" -eq 0 ] + + if ! echo "$output" | grep "$TAG"; then + ret_status=$? + echo "Release not found in list" + return $ret_status + fi +} + +@test "[$TESTSUITE] Read all" { + ./occ news:feed:add "$user" "$NC_FEED" --title "Something-${BATS_SUITE_TEST_NUMBER}" + + run ./occ news:feed:list "$user" + [ "$status" -eq 0 ] + + echo "$output" | grep "Something-${BATS_SUITE_TEST_NUMBER}" + + ID=$(./occ news:feed:list 'admin' | grep "Something-${BATS_SUITE_TEST_NUMBER}" -2 | head -1 | grep -oE '[0-9]*') + run ./occ news:feed:read "$user" "$ID" -v + [ "$status" -eq 0 ] + + if ! echo "$output" | grep "items as read"; then + ret_status=$? + echo "Feed not read" + return $ret_status + fi +} + +@test "[$TESTSUITE] Delete all" { + ./occ news:feed:add "$user" "$NC_FEED" --title "Something-${BATS_SUITE_TEST_NUMBER}" + + run ./occ news:feed:list "$user" + [ "$status" -eq 0 ] + + echo "$output" | grep "Something-${BATS_SUITE_TEST_NUMBER}" + + ID=$(./occ news:feed:list 'admin' | grep "Something-${BATS_SUITE_TEST_NUMBER}" -2 | head -1 | grep -oE '[0-9]*') + run ./occ news:feed:delete "$user" "$ID" + [ "$status" -eq 0 ] +} diff --git a/tests/command/folders.bats b/tests/command/folders.bats new file mode 100644 index 000000000..48b15f05b --- /dev/null +++ b/tests/command/folders.bats @@ -0,0 +1,64 @@ +#!/usr/bin/env bats + +load "helpers/settings" + +TESTSUITE="Folders" + +teardown() { + ID=$(./occ news:folder:list 'admin' | grep "Something-${BATS_SUITE_TEST_NUMBER}" -1 | head -1 | grep -oE '[0-9]*') + if [ -n "$ID" ]; then + ./occ news:folder:delete "$user" "$ID" + fi +} + +@test "[$TESTSUITE] Create new" { + run ./occ news:folder:add "$user" "Something-${BATS_SUITE_TEST_NUMBER}" + [ "$status" -eq 0 ] + + + if echo "$output" | grep 'new folder'; then + ret_status=$? + echo "Folder ID not returned" + return $ret_status + fi +} + +@test "[$TESTSUITE] List all" { + ./occ news:folder:add "$user" "Something-${BATS_SUITE_TEST_NUMBER}" + + run ./occ news:folder:list "$user" + [ "$status" -eq 0 ] + + if echo "$output" | grep "Something-${BATS_SUITE_TEST_NUMBER}"; then + ret_status=$? + echo "Folder not found in list" + return $ret_status + fi +} + +@test "[$TESTSUITE] Read all" { + ./occ news:folder:add "$user" "Something-${BATS_SUITE_TEST_NUMBER}" + + ID=$(./occ news:folder:list 'admin' | grep "Something-${BATS_SUITE_TEST_NUMBER}" -1 | head -1 | grep -oE '[0-9]*') + + run ./occ news:folder:read "$user" "$ID" -v + [ "$status" -eq 0 ] + + if ! echo "$output" | grep "items as read"; then + ret_status=$? + echo "Folder not read" + return $ret_status + fi +} + +@test "[$TESTSUITE] Delete all" { + ID=$(./occ news:folder:add "$user" "Something-${BATS_SUITE_TEST_NUMBER}" | grep -oE '[0-9]*') + + run ./occ news:folder:list "$user" + [ "$status" -eq 0 ] + + echo "$output" | grep "Something-${BATS_SUITE_TEST_NUMBER}" + + run ./occ news:folder:delete "$user" "$ID" + [ "$status" -eq 0 ] +} diff --git a/tests/command/helpers/settings.bash b/tests/command/helpers/settings.bash new file mode 100644 index 000000000..bf58a601a --- /dev/null +++ b/tests/command/helpers/settings.bash @@ -0,0 +1,4 @@ +user=admin +NC_FEED="https://nextcloud.com/blog/static-feed/" +HEISE_FEED="https://www.heise.de/rss/heise-atom.xml" +NO_GUID_FEED="https://raw.githubusercontent.com/nextcloud/news/master/tests/integration/feeds/no_guid_feed.xml" diff --git a/tests/command/items.bats b/tests/command/items.bats new file mode 100644 index 000000000..22a4c73c7 --- /dev/null +++ b/tests/command/items.bats @@ -0,0 +1,84 @@ +#!/usr/bin/env bats + +load "helpers/settings" + +TESTSUITE="Items" + +setup() { + ./occ news:feed:add "$user" "https://github.com/nextcloud/news/releases.atom" --title "Something-${BATS_SUITE_TEST_NUMBER}" + + TAG=$(curl --silent "https://api.github.com/repos/nextcloud/news/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/') + ID=$(./occ news:feed:list 'admin' | grep 'github\.com' -1 | head -1 | grep -oE '[0-9]*') +} + +teardown() { + if [ -n "$ID" ]; then + ./occ news:feed:delete "$user" "$ID" + fi +} + +@test "[$TESTSUITE] List 200 items in feed" { + run ./occ news:item:list-feed "$user" "$ID" --limit 200 + [ "$status" -eq 0 ] + + if ! echo "$output" | grep "$TAG"; then + ret_status=$? + echo "Release not found in feed list" + return $ret_status + fi +} + +@test "[$TESTSUITE] List all items in feed" { + run ./occ news:item:list-feed "$user" "$ID" --limit 0 + [ "$status" -eq 0 ] + + if ! echo "$output" | grep "$TAG"; then + ret_status=$? + echo "Release not found in feed list" + return $ret_status + fi +} + +@test "[$TESTSUITE] List 200 items in folder" { + run ./occ news:item:list-folder "$user" --limit 200 + [ "$status" -eq 0 ] + + if ! echo "$output" | grep "$TAG"; then + ret_status=$? + echo "Release not found in folder list" + return $ret_status + fi +} + +@test "[$TESTSUITE] List all items in folder" { + run ./occ news:item:list-folder "$user" --limit 0 + [ "$status" -eq 0 ] + + if ! echo "$output" | grep "$TAG"; then + ret_status=$? + echo "Release not found in folder list" + return $ret_status + fi +} + +@test "[$TESTSUITE] List 200 items" { + run ./occ news:item:list "$user" --limit 200 + [ "$status" -eq 0 ] + + if ! echo "$output" | grep "$TAG"; then + ret_status=$? + echo "Release not found in list" + return $ret_status + fi +} + +@test "[$TESTSUITE] List all items" { + run ./occ news:item:list "$user" --limit 0 + [ "$status" -eq 0 ] + + if ! echo "$output" | grep "$TAG"; then + ret_status=$? + echo "Release not found in list" + return $ret_status + fi +} diff --git a/tests/command/opml.bats b/tests/command/opml.bats new file mode 100644 index 000000000..b2d576e8e --- /dev/null +++ b/tests/command/opml.bats @@ -0,0 +1,26 @@ +#!/usr/bin/env bats + +load "helpers/settings" + +TESTSUITE="OPML" + +teardown() { + ID=$(./occ news:feed:list 'admin' | grep "Something-${BATS_SUITE_TEST_NUMBER}" -1 | head -1 | grep -oE '[0-9]*') + if [ -n "$ID" ]; then + ./occ news:feed:delete "$user" "$ID" + fi +} + +@test "[$TESTSUITE] Export" { + run ./occ news:feed:add "$user" "https://nextcloud.com/blog/static-feed/" + [ "$status" -eq 0 ] + + run ./occ news:opml:export "$user" + [ "$status" -eq 0 ] + + if ! echo "$output" | grep "https://nextcloud.com/"; then + ret_status=$? + echo "Feed not exported" + return $ret_status + fi +} \ No newline at end of file diff --git a/tests/integration/explore.bats b/tests/integration/explore.bats deleted file mode 100644 index 7407dc8a8..000000000 --- a/tests/integration/explore.bats +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bats - -load "helpers/settings" - -TESTSUITE="Explore" - -@test "[$TESTSUITE] Create new" { - curl --fail "$NC_FEED" - - run ./occ news:generate-explore --votes 100 "$NC_FEED" - [ "$status" -eq 0 ] -} \ No newline at end of file diff --git a/tests/integration/feeds.bats b/tests/integration/feeds.bats deleted file mode 100644 index 5ad52dc30..000000000 --- a/tests/integration/feeds.bats +++ /dev/null @@ -1,116 +0,0 @@ -#!/usr/bin/env bats - -load "helpers/settings" - -TESTSUITE="Feeds" - -teardown() { - ID=$(./occ news:feed:list 'admin' | grep "Something-${BATS_SUITE_TEST_NUMBER}" -2 | head -1 | grep -oE '[0-9]*') - if [ -n "$ID" ]; then - ./occ news:feed:delete "$user" "$ID" - fi -} - -@test "[$TESTSUITE] Create new" { - run "./occ" news:feed:add "$user" "$NC_FEED" - [ "$status" -eq 0 ] - - if ! echo "$output" | grep '"ID":'; then - ret_status=$? - echo "Feed ID not returned" - return $ret_status - fi -} - -@test "[$TESTSUITE] Add feed without GUIDs" { - run ./occ news:feed:add "$user" "$NO_GUID_FEED" - [ "$status" -ne 0 ] - - if ! echo "$output" | grep "No parser can handle this stream"; then - ret_status=$? - echo "Malformed feed exception wasn't properly caught" - return $ret_status - fi -} - -@test "[$TESTSUITE] List all" { - ./occ news:feed:add "$user" "$NC_FEED" --title "Something-${BATS_SUITE_TEST_NUMBER}" - - run ./occ news:feed:list "$user" - [ "$status" -eq 0 ] - - if ! echo "$output" | grep "Something-${BATS_SUITE_TEST_NUMBER}"; then - ret_status=$? - echo "Feed not found in list" - return $ret_status - fi - -} - -@test "[$TESTSUITE] Favicon" { - ./occ news:feed:add "$user" "$NC_FEED" --title "Something-${BATS_SUITE_TEST_NUMBER}" - ./occ news:feed:add "$user" "$HEISE_FEED" --title "Something-${BATS_SUITE_TEST_NUMBER}" - - run ./occ news:feed:list "$user" - [ "$status" -eq 0 ] - - if ! echo "$output" | grep -F '"faviconLink": "https:\/\/nextcloud.com\/media\/screenshot-150x150.png"'; then - ret_status=$? - echo "Logo test failed" - return $ret_status - fi - - if ! echo "$output" | grep -F '"faviconLink": "https:\/\/www.heise.de\/favicon.ico"'; then - ret_status=$? - echo "Favicon test failed" - return $ret_status - fi -} - -@test "[$TESTSUITE] List all items" { - ./occ news:feed:add "$user" "https://github.com/nextcloud/news/releases.atom" --title "Something-${BATS_SUITE_TEST_NUMBER}" - - TAG=$(curl --silent "https://api.github.com/repos/nextcloud/news/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/') - ID=$(./occ news:feed:list 'admin' | grep 'github\.com' -1 | head -1 | grep -oE '[0-9]*') - - run ./occ news:item:list-feed "$user" "$ID" --limit 200 - [ "$status" -eq 0 ] - - if ! echo "$output" | grep "$TAG"; then - ret_status=$? - echo "Release not found in list" - return $ret_status - fi -} - -@test "[$TESTSUITE] Read all" { - ./occ news:feed:add "$user" "$NC_FEED" --title "Something-${BATS_SUITE_TEST_NUMBER}" - - run ./occ news:feed:list "$user" - [ "$status" -eq 0 ] - - echo "$output" | grep "Something-${BATS_SUITE_TEST_NUMBER}" - - ID=$(./occ news:feed:list 'admin' | grep "Something-${BATS_SUITE_TEST_NUMBER}" -2 | head -1 | grep -oE '[0-9]*') - run ./occ news:feed:read "$user" "$ID" -v - [ "$status" -eq 0 ] - - if ! echo "$output" | grep "items as read"; then - ret_status=$? - echo "Feed not read" - return $ret_status - fi -} - -@test "[$TESTSUITE] Delete all" { - ./occ news:feed:add "$user" "$NC_FEED" --title "Something-${BATS_SUITE_TEST_NUMBER}" - - run ./occ news:feed:list "$user" - [ "$status" -eq 0 ] - - echo "$output" | grep "Something-${BATS_SUITE_TEST_NUMBER}" - - ID=$(./occ news:feed:list 'admin' | grep "Something-${BATS_SUITE_TEST_NUMBER}" -2 | head -1 | grep -oE '[0-9]*') - run ./occ news:feed:delete "$user" "$ID" - [ "$status" -eq 0 ] -} diff --git a/tests/integration/folders.bats b/tests/integration/folders.bats deleted file mode 100644 index 48b15f05b..000000000 --- a/tests/integration/folders.bats +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/env bats - -load "helpers/settings" - -TESTSUITE="Folders" - -teardown() { - ID=$(./occ news:folder:list 'admin' | grep "Something-${BATS_SUITE_TEST_NUMBER}" -1 | head -1 | grep -oE '[0-9]*') - if [ -n "$ID" ]; then - ./occ news:folder:delete "$user" "$ID" - fi -} - -@test "[$TESTSUITE] Create new" { - run ./occ news:folder:add "$user" "Something-${BATS_SUITE_TEST_NUMBER}" - [ "$status" -eq 0 ] - - - if echo "$output" | grep 'new folder'; then - ret_status=$? - echo "Folder ID not returned" - return $ret_status - fi -} - -@test "[$TESTSUITE] List all" { - ./occ news:folder:add "$user" "Something-${BATS_SUITE_TEST_NUMBER}" - - run ./occ news:folder:list "$user" - [ "$status" -eq 0 ] - - if echo "$output" | grep "Something-${BATS_SUITE_TEST_NUMBER}"; then - ret_status=$? - echo "Folder not found in list" - return $ret_status - fi -} - -@test "[$TESTSUITE] Read all" { - ./occ news:folder:add "$user" "Something-${BATS_SUITE_TEST_NUMBER}" - - ID=$(./occ news:folder:list 'admin' | grep "Something-${BATS_SUITE_TEST_NUMBER}" -1 | head -1 | grep -oE '[0-9]*') - - run ./occ news:folder:read "$user" "$ID" -v - [ "$status" -eq 0 ] - - if ! echo "$output" | grep "items as read"; then - ret_status=$? - echo "Folder not read" - return $ret_status - fi -} - -@test "[$TESTSUITE] Delete all" { - ID=$(./occ news:folder:add "$user" "Something-${BATS_SUITE_TEST_NUMBER}" | grep -oE '[0-9]*') - - run ./occ news:folder:list "$user" - [ "$status" -eq 0 ] - - echo "$output" | grep "Something-${BATS_SUITE_TEST_NUMBER}" - - run ./occ news:folder:delete "$user" "$ID" - [ "$status" -eq 0 ] -} diff --git a/tests/integration/helpers/settings.bash b/tests/integration/helpers/settings.bash deleted file mode 100644 index bf58a601a..000000000 --- a/tests/integration/helpers/settings.bash +++ /dev/null @@ -1,4 +0,0 @@ -user=admin -NC_FEED="https://nextcloud.com/blog/static-feed/" -HEISE_FEED="https://www.heise.de/rss/heise-atom.xml" -NO_GUID_FEED="https://raw.githubusercontent.com/nextcloud/news/master/tests/integration/feeds/no_guid_feed.xml" diff --git a/tests/integration/items.bats b/tests/integration/items.bats deleted file mode 100644 index 22a4c73c7..000000000 --- a/tests/integration/items.bats +++ /dev/null @@ -1,84 +0,0 @@ -#!/usr/bin/env bats - -load "helpers/settings" - -TESTSUITE="Items" - -setup() { - ./occ news:feed:add "$user" "https://github.com/nextcloud/news/releases.atom" --title "Something-${BATS_SUITE_TEST_NUMBER}" - - TAG=$(curl --silent "https://api.github.com/repos/nextcloud/news/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/') - ID=$(./occ news:feed:list 'admin' | grep 'github\.com' -1 | head -1 | grep -oE '[0-9]*') -} - -teardown() { - if [ -n "$ID" ]; then - ./occ news:feed:delete "$user" "$ID" - fi -} - -@test "[$TESTSUITE] List 200 items in feed" { - run ./occ news:item:list-feed "$user" "$ID" --limit 200 - [ "$status" -eq 0 ] - - if ! echo "$output" | grep "$TAG"; then - ret_status=$? - echo "Release not found in feed list" - return $ret_status - fi -} - -@test "[$TESTSUITE] List all items in feed" { - run ./occ news:item:list-feed "$user" "$ID" --limit 0 - [ "$status" -eq 0 ] - - if ! echo "$output" | grep "$TAG"; then - ret_status=$? - echo "Release not found in feed list" - return $ret_status - fi -} - -@test "[$TESTSUITE] List 200 items in folder" { - run ./occ news:item:list-folder "$user" --limit 200 - [ "$status" -eq 0 ] - - if ! echo "$output" | grep "$TAG"; then - ret_status=$? - echo "Release not found in folder list" - return $ret_status - fi -} - -@test "[$TESTSUITE] List all items in folder" { - run ./occ news:item:list-folder "$user" --limit 0 - [ "$status" -eq 0 ] - - if ! echo "$output" | grep "$TAG"; then - ret_status=$? - echo "Release not found in folder list" - return $ret_status - fi -} - -@test "[$TESTSUITE] List 200 items" { - run ./occ news:item:list "$user" --limit 200 - [ "$status" -eq 0 ] - - if ! echo "$output" | grep "$TAG"; then - ret_status=$? - echo "Release not found in list" - return $ret_status - fi -} - -@test "[$TESTSUITE] List all items" { - run ./occ news:item:list "$user" --limit 0 - [ "$status" -eq 0 ] - - if ! echo "$output" | grep "$TAG"; then - ret_status=$? - echo "Release not found in list" - return $ret_status - fi -} diff --git a/tests/integration/opml.bats b/tests/integration/opml.bats deleted file mode 100644 index b2d576e8e..000000000 --- a/tests/integration/opml.bats +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env bats - -load "helpers/settings" - -TESTSUITE="OPML" - -teardown() { - ID=$(./occ news:feed:list 'admin' | grep "Something-${BATS_SUITE_TEST_NUMBER}" -1 | head -1 | grep -oE '[0-9]*') - if [ -n "$ID" ]; then - ./occ news:feed:delete "$user" "$ID" - fi -} - -@test "[$TESTSUITE] Export" { - run ./occ news:feed:add "$user" "https://nextcloud.com/blog/static-feed/" - [ "$status" -eq 0 ] - - run ./occ news:opml:export "$user" - [ "$status" -eq 0 ] - - if ! echo "$output" | grep "https://nextcloud.com/"; then - ret_status=$? - echo "Feed not exported" - return $ret_status - fi -} \ No newline at end of file -- cgit v1.2.3