From bc787c521db57621bc80388e0f79bf06cfd42835 Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Mon, 15 Jun 2020 16:17:00 +0545 Subject: [PATCH 1/3] Fetch API testrunner from specific branch and commit --- .drone.star | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.drone.star b/.drone.star index 19e90d354d7..cc025201850 100644 --- a/.drone.star +++ b/.drone.star @@ -1,7 +1,7 @@ def main(ctx): before = [ testing(ctx), - apiTests(ctx), + apiTests(ctx, 'master', '158bd976047ea8abd137e2c61905d9dd63dc977d'), ] stages = [ @@ -23,7 +23,7 @@ def main(ctx): return before + stages + after -def apiTests(ctx): +def apiTests(ctx, coreBranch, coreCommit): return { 'kind': 'pipeline', 'type': 'docker', @@ -103,8 +103,9 @@ def apiTests(ctx): }, 'commands': [ 'git clone -b master --depth=1 https://github.com/owncloud/testing.git /srv/app/tmp/testing', - 'git clone -b master --depth=1 https://github.com/owncloud/core.git /srv/app/testrunner', + 'git clone -b %s --single-branch --no-tags https://github.com/owncloud/core.git /srv/app/testrunner' % (coreBranch), 'cd /srv/app/testrunner', + 'git checkout %s' % (coreCommit), 'make test-acceptance-api' ], 'volumes': [ From 0f7cc3bf2554fd11136711e46e75642c21c6bef5 Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Mon, 15 Jun 2020 16:57:12 +0545 Subject: [PATCH 2/3] Adjust indent in .drone.star --- .drone.star | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/.drone.star b/.drone.star index cc025201850..e445a985e18 100644 --- a/.drone.star +++ b/.drone.star @@ -100,20 +100,20 @@ def apiTests(ctx, coreBranch, coreCommit): 'TEST_OCIS':'true', 'OCIS_REVA_DATA_ROOT': '/srv/app/tmp/reva/', 'SKELETON_DIR': '/srv/app/tmp/testing/data/apiSkeleton' - }, - 'commands': [ - 'git clone -b master --depth=1 https://github.com/owncloud/testing.git /srv/app/tmp/testing', - 'git clone -b %s --single-branch --no-tags https://github.com/owncloud/core.git /srv/app/testrunner' % (coreBranch), - 'cd /srv/app/testrunner', - 'git checkout %s' % (coreCommit), - 'make test-acceptance-api' - ], - 'volumes': [ - { - 'name': 'gopath', - 'path': '/srv/app', - }, - ] + }, + 'commands': [ + 'git clone -b master --depth=1 https://github.com/owncloud/testing.git /srv/app/tmp/testing', + 'git clone -b %s --single-branch --no-tags https://github.com/owncloud/core.git /srv/app/testrunner' % (coreBranch), + 'cd /srv/app/testrunner', + 'git checkout %s' % (coreCommit), + 'make test-acceptance-api' + ], + 'volumes': [ + { + 'name': 'gopath', + 'path': '/srv/app', + }, + ] }, ], 'services': [ @@ -321,7 +321,7 @@ def testing(ctx): 'LITMUS_USERNAME': 'tu1', 'LITMUS_PASSWORD': '1234', 'TESTS': 'basic http copymove props' - }, + }, }, ], 'services': [ @@ -335,7 +335,7 @@ def testing(ctx): 'LDAP_ADMIN_PASSWORD': 'admin', 'LDAP_TLS_VERIFY_CLIENT': 'never', 'HOSTNAME': 'ldap' - }, + }, }, { 'name': 'redis', @@ -343,7 +343,7 @@ def testing(ctx): 'pull': 'always', 'environment': { 'REDIS_DATABASES': 1 - }, + }, }, ], 'volumes': [ From 557015de68ea46f9820c642e33d167f186d2858d Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Mon, 15 Jun 2020 17:07:40 +0545 Subject: [PATCH 3/3] Only checkout a commit if it is specified --- .drone.star | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.drone.star b/.drone.star index e445a985e18..1d403e0fc5c 100644 --- a/.drone.star +++ b/.drone.star @@ -23,7 +23,7 @@ def main(ctx): return before + stages + after -def apiTests(ctx, coreBranch, coreCommit): +def apiTests(ctx, coreBranch = 'master', coreCommit = ''): return { 'kind': 'pipeline', 'type': 'docker', @@ -105,7 +105,9 @@ def apiTests(ctx, coreBranch, coreCommit): 'git clone -b master --depth=1 https://github.com/owncloud/testing.git /srv/app/tmp/testing', 'git clone -b %s --single-branch --no-tags https://github.com/owncloud/core.git /srv/app/testrunner' % (coreBranch), 'cd /srv/app/testrunner', - 'git checkout %s' % (coreCommit), + ] + ([ + 'git checkout %s' % (coreCommit) + ] if coreCommit != '' else []) + [ 'make test-acceptance-api' ], 'volumes': [