Skip to content

Commit

Permalink
Add new pipeline for eos testing
Browse files Browse the repository at this point in the history
  • Loading branch information
dpakach committed Sep 4, 2020
1 parent 708eab0 commit a731795
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 6 deletions.
65 changes: 64 additions & 1 deletion .drone.star
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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]
Expand Down
4 changes: 4 additions & 0 deletions tests/config/drone/setup-eos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions tests/spwan_eos.sh
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit a731795

Please sign in to comment.