Skip to content

Commit

Permalink
Merge pull request #41139 from nextcloud/techdebt/noid/move-integrati…
Browse files Browse the repository at this point in the history
…on-testing-to-actions

Move integration tests to github actions
  • Loading branch information
nickvergessen authored Jan 26, 2024
2 parents 08ec513 + da46be4 commit 8d114c9
Show file tree
Hide file tree
Showing 28 changed files with 541 additions and 1,370 deletions.
996 changes: 1 addition & 995 deletions .drone.yml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
paths:
- '.github/workflows/**'
- '3rdparty/**'
- 'build/integration/**'
- '**/*.php'
- '**/lib/**'
- '**/tests/**'
Expand All @@ -13,12 +14,12 @@ on:
- 'composer.lock'

concurrency:
group: s3-external-integration-${{ github.head_ref || github.run_id }}
group: integration-s3-primary-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
s3-primary-integration-tests-minio:
runs-on: ubuntu-20.04
integration-s3-primary:
runs-on: ubuntu-latest

if: ${{ github.repository_owner != 'nextcloud-gmbh' }}

Expand All @@ -33,14 +34,16 @@ jobs:

services:
redis:
image: redis
image: ghcr.io/nextcloud/continuous-integration-redis:latest
options: --health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=3
ports:
- "6379:6379"
- 6379:6379/tcp
minio:
image: bitnami/minio
env:
MINIO_ACCESS_KEY: minio
MINIO_SECRET_KEY: minio123
image: bitnami/minio:2021.12.29
MINIO_ROOT_USER: nextcloud
MINIO_ROOT_PASSWORD: bWluaW8tc2VjcmV0LWtleS1uZXh0Y2xvdWQ=
MINIO_DEFAULT_BUCKETS: nextcloud
ports:
- "9000:9000"

Expand All @@ -51,10 +54,13 @@ jobs:
submodules: true

- name: Set up php ${{ matrix.php-versions }}
uses: shivammathur/setup-php@c5fc0d8281aba02c7fda07d3a70cc5371548067d #v2.25.2
uses: shivammathur/setup-php@4bd44f22a98a19e0950cbad5f31095157cc9621b # v2
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, fileinfo, intl, sqlite, pdo_sqlite, zip, gd, redis
# https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, redis, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite
coverage: 'none'
ini-file: development
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand All @@ -66,15 +72,15 @@ jobs:
- name: Set up Nextcloud
run: |
mkdir data
echo '<?php $CONFIG=["${{ matrix.key }}" => ["class" => "OC\Files\ObjectStore\S3", "arguments" => ["bucket" => "nextcloud", "autocreate" => true, "key" => "minio", "secret" => "minio123", "hostname" => "localhost", "port" => 9000, "use_ssl" => false, "use_path_style" => true, "uploadPartSize" => 52428800]]];' > config/config.php
echo '<?php $CONFIG=["${{ matrix.key }}" => ["class" => "OC\Files\ObjectStore\S3", "arguments" => ["bucket" => "nextcloud", "autocreate" => true, "key" => "nextcloud", "secret" => "bWluaW8tc2VjcmV0LWtleS1uZXh0Y2xvdWQ=", "hostname" => "localhost", "port" => 9000, "use_ssl" => false, "use_path_style" => true, "uploadPartSize" => 52428800]]];' > config/config.php
echo '<?php $CONFIG=["redis" => ["host" => "localhost", "port" => 6379], "memcache.local" => "\OC\Memcache\Redis", "memcache.distributed" => "\OC\Memcache\Redis"];' > config/redis.config.php
./occ maintenance:install --verbose --database=sqlite --database-name=nextcloud --database-host=127.0.0.1 --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass admin
php -f index.php
- name: Integration
run: |
cd build/integration
bash run.sh --tags "~@failure-s3" features/webdav-related.feature
bash run.sh --tags "~@failure-s3" dav_features/webdav-related.feature
- name: S3 logs
if: always()
Expand All @@ -86,10 +92,10 @@ jobs:
s3-primary-integration-summary:
runs-on: ubuntu-latest
needs: [s3-primary-integration-tests-minio]
needs: [integration-s3-primary]

if: always()

steps:
- name: Summary status
run: if ${{ needs.s3-primary-integration-tests-minio.result != 'success' }}; then exit 1; fi
run: if ${{ needs.integration-s3-primary.result != 'success' }}; then exit 1; fi
167 changes: 167 additions & 0 deletions .github/workflows/integration-sqlite.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
name: Integration sqlite

on:
pull_request:
push:
branches:
- main
- master
- stable*

permissions:
contents: read

concurrency:
group: integration-sqlite-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
changes:
runs-on: ubuntu-latest

outputs:
# FIXME src: ${{ steps.changes.outputs.src}}
src: 'true'

steps:
- uses: dorny/paths-filter@4512585405083f25c027a35db413c2b3b9006d50 # v2.11.1
id: changes
continue-on-error: true
with:
filters: |
src:
- '.github/workflows/**'
- '3rdparty/**'
- '**/*.php'
- '**/lib/**'
- '**/tests/**'
- '**/vendor-bin/**'
- 'build/integration/**'
- '.php-cs-fixer.dist.php'
- 'composer.json'
- 'composer.lock'
integration-sqlite:
runs-on: ubuntu-latest

needs: changes
if: needs.changes.outputs.src != 'false'

strategy:
fail-fast: false
matrix:
test-suite:
- 'capabilities_features'
- 'collaboration_features'
- 'comments_features'
- 'dav_features'
- 'features'
- 'federation_features'
- '--tags ~@large files_features'
- 'filesdrop_features'
- 'openldap_features'
- 'openldap_numerical_features'
- 'ldap_features'
- 'remoteapi_features'
- 'setup_features'
- 'sharees_features'
- 'sharing_features'
- 'videoverification_features'

php-versions: ['8.2']
spreed-versions: ['main']

services:
redis:
image: ghcr.io/nextcloud/continuous-integration-redis:latest
options: --health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=3
ports:
- 6379:6379/tcp
openldap:
image: ghcr.io/nextcloud/continuous-integration-openldap:openldap-7
ports:
- 389:389
env:
SLAPD_DOMAIN: nextcloud.ci
SLAPD_ORGANIZATION: Nextcloud
SLAPD_PASSWORD: admin
SLAPD_ADDITIONAL_MODULES: memberof

steps:
- name: Checkout server
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
with:
submodules: true

- name: Checkout Talk app
if: ${{ matrix.test-suite == 'videoverification_features' }}
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
with:
repository: nextcloud/spreed
path: apps/spreed
ref: ${{ matrix.spreed-versions }}

- name: Set up php ${{ matrix.php-versions }}
uses: shivammathur/setup-php@c5fc0d8281aba02c7fda07d3a70cc5371548067d # v2
with:
php-version: ${{ matrix.php-versions }}
# https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, imagick, intl, json, ldap, libxml, mbstring, openssl, pcntl, posix, redis, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite
coverage: none
ini-file: development
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Set up production dependencies
run: composer i --no-dev

- name: Set up behat dependencies
working-directory: build/integration
run: composer i

- name: Set up Talk dependencies
if: ${{ matrix.test-suite == 'videoverification_features' }}
working-directory: apps/spreed
run: composer i --no-dev

- name: Set up Nextcloud
run: |
mkdir data
./occ maintenance:install --verbose ${{ contains(matrix.test-suite,'ldap') && '--data-dir=/dev/shm/nc_int' || '' }} --database=sqlite --database-name=nextcloud --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass admin
./occ config:system:set hashing_default_password --value=true --type=boolean
- name: Configure caching
if: ${{ contains(matrix.test-suite,'ldap') }}
run: |
./occ config:system:set redis host --value=localhost
./occ config:system:set redis port --value=6379 --type=integer
./occ config:system:set redis timeout --value=0 --type=integer
./occ config:system:set memcache.local --value='\OC\Memcache\Redis'
./occ config:system:set memcache.distributed --value='\OC\Memcache\Redis'
- name: Run integration
working-directory: build/integration
env:
LDAP_HOST: localhost
run: bash run.sh ${{ matrix.test-suite }} no-tail-log

- name: Print logs
if: always()
run: |
cat data/nextcloud.log
docker ps -a
docker ps -aq | while read container ; do IMAGE=$(docker inspect --format='{{.Config.Image}}' $container); echo $IMAGE; docker logs $container; echo "\n\n" ; done
summary:
permissions:
contents: none
runs-on: ubuntu-latest
needs: [changes, integration-sqlite]

if: always()

name: integration-sqlite-summary

steps:
- name: Summary status
run: if ${{ needs.changes.outputs.src != 'false' && needs.integration-sqlite.result != 'success' }}; then exit 1; fi
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ nbproject
/build/bin
/build/lib/
/build/jsdocs/
/build/integration/output/
/build/integration/phpserver.log
/npm-debug.log
/PhantomJS_*

Expand Down
File renamed without changes.
23 changes: 14 additions & 9 deletions build/integration/composer.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
{
"require-dev": {
"phpunit/phpunit": "^9",
"dms/phpunit-arraysubset-asserts": "^0.5",
"behat/behat": "~3.13.0",
"guzzlehttp/guzzle": "7.8.1",
"jarnaiz/behat-junit-formatter": "^1.3",
"sabre/dav": "4.6.0",
"symfony/event-dispatcher": "~5.3"
}
"config": {
"platform": {
"php": "8.0.2"
},
"sort-packages": true
},
"require-dev": {
"behat/behat": "^3.14",
"dms/phpunit-arraysubset-asserts": "^0.5",
"guzzlehttp/guzzle": "^7.8",
"phpunit/phpunit": "^9.6",
"sabre/dav": "^4.6",
"symfony/event-dispatcher": "^5.4"
}
}
Loading

0 comments on commit 8d114c9

Please sign in to comment.