Skip to content

Commit

Permalink
Some basic API tests
Browse files Browse the repository at this point in the history
Signed-off-by: Jonas Rittershofer <[email protected]>
  • Loading branch information
jotoeri committed May 23, 2022
1 parent e65bafc commit 75ddf5c
Show file tree
Hide file tree
Showing 4 changed files with 1,840 additions and 7 deletions.
27 changes: 23 additions & 4 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,11 @@ jobs:
- name: Set up Nextcloud
env:
DB_PORT: 4444
OC_PASS: test
run: |
mkdir data
./occ maintenance:install --verbose --database=${{ matrix.databases }} --database-name=nextcloud --database-host=127.0.0.1 --database-port=$DB_PORT --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass password
./occ user:add --password-from-env --display-name="Test Displayname" test
./occ app:enable --force ${{ env.APP_NAME }}
php -S localhost:8080 &
Expand All @@ -68,14 +70,23 @@ jobs:
working-directory: apps/${{ env.APP_NAME }}
run: composer test:integration

- name: Upload coverage
- name: Upload Unit coverage
if: matrix.php-versions == matrix.coverage-on
uses: codecov/codecov-action@v1
with:
root_dir: apps/${{ env.APP_NAME }}
files: apps/${{ env.APP_NAME }}/tests/clover.unit.xml
fail_ci_if_error: true
flags: unittests
flags: unit

- name: Upload Integration coverage
if: matrix.php-versions == matrix.coverage-on
uses: codecov/codecov-action@v1
with:
root_dir: apps/${{ env.APP_NAME }}
files: apps/${{ env.APP_NAME }}/tests/clover.integration.xml
fail_ci_if_error: true
flags: integration

mysql:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -127,9 +138,11 @@ jobs:
- name: Set up Nextcloud
env:
DB_PORT: 4444
OC_PASS: test
run: |
mkdir data
./occ maintenance:install --verbose --database=${{ matrix.databases }} --database-name=nextcloud --database-host=127.0.0.1 --database-port=$DB_PORT --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass password
./occ user:add --password-from-env --display-name="Test Displayname" test
./occ app:enable --force ${{ env.APP_NAME }}
php -S localhost:8080 &
Expand Down Expand Up @@ -193,9 +206,11 @@ jobs:
- name: Set up Nextcloud
env:
DB_PORT: 4444
OC_PASS: test
run: |
mkdir data
./occ maintenance:install --verbose --database=${{ matrix.databases }} --database-name=nextcloud --database-host=127.0.0.1 --database-port=$DB_PORT --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass password
./occ user:add --password-from-env --display-name="Test Displayname" test
./occ app:enable --force ${{ env.APP_NAME }}
php -S localhost:8080 &
Expand Down Expand Up @@ -224,7 +239,7 @@ jobs:
oracle:
image: deepdiver/docker-oracle-xe-11g # "wnameless/oracle-xe-11g-r2"
ports:
- "1521:1521"
- 4444:1521/tcp

steps:
- name: Checkout server
Expand Down Expand Up @@ -252,10 +267,14 @@ jobs:
run: composer i

- name: Set up Nextcloud
env:
DB_PORT: 4444
OC_PASS: test
run: |
mkdir data
./occ maintenance:install --verbose --database=oci --database-name=XE --database-host=127.0.0.1 --database-port=1521 --database-user=autotest --database-pass=owncloud --admin-user admin --admin-pass admin
./occ maintenance:install --verbose --database=oci --database-name=XE --database-host=127.0.0.1 --database-port=$DB_PORT --database-user=autotest --database-pass=owncloud --admin-user admin --admin-pass admin
php -f index.php
./occ user:add --password-from-env --display-name="Test Displayname" test
./occ app:enable --force ${{ env.APP_NAME }}
- name: PHPUnit
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"require-dev": {
"bamarni/composer-bin-plugin": "^1.5",
"christophwurst/nextcloud": "^23.0",
"phpunit/phpunit": "^9"
"phpunit/phpunit": "^9",
"guzzlehttp/guzzle": "^7.4"
},
"require": {
"league/csv": "^9.7.3"
Expand Down
Loading

0 comments on commit 75ddf5c

Please sign in to comment.