Skip to content

Commit c2a11d8

Browse files
committed
test: use sed command to patch tumbnails file
1 parent f6b8c66 commit c2a11d8

File tree

3 files changed

+11
-141
lines changed

3 files changed

+11
-141
lines changed

.drone.star

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ config = {
209209
"apiSharingNgLinkShareManagement",
210210
],
211211
"skip": False,
212+
"k8s": True,
212213
"withRemotePhp": [False],
213214
},
214215
"antivirus": {
@@ -365,7 +366,6 @@ config = {
365366
"coreApiWebdavUploadTUS",
366367
],
367368
"skip": False,
368-
"k8s": True,
369369
},
370370
},
371371
"e2eTests": {
@@ -1093,7 +1093,7 @@ def localApiTestPipeline(ctx):
10931093
params[item] = matrix[item] if item in matrix else defaults[item]
10941094
for storage in params["storages"]:
10951095
for run_with_remote_php in params["withRemotePhp"]:
1096-
run_on_k8s = params["k8s"]
1096+
run_on_k8s = params["k8s"] and ctx.build.event == "cron"
10971097
ocis_url = OCIS_URL
10981098
if run_on_k8s:
10991099
ocis_url = "https://%s" % OCIS_SERVER_NAME
@@ -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 []) +
@@ -1395,7 +1395,7 @@ def coreApiTestPipeline(ctx):
13951395
for run_with_remote_php in params["withRemotePhp"]:
13961396
filter_tags = "~@skipOnGraph&&~@skipOnOcis-%s-Storage" % ("OC" if storage == "owncloud" else "OCIS")
13971397
expected_failures_file = "%s/expected-failures-API-on-%s-storage.md" % (test_dir, storage.upper())
1398-
run_on_k8s = params["k8s"]
1398+
run_on_k8s = params["k8s"] and ctx.build.event == "cron"
13991399
ocis_url = OCIS_URL
14001400
if run_on_k8s:
14011401
ocis_url = "https://%s" % OCIS_SERVER_NAME
@@ -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",
@@ -2738,7 +2738,7 @@ def build():
27382738
"name": "build",
27392739
"image": OC_CI_GOLANG,
27402740
"commands": [
2741-
"retry -t 3 'make -C ocis build ENABLE_VIPS=true'",
2741+
"retry -t 3 'make -C ocis build'",
27422742
],
27432743
"environment": DRONE_HTTP_PROXY_ENV,
27442744
"volumes": [stepVolumeGo],
@@ -3827,9 +3827,11 @@ def deployOcis():
38273827
"make -C %s build" % dirs["ocisWrapper"],
38283828
"mv %s/tests/config/drone/k8s/values.yaml %s/ocis-charts/charts/ocis/ci/deployment-values.yaml" % (dirs["base"], dirs["base"]),
38293829
"cp -r %s/tests/config/drone/k8s/authbasic %s/ocis-charts/charts/ocis/templates/" % (dirs["base"], dirs["base"]),
3830-
# Fix thumbnails deployment to use correct environment variable and mount fonts (ConfigMaps created in k3sCluster)
3831-
"cp %s/tests/config/drone/k8s/thumbnails/deployment.yaml %s/ocis-charts/charts/ocis/templates/thumbnails/deployment.yaml" % (dirs["base"], dirs["base"]),
38323830
"cd %s/ocis-charts" % dirs["base"],
3831+
# Patch thumbnails deployment to mount Unicode fonts (ConfigMaps created in k3sCluster)
3832+
"sed -i '/- name: THUMBNAILS_TRANSFER_TOKEN/i\\\\ - name: THUMBNAILS_TXT_FONTMAP_FILE\\\n value: /etc/ocis/fontsMap.json\\\n' ./charts/ocis/templates/thumbnails/deployment.yaml",
3833+
"sed -i '/volumeMounts:/a\\\\ - name: ocis-fonts-ttf\\\n mountPath: /etc/ocis/fonts\\\n - name: ocis-fonts-map\\\n mountPath: /etc/ocis/fontsMap.json\\\n subPath: fontsMap.json' ./charts/ocis/templates/thumbnails/deployment.yaml",
3834+
"sed -i '/volumes:/a\\\\ - name: ocis-fonts-ttf\\\n configMap:\\\n name: ocis-fonts-ttf\\\n - name: ocis-fonts-map\\\n configMap:\\\n name: ocis-fonts-map' ./charts/ocis/templates/thumbnails/deployment.yaml",
38333835
"sed -i '/{{- define \"ocis.basicServiceTemplates\" -}}/a\\\\ {{- $_ := set .scope \"appNameAuthBasic\" \"authbasic\" -}}' ./charts/ocis/templates/_common/_tplvalues.tpl",
38343836
"sed -i '/- name: IDM_ADMIN_PASSWORD/{n;N;N;N;d;}' ./charts/ocis/templates/idm/deployment.yaml",
38353837
"sed -i '/- name: IDM_ADMIN_PASSWORD/a\\\\\\n value: \"admin\"' ./charts/ocis/templates/idm/deployment.yaml",

tests/acceptance/features/coreApiWebdavUploadTUS/lowLevelUpload.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Feature: low level tests for upload of chunks
5151
When user "Alice" sends a chunk to the last created TUS Location with offset "0" and data "123" using the WebDAV API
5252
And user "Alice" sends a chunk to the last created TUS Location with offset "3" and data "4567890" using the WebDAV API
5353
And user "Alice" sends a chunk to the last created TUS Location with offset "3" and data "0000000" using the WebDAV API
54-
Then the HTTP status code should be "404" or "409"
54+
Then the HTTP status code should be "404"
5555
And the content of file "/file.txt" for user "Alice" should be "1234567890"
5656
Examples:
5757
| dav-path-version |

tests/config/drone/k8s/thumbnails/deployment.yaml

Lines changed: 0 additions & 132 deletions
This file was deleted.

0 commit comments

Comments
 (0)