Skip to content

Commit

Permalink
add integration test to ensure credentials are not logged in plain text
Browse files Browse the repository at this point in the history
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
  • Loading branch information
blizzz committed Jul 29, 2022
1 parent 0233484 commit a99907b
Show file tree
Hide file tree
Showing 8 changed files with 2,154 additions and 1 deletion.
78 changes: 78 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Integration

on:
pull_request:
paths:
- '.github/workflows/integration.yml'
- 'appinfo/**'
- 'lib/**'
- 'tests/**'

push:
branches:
- master
- stable*

env:
APP_NAME: sharepoint

jobs:
sqlite:
runs-on: ubuntu-latest

strategy:
# do not stop on another job's failure
fail-fast: false
matrix:
php-versions: ['7.4', '8.0', '8.1']
databases: ['sqlite']
server-versions: ['master']

name: integration-php${{ matrix.php-versions }}-${{ matrix.databases }}

steps:
- name: Checkout server
uses: actions/checkout@v2
with:
repository: nextcloud/server
ref: ${{ matrix.server-versions }}

- name: Checkout submodules
shell: bash
run: |
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
git submodule sync --recursive
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
- name: Checkout app
uses: actions/checkout@v2
with:
path: apps/${{ env.APP_NAME }}

- name: Set up php ${{ matrix.php-versions }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, iconv, fileinfo, intl, sqlite, pdo_sqlite
coverage: none

- name: Install app dependencies
working-directory: apps/${{ env.APP_NAME }}
run: composer i

- name: Install test dependencies
working-directory: apps/${{ env.APP_NAME }}/tests/Integration
run: composer i

- name: Set up Nextcloud
env:
DB_PORT: 4444
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 admin
php -f index.php
./occ app:enable files_external
./occ app:enable --force ${{ env.APP_NAME }}
php -S localhost:8080 &
- name: Integration
working-directory: apps/${{ env.APP_NAME }}/tests/Integration
run: bash run.sh
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
composer.phar
/vendor/
vendor/
11 changes: 11 additions & 0 deletions tests/Integration/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"config": {
"platform": {
"php": "7.4"
}
},
"require-dev": {
"behat/behat": "^3.11",
"jarnaiz/behat-junit-formatter": "^1.3"
}
}
Loading

0 comments on commit a99907b

Please sign in to comment.