Skip to content

Commit

Permalink
Merge pull request #40409 from owncloud/fix-su-exec-ci
Browse files Browse the repository at this point in the history
[full-ci] [tests-only] Fix su exec ci
  • Loading branch information
phil-davis authored Oct 7, 2022
2 parents 93d8d64 + 035f1c4 commit 575d9e8
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions .drone.star
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ THEGEEKLAB_DRONE_GITHUB_COMMENT = "thegeeklab/drone-github-comment:1"
TOOLHIPPIE_CALENS = "toolhippie/calens:latest"
WEBHIPPIE_REDIS = "webhippie/redis:latest"

DEFAULT_PHP_VERSION = "7.4"
DEFAULT_PHP_VERSION = "7.4-ubuntu20.04"
DEFAULT_NODEJS_VERSION = "14"

dir = {
Expand Down Expand Up @@ -1378,7 +1378,7 @@ def phpTests(ctx, testType, withCoverage):

for phpVersion in params["phpVersions"]:
if testType == "phpunit":
command = "su-exec www-data bash tests/drone/test-phpunit.sh"
command = "setpriv --reuid=www-data --regid=www-data --init-groups bash tests/drone/test-phpunit.sh"
else:
command = "unknown tbd"

Expand Down Expand Up @@ -1652,6 +1652,11 @@ def acceptance(ctx):
for federatedServerVersion in params["federatedServerVersions"]:
for browser in params["browsers"]:
for phpVersion in params["phpVersions"]:
# Get the first 3 characters of the PHP version (7.4 or 8.0 etc)
# And use that for constructing the pipeline name
# That helps shorten pipeline names when using owncloud-ci images
# that have longer names like 7.4-ubuntu20.04
phpMinorVersion = phpVersion[0:3]
for db in params["databases"]:
for runPart in range(1, params["numberOfParts"] + 1):
debugPartsEnabled = (len(params["skipExceptParts"]) != 0)
Expand All @@ -1673,7 +1678,7 @@ def acceptance(ctx):
keyString = "-" + category if params["includeKeyInMatrixName"] else ""
partString = "" if params["numberOfParts"] == 1 else "-%d-%d" % (params["numberOfParts"], runPart)
federatedServerVersionString = "-" + federatedServerVersion.replace("daily-", "").replace("-qa", "") if (federatedServerVersion != "") else ""
name = "%s%s%s%s%s-%s-php%s" % (alternateSuiteName, keyString, partString, federatedServerVersionString, browserString, getShortDbNameAndVersion(db), phpVersion)
name = "%s%s%s%s%s-%s-php%s" % (alternateSuiteName, keyString, partString, federatedServerVersionString, browserString, getShortDbNameAndVersion(db), phpMinorVersion)
maxLength = 50
nameLength = len(name)
if nameLength > maxLength:
Expand Down Expand Up @@ -1733,7 +1738,7 @@ def acceptance(ctx):

# The test suite (may/will) run local commands, rather than calling the testing app to do them
# Those commands need to be executed as www-data (which owns the files)
suExecCommand = "su-exec www-data "
suExecCommand = "setpriv --reuid=www-data --regid=www-data --init-groups "

if params["testAgainstCoreTarball"]:
pathOfServerUnderTest = "/drone/core"
Expand Down

0 comments on commit 575d9e8

Please sign in to comment.