summaryrefslogtreecommitdiffstats
path: root/.github/workflows/api-integration-tests.yml
diff options
context:
space:
mode:
authorBenjamin Brahmer <info@b-brahmer.de>2022-05-29 11:25:38 +0200
committerGitHub <noreply@github.com>2022-05-29 11:25:38 +0200
commiteca96ad37d89b442ae4e0463ec8f7a5bee3007f1 (patch)
tree81b9e611ea846b9931016cea3bc9dcaa1c85e4a1 /.github/workflows/api-integration-tests.yml
parent86e01a91f3b3fa1220adb899fa56b8bd53720d34 (diff)
Enable API testing (#1699)
Enable API testing with local php server. This adds many tests for API v1.2, more still possible. Which increased the quality of news already. Signed-off-by: Benjamin Brahmer <info@b-brahmer.de>
Diffstat (limited to '.github/workflows/api-integration-tests.yml')
-rw-r--r--.github/workflows/api-integration-tests.yml24
1 files changed, 19 insertions, 5 deletions
diff --git a/.github/workflows/api-integration-tests.yml b/.github/workflows/api-integration-tests.yml
index c9a1d4cc9..117e7af49 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
@@ -48,6 +48,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
+ with:
+ submodules: recursive
- name: Setup PHP
uses: shivammathur/setup-php@v2
@@ -56,8 +58,8 @@ jobs:
extensions: pdo_sqlite,pdo_mysql,pdo_pgsql,gd,zip
coverage: none
- - name: Setup BATS
- uses: mig4/setup-bats@v1.2.0
+ - name: Setup BATS & httpie
+ run: sudo apt-get install -y bats httpie
### MySQL specific setup
- name: Setup mysql
@@ -108,6 +110,17 @@ jobs:
check-code: false
force: ${{ matrix.experimental }}
+ - name: Run API tests
+ working-directory: ../server
+ run: |
+ php -S localhost:8080 &> /tmp/webserver.log &
+ sleep 2
+
+ bats apps/news/tests/api
+
+ # 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
+