diff --git a/.drone.star b/.drone.star index cbc36117bdd..f0bf0733303 100644 --- a/.drone.star +++ b/.drone.star @@ -92,6 +92,9 @@ def testPipelines(ctx): for runPart in range(1, config['apiTests']['numberOfParts'] + 1): pipelines.append(coreApiTests(ctx, config['apiTests']['coreBranch'], config['apiTests']['coreCommit'], runPart, config['apiTests']['numberOfParts'])) + for runPart in range(1, config['apiTests']['numberOfParts'] + 1): + pipelines.append(coreApiTestsEosStorage(ctx, config['apiTests']['coreBranch'], config['apiTests']['coreCommit'], runPart, config['apiTests']['numberOfParts'])) + pipelines += uiTests(ctx, config['uiTests']['phoenixBranch'], config['uiTests']['phoenixCommit']) return pipelines @@ -282,7 +285,8 @@ def coreApiTests(ctx, coreBranch = 'master', coreCommit = '', part_number = 1, n 'BEHAT_FILTER_TAGS': '~@notToImplementOnOCIS&&~@toImplementOnOCIS&&~@local_storage', 'DIVIDE_INTO_NUM_PARTS': number_of_parts, 'RUN_PART': part_number, - 'EXPECTED_FAILURES_FILE': '/drone/src/tests/acceptance/expected-failures-on-OC-storage.txt' + 'EXPECTED_FAILURES_FILE': '/drone/src/tests/acceptance/expected-failures-on-OC-storage.txt', + 'PART_NUMBER': part_number }, 'commands': [ 'cd /srv/app/testrunner', @@ -311,6 +315,65 @@ def coreApiTests(ctx, coreBranch = 'master', coreCommit = '', part_number = 1, n }, } +def coreApiTestsEosStorage(ctx, coreBranch = 'master', coreCommit = '', part_number = 1, number_of_parts = 1): + return { + 'kind': 'pipeline', + 'type': 'docker', + 'name': 'coreApiTests-Eos-Storage-%s' % (part_number), + 'platform': { + 'os': 'linux', + 'arch': 'amd64', + }, + 'steps': + cloneCoreRepos(coreBranch, coreCommit) + [ + { + 'name': 'oC10ApiTests-%s' % (part_number), + 'image': 'owncloudci/php:7.2', + 'pull': 'always', + 'environment' : { + 'SKELETON_DIR': '/srv/app/tmp/testing/data/apiSkeleton', + 'TEST_OCIS':'true', + 'BEHAT_FILTER_TAGS': '~@notToImplementOnOCIS&&~@toImplementOnOCIS&&~@local_storage', + 'DIVIDE_INTO_NUM_PARTS': number_of_parts, + 'RUN_PART': part_number, + 'EXPECTED_FAILURES_FILE': '/drone/src/tests/acceptance/expected-failures-on-EOS-storage.txt', + 'DELETE_USER_DATA_CMD': 'ssh -t root@${IPADDR} docker exec -it mgm-master eos -r 0 0 rm -r /eos/dockertest/reva/users/%s', + 'DRONE_COMMIT_ID': ctx.build.commit + }, + 'commands': [ + 'wget -q https://dl.google.com/go/go1.14.2.linux-amd64.tar.gz', + 'mkdir -p /usr/local/bin', + 'tar xf go1.14.2.linux-amd64.tar.gz -C /usr/local', + 'ln -s /usr/local/go/bin/* /usr/local/bin', + + 'go get -u github.com/hetznercloud/cli/cmd/hcloud', + + 'cd /drone/src', + '/drone/src/tests/spwan_eos.sh', + 'cd /srv/app/testrunner', + 'make test-acceptance-api', + ], + 'volumes': [{ + 'name': 'gopath', + 'path': '/srv/app', + }] + }, + ], + 'volumes': [ + { + 'name': 'gopath', + 'temp': {}, + }, + ], + 'trigger': { + 'ref': [ + 'refs/heads/master', + 'refs/tags/**', + 'refs/pull/**', + ], + }, + } + def uiTests(ctx, phoenixBranch, phoenixCommit): suiteNames = getUITestSuiteNames() return [uiTestPipeline(suiteName, phoenixBranch, phoenixCommit) for suiteName in suiteNames] diff --git a/tests/config/drone/setup-eos.sh b/tests/config/drone/setup-eos.sh index 8c655b231bf..2fca2178d12 100644 --- a/tests/config/drone/setup-eos.sh +++ b/tests/config/drone/setup-eos.sh @@ -8,7 +8,11 @@ do done docker-compose -f ./docker-compose-eos-ci.yml exec -d ocis /start-ldap + +# time for ldap service to starup within ocis container sleep 5 + +# Configure ocis docker-compose -f ./docker-compose-eos-ci.yml exec ocis id einstein docker-compose -f ./docker-compose-eos-ci.yml exec ocis /ocis/bin/ocis kill reva-users docker-compose -f ./docker-compose-eos-ci.yml exec ocis /ocis/bin/ocis run reva-users diff --git a/tests/spwan_eos.sh b/tests/spwan_eos.sh index 3cab62af06f..cefd1b795fc 100644 --- a/tests/spwan_eos.sh +++ b/tests/spwan_eos.sh @@ -1,15 +1,15 @@ #!/bin/bash ME=$DRONE_HCLOUD_USER -SERVER_NAME=droneci-eos-test-${DRONE_COMMIT_ID} +SERVER_NAME=droneci-eos-test-${DRONE_COMMIT_ID}-${PART_NUMBER} # Create a new machine on hcloud for eos hcloud server create --type cx21 --image ubuntu-20.04 --ssh-key $ME --name $SERVER_NAME --label owner=$ME --label for=test --label from=eos-compose +# time for the server to start up +sleep 15 IPADDR=$(hcloud server ip $SERVER_NAME) -OCIS_DOMAIN=$(hcloud server ip $SERVER_NAME) - -# timeout 180 while [[ \"$(curl -k -v -s -o /dev/null -w ''%{http_code}'' https://:9200)\" != \"200\" ]]; do sleep 2; done -# sleep 15 +export IPADDR=$IPADDR +export TEST_SERVER_URL=https://${IPADDR}:9200 # Setup system and clone ocis ssh -t root@$IPADDR apt-get update -y