Skip to content

Commit b29f989

Browse files
committed
test: separate the methods for clarity
1 parent 31345cc commit b29f989

File tree

1 file changed

+28
-9
lines changed

1 file changed

+28
-9
lines changed

.drone.star

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1110,7 +1110,7 @@ def localApiTestPipeline(ctx):
11101110
([] if run_on_k8s else restoreBuildArtifactCache(ctx, "ocis-binary-amd64", "ocis/bin")) +
11111111
(tikaService() if params["tikaNeeded"] and not run_on_k8s else tikaServiceK8s() if params["tikaNeeded"] and run_on_k8s else []) +
11121112
(waitForServices("online-offices", ["collabora:9980", "onlyoffice:443", "fakeoffice:8080"]) if params["collaborationServiceNeeded"] else []) +
1113-
(waitK3sCluster() + (clamavServiceK8s() if params["antivirusNeeded"] and run_on_k8s else []) + (emailServiceK8s() if params["emailNeeded"] and run_on_k8s else []) + deployOcis() + waitForOcis(ocis_url = ocis_url) + ociswrapper() + waitForOciswrapper() if run_on_k8s else ocisServer(storage, extra_server_environment = params["extraServerEnvironment"], with_wrapper = True, tika_enabled = params["tikaNeeded"], volumes = ([stepVolumeOcisStorage]))) +
1113+
(waitK3sCluster() + (clamavServiceK8s() if params["antivirusNeeded"] and run_on_k8s else []) + (emailServiceK8s() if params["emailNeeded"] and run_on_k8s else []) + prepareOcisDeployment() + setupOcisConfigMaps() + deployOcis() + waitForOcis(ocis_url = ocis_url) + ociswrapper() + waitForOciswrapper() if run_on_k8s else ocisServer(storage, extra_server_environment = params["extraServerEnvironment"], with_wrapper = True, tika_enabled = params["tikaNeeded"], volumes = ([stepVolumeOcisStorage]))) +
11141114
(waitForClamavService() if params["antivirusNeeded"] and not run_on_k8s else exposeAntivirusServiceK8s() if params["antivirusNeeded"] and run_on_k8s else []) +
11151115
(waitForEmailService() if params["emailNeeded"] and not run_on_k8s else exposeEmailServiceK8s() if params["emailNeeded"] and run_on_k8s else []) +
11161116
(ocisServer(storage, deploy_type = "federation", extra_server_environment = params["extraServerEnvironment"]) if params["federationServer"] else []) +
@@ -1412,7 +1412,7 @@ def coreApiTestPipeline(ctx):
14121412
(tikaService() if params["tikaNeeded"] else []) +
14131413
(waitForClamavService() if params["antivirusNeeded"] else []) +
14141414
(waitForEmailService() if params["emailNeeded"] else []) +
1415-
(waitK3sCluster() + deployOcis() + waitForOcis(ocis_url = ocis_url) + ociswrapper() + waitForOciswrapper() if run_on_k8s else ocisServer(storage, extra_server_environment = params["extraServerEnvironment"], with_wrapper = True, tika_enabled = params["tikaNeeded"], volumes = ([stepVolumeOcisStorage]))) +
1415+
(waitK3sCluster() + prepareOcisDeployment() + setupOcisConfigMaps() + deployOcis() + waitForOcis(ocis_url = ocis_url) + ociswrapper() + waitForOciswrapper() if run_on_k8s else ocisServer(storage, extra_server_environment = params["extraServerEnvironment"], with_wrapper = True, tika_enabled = params["tikaNeeded"], volumes = ([stepVolumeOcisStorage]))) +
14161416
[
14171417
{
14181418
"name": "run-api-tests",
@@ -3814,9 +3814,9 @@ def waitK3sCluster():
38143814
],
38153815
}]
38163816

3817-
def deployOcis():
3817+
def prepareOcisDeployment():
38183818
return [{
3819-
"name": "deploy-ocis",
3819+
"name": "prepare-ocis-deployment",
38203820
"image": "owncloudci/golang:latest",
38213821
"commands": [
38223822
"make -C %s build" % dirs["ocisWrapper"],
@@ -3832,11 +3832,6 @@ def deployOcis():
38323832
"sed -i 's|- name: configs|- name: banned-passwords|' ./charts/ocis/templates/sharing/deployment.yaml",
38333833
"sed -i 's|mountPath: /etc/ocis$|mountPath: /etc/ocis/config/drone|' ./charts/ocis/templates/sharing/deployment.yaml",
38343834
"sed -i 's|name: sharing-banned-passwords-{{ .appName }}|name: sharing-banned-passwords|' ./charts/ocis/templates/sharing/deployment.yaml",
3835-
# Setup ConfigMap for banned password list
3836-
"export KUBECONFIG=%s/kubeconfig-$${DRONE_BUILD_NUMBER}.yaml" % dirs["base"],
3837-
"kubectl create namespace ocis || true",
3838-
"kubectl create configmap -n ocis sharing-banned-passwords --from-file=banned-password-list.txt=%s/tests/config/drone/banned-password-list.txt" % dirs["base"],
3839-
"make helm-install-atomic",
38403835
],
38413836
"volumes": [
38423837
{
@@ -3846,6 +3841,30 @@ def deployOcis():
38463841
],
38473842
}]
38483843

3844+
def setupOcisConfigMaps():
3845+
return [{
3846+
"name": "setup-configmaps",
3847+
"image": K3D_IMAGE,
3848+
"user": "root",
3849+
"commands": [
3850+
"export KUBECONFIG=kubeconfig-$${DRONE_BUILD_NUMBER}.yaml",
3851+
"kubectl create namespace ocis || true",
3852+
"kubectl create configmap -n ocis sharing-banned-passwords --from-file=banned-password-list.txt=%s/tests/config/drone/banned-password-list.txt" % dirs["base"],
3853+
],
3854+
}]
3855+
3856+
def deployOcis():
3857+
return [{
3858+
"name": "deploy-ocis",
3859+
"image": K3D_IMAGE,
3860+
"user": "root",
3861+
"commands": [
3862+
"export KUBECONFIG=kubeconfig-$${DRONE_BUILD_NUMBER}.yaml",
3863+
"cd %s/ocis-charts" % dirs["base"],
3864+
"make helm-install-atomic",
3865+
],
3866+
}]
3867+
38493868
def clamavServiceK8s():
38503869
return [{
38513870
"name": "clamav",

0 commit comments

Comments
 (0)