implement acceptance tests in docker for dev machine

This commit is contained in:
Willy Kloucek
2020-11-25 14:29:02 +01:00
committed by Phil Davis
parent f9f90568b4
commit 1c409c64a1
13 changed files with 567 additions and 37 deletions
@@ -0,0 +1,27 @@
services:
acceptance-tests:
image: owncloudci/php:7.4
command: /bin/bash /test/run-tests.sh
environment:
OCIS_ROOT: /drone/src
PATH_TO_CORE: /srv/app/testrunner
SKELETON_DIR: /srv/app/tmp/testing/data/apiSkeleton
TEST_OCIS: "true"
TEST_SERVER_URL: https://ocis-server:9200
TESTING_DIR: /srv/app/tmp/testing
CORE_BRANCH: $CORE_BRANCH
CORE_COMMIT: $CORE_COMMIT
STORAGE: $STORAGE
TEST_SOURCE: $TEST_SOURCE
BEHAT_SUITE: ${BEHAT_SUITE:-}
BEHAT_FEATURE: ${BEHAT_FEATURE:-}
DIVIDE_INTO_NUM_PARTS: $DIVIDE_INTO_NUM_PARTS
RUN_PART: $RUN_PART
volumes:
- ./run-tests.sh:/test/run-tests.sh
- oCISownCloud10testsuite:/srv
- ../../../../:/drone/src
volumes:
oCISownCloud10testsuite:
+30
View File
@@ -0,0 +1,30 @@
services:
ocis-server:
environment:
STORAGE_HOME_DRIVER: $STORAGE
STORAGE_USERS_DRIVER: $STORAGE
STORAGE_DRIVER_OCIS_ROOT: /srv/app/tmp/ocis/storage/users
STORAGE_DRIVER_LOCAL_ROOT: /srv/app/tmp/ocis/local/root
STORAGE_METADATA_ROOT: /srv/app/tmp/ocis/metadata
STORAGE_DRIVER_OWNCLOUD_DATADIR: /srv/app/tmp/ocis/owncloud/data
STORAGE_DRIVER_OWNCLOUD_REDIS_ADDR: redis:6379
STORAGE_LDAP_IDP: https://ocis-server:9200
STORAGE_OIDC_ISSUER: https://ocis-server:9200
PROXY_OIDC_ISSUER: https://ocis-server:9200
STORAGE_HOME_DATA_SERVER_URL: http://ocis-server:9155/data
STORAGE_DATAGATEWAY_PUBLIC_URL: https://ocis-server:9200/data
STORAGE_USERS_DATA_SERVER_URL: http://ocis-server:9158/data
STORAGE_FRONTEND_PUBLIC_URL: https://ocis-server:9200
STORAGE_SHARING_USER_JSON_FILE: /srv/app/tmp/ocis/shares.json
PROXY_ENABLE_BASIC_AUTH: "true"
PHOENIX_WEB_CONFIG: /drone/src/ocis/tests/config/drone/ocis-config.json
KONNECTD_IDENTIFIER_REGISTRATION_CONF: /drone/src/ocis/tests/config/drone/identifier-registration.yml
KONNECTD_ISS: https://ocis-server:9200
KONNECTD_TLS: "true"
ACCOUNTS_HASH_DIFFICULTY: 4
volumes:
- ../../../config:/drone/src/ocis/tests/config
- oCISownCloud10testsuite:/srv
volumes:
oCISownCloud10testsuite:
@@ -0,0 +1,5 @@
services:
ocis-server:
build:
context: ./../../../../.
dockerfile: Dockerfile
@@ -0,0 +1,3 @@
services:
ocis-server:
image: owncloud/ocis:$OCIS_IMAGE_TAG
+5
View File
@@ -0,0 +1,5 @@
services:
redis:
image: webhippie/redis
environment:
REDIS_DATABASES: 1
+103
View File
@@ -0,0 +1,103 @@
#!/bin/bash
git config --global advice.detachedHead false
## GET DEPENDENCIES
if cd $TESTING_DIR > /dev/null 2>&1
then
git pull
else
git clone -b master --depth=1 https://github.com/owncloud/testing.git $TESTING_DIR
fi
if cd $PATH_TO_CORE > /dev/null 2>&1
then
git checkout $CORE_BRANCH
git pull
git checkout $CORE_COMMIT
else
git clone -b $CORE_BRANCH --single-branch --no-tags https://github.com/owncloud/core.git $PATH_TO_CORE
cd $PATH_TO_CORE
git checkout $CORE_COMMIT
fi
## CONFIGURE TEST
if [ "$TEST_SOURCE" = "oc10" ]
then
if [ "$STORAGE" = "owncloud" ]
then
export OCIS_REVA_DATA_ROOT='/srv/app/tmp/ocis/owncloud/data/'
export DELETE_USER_DATA_CMD=''
export BEHAT_FILTER_TAGS='~@notToImplementOnOCIS&&~@toImplementOnOCIS&&~comments-app-required&&~@federation-app-required&&~@notifications-app-required&&~systemtags-app-required&&~@local_storage&&~@skipOnOcis-OC-Storage'
export OCIS_SKELETON_STRATEGY='copy'
export EXPECTED_FAILURES_FILE='/drone/src/tests/acceptance/expected-failures-on-OWNCLOUD-storage.txt'
elif [ "$STORAGE" = "ocis" ]
then
export OCIS_REVA_DATA_ROOT=''
export DELETE_USER_DATA_CMD='rm -rf /srv/app/tmp/ocis/storage/users/nodes/root/* /srv/app/tmp/ocis/storage/users/nodes/*-*-*-*'
export BEHAT_FILTER_TAGS='~@notToImplementOnOCIS&&~@toImplementOnOCIS&&~comments-app-required&&~@federation-app-required&&~@notifications-app-required&&~systemtags-app-required&&~@local_storage&&~@skipOnOcis-OCIS-Storage'
export OCIS_SKELETON_STRATEGY='upload'
export EXPECTED_FAILURES_FILE='/drone/src/tests/acceptance/expected-failures-on-OCIS-storage.txt'
else
echo "non existing STORAGE selected"
exit 1
fi
unset BEHAT_SUITE
elif [ "$TEST_SOURCE" = "ocis" ]
then
if [ "$STORAGE" = "owncloud" ]
then
export BEHAT_FILTER_TAGS='~@skipOnOcis-OC-Storage'
export DELETE_USER_DATA_CMD=''
export OCIS_REVA_DATA_ROOT='/srv/app/tmp/ocis/owncloud/data/'
export OCIS_SKELETON_STRATEGY='copy'
elif [ "$STORAGE" = "ocis" ]
then
export BEHAT_FILTER_TAGS='~@skipOnOcis-OCIS-Storage'
export DELETE_USER_DATA_CMD='rm -rf /srv/app/tmp/ocis/storage/users/nodes/root/* /srv/app/tmp/ocis/storage/users/nodes/*-*-*-*'
export OCIS_REVA_DATA_ROOT=''
export OCIS_SKELETON_STRATEGY='upload'
else
echo "non existing storage selected"
exit 1
fi
unset DIVIDE_INTO_NUM_PARTS
unset RUN_PART
else
echo "non existing TEST_SOURCE selected"
exit 1
fi
if [ ! -z "$BEHAT_FEATURE" ]
then
echo "feature selected: " + $BEHAT_FEATURE
# allow to run without filters if its a feature
unset BEHAT_FILTER_TAGS
unset DIVIDE_INTO_NUM_PARTS
unset RUN_PART
unset EXPECTED_FAILURES_FILE
fi
## RUN TEST
if [ "$TEST_SOURCE" = "oc10" ]
then
make -C /srv/app/testrunner test-acceptance-api
elif [ "$TEST_SOURCE" = "ocis" ]
then
cd $OCIS_ROOT
sleep 10
make test-acceptance-api
else
echo "non existing TEST_SOURCE selected"
exit 1
fi
chmod -R 777 vendor-bin/**/vendor vendor-bin/**/composer.lock tests/acceptance/output