Skip to content

Commit e948185

Browse files
committed
test: make tests inside apiSpaces run over k8s
1 parent 4f96d69 commit e948185

File tree

4 files changed

+16
-264
lines changed

4 files changed

+16
-264
lines changed

.drone.star

Lines changed: 6 additions & 263 deletions
Original file line numberDiff line numberDiff line change
@@ -93,273 +93,12 @@ config = {
9393
"skip": False,
9494
},
9595
"localApiTests": {
96-
"contractAndLock": {
97-
"suites": [
98-
"apiContract",
99-
"apiLocks",
100-
],
101-
"skip": False,
102-
"k8s": True,
103-
},
104-
"settingsAndNotification": {
105-
"suites": [
106-
"apiSettings",
107-
"apiNotification",
108-
"apiCors",
109-
],
110-
"skip": False,
111-
"withRemotePhp": [True],
112-
"emailNeeded": True,
113-
"extraEnvironment": {
114-
"EMAIL_HOST": EMAIL_SMTP_HOST,
115-
"EMAIL_PORT": EMAIL_PORT,
116-
},
117-
"extraServerEnvironment": {
118-
"OCIS_ADD_RUN_SERVICES": "notifications",
119-
"NOTIFICATIONS_SMTP_HOST": EMAIL_SMTP_HOST,
120-
"NOTIFICATIONS_SMTP_PORT": EMAIL_SMTP_PORT,
121-
"NOTIFICATIONS_SMTP_INSECURE": "true",
122-
"NOTIFICATIONS_SMTP_SENDER": EMAIL_SMTP_SENDER,
123-
"NOTIFICATIONS_DEBUG_ADDR": "0.0.0.0:9174",
124-
},
125-
},
126-
"graphUser": {
127-
"suites": [
128-
"apiGraphUser",
129-
],
130-
"skip": False,
131-
"withRemotePhp": [True],
132-
},
13396
"spaces": {
13497
"suites": [
13598
"apiSpaces",
13699
],
137100
"skip": False,
138-
},
139-
"spacesShares": {
140-
"suites": [
141-
"apiSpacesShares",
142-
],
143-
"skip": False,
144-
"k8s": True,
145-
},
146-
"davOperations": {
147-
"suites": [
148-
"apiSpacesDavOperation",
149-
"apiDownloads",
150-
"apiAsyncUpload",
151-
"apiDepthInfinity",
152-
"apiArchiver",
153-
"apiActivities",
154-
],
155-
"skip": False,
156-
},
157-
"groupAndSearch1": {
158-
"suites": [
159-
"apiSearch1",
160-
"apiGraph",
161-
"apiGraphGroup",
162-
"apiServiceAvailability",
163-
],
164-
"skip": False,
165-
"k8s": False,
166-
},
167-
"search2": {
168-
"suites": [
169-
"apiSearch2",
170-
"apiSearchContent",
171-
],
172-
"tikaNeeded": True,
173-
"skip": False,
174-
"k8s": False,
175-
},
176-
"sharingNg1": {
177-
"suites": [
178-
"apiSharingNgShares",
179-
"apiReshare",
180-
"apiSharingNgPermissions",
181-
],
182-
"skip": False,
183-
"withRemotePhp": [True],
184-
},
185-
"sharingNgAdditionalShareRole": {
186-
"suites": [
187-
"apiSharingNgAdditionalShareRole",
188-
],
189-
"skip": False,
190-
"k8s": True,
191-
"withRemotePhp": [True],
192-
},
193-
"sharingNgShareInvitation": {
194-
"suites": [
195-
"apiSharingNgDriveInvitation",
196-
"apiSharingNgItemInvitation",
197-
],
198-
"skip": False,
199-
"withRemotePhp": [True],
200-
},
201-
"sharingNgLinkShare": {
202-
"suites": [
203-
"apiSharingNgDriveLinkShare",
204-
"apiSharingNgItemLinkShare",
205-
"apiSharingNgLinkShareManagement",
206-
],
207-
"skip": False,
208-
"withRemotePhp": [True],
209-
},
210-
"antivirus": {
211-
"suites": [
212-
"apiAntivirus",
213-
],
214-
"skip": False,
215-
"antivirusNeeded": True,
216-
"extraServerEnvironment": {
217-
"ANTIVIRUS_SCANNER_TYPE": "clamav",
218-
"ANTIVIRUS_CLAMAV_SOCKET": "tcp://clamav:3310",
219-
"POSTPROCESSING_STEPS": "virusscan",
220-
"OCIS_ADD_RUN_SERVICES": "antivirus",
221-
"ANTIVIRUS_DEBUG_ADDR": "0.0.0.0:9297",
222-
},
223-
},
224-
"ocmAndAuthApp": {
225-
"suites": [
226-
"apiOcm",
227-
"apiAuthApp",
228-
],
229-
"skip": False,
230-
"withRemotePhp": [True],
231-
"federationServer": True,
232-
"emailNeeded": True,
233-
"extraEnvironment": {
234-
"EMAIL_HOST": EMAIL_SMTP_HOST,
235-
"EMAIL_PORT": EMAIL_PORT,
236-
},
237-
"extraServerEnvironment": {
238-
"OCIS_ADD_RUN_SERVICES": "ocm,notifications,auth-app",
239-
"OCIS_ENABLE_OCM": True,
240-
"OCM_OCM_INVITE_MANAGER_INSECURE": True,
241-
"OCM_OCM_SHARE_PROVIDER_INSECURE": True,
242-
"OCM_OCM_STORAGE_PROVIDER_INSECURE": True,
243-
"OCM_OCM_PROVIDER_AUTHORIZER_PROVIDERS_FILE": "%s" % dirs["ocmProviders"],
244-
# mail notifications
245-
"NOTIFICATIONS_SMTP_HOST": EMAIL_SMTP_HOST,
246-
"NOTIFICATIONS_SMTP_PORT": EMAIL_SMTP_PORT,
247-
"NOTIFICATIONS_SMTP_INSECURE": "true",
248-
"NOTIFICATIONS_SMTP_SENDER": EMAIL_SMTP_SENDER,
249-
# auth-app
250-
"PROXY_ENABLE_APP_AUTH": True,
251-
},
252-
},
253-
"wopi": {
254-
"suites": [
255-
"apiCollaboration",
256-
],
257-
"skip": False,
258-
"withRemotePhp": [True],
259-
"collaborationServiceNeeded": True,
260-
"extraServerEnvironment": {
261-
"GATEWAY_GRPC_ADDR": "0.0.0.0:9142",
262-
},
263-
},
264-
"cliCommands": {
265-
"suites": [
266-
"cliCommands",
267-
],
268-
"skip": False,
269-
"withRemotePhp": [True],
270-
"antivirusNeeded": True,
271-
"emailNeeded": True,
272-
"extraEnvironment": {
273-
"EMAIL_HOST": EMAIL_SMTP_HOST,
274-
"EMAIL_PORT": EMAIL_PORT,
275-
},
276-
"extraServerEnvironment": {
277-
"NOTIFICATIONS_SMTP_HOST": EMAIL_SMTP_HOST,
278-
"NOTIFICATIONS_SMTP_PORT": EMAIL_SMTP_PORT,
279-
"NOTIFICATIONS_SMTP_INSECURE": "true",
280-
"NOTIFICATIONS_SMTP_SENDER": EMAIL_SMTP_SENDER,
281-
"NOTIFICATIONS_DEBUG_ADDR": "0.0.0.0:9174",
282-
"ANTIVIRUS_SCANNER_TYPE": "clamav",
283-
"ANTIVIRUS_CLAMAV_SOCKET": "tcp://clamav:3310",
284-
"OCIS_ADD_RUN_SERVICES": "antivirus,notifications",
285-
},
286-
},
287-
},
288-
"coreApiTests": {
289-
"1": {
290-
"suites": [
291-
"coreApiAuth",
292-
"coreApiCapabilities",
293-
"coreApiFavorites",
294-
"coreApiMain",
295-
"coreApiVersions",
296-
],
297-
"skip": False,
298-
"withRemotePhp": [True],
299-
},
300-
"2": {
301-
"suites": [
302-
"coreApiShareManagementBasicToShares",
303-
"coreApiShareManagementToShares",
304-
],
305-
"skip": False,
306101
"k8s": True,
307-
"withRemotePhp": [True],
308-
},
309-
"3": {
310-
"suites": [
311-
"coreApiSharees",
312-
"coreApiSharePublicLink2",
313-
],
314-
"skip": False,
315-
"withRemotePhp": [True],
316-
},
317-
"4": {
318-
"suites": [
319-
"coreApiShareOperationsToShares1",
320-
"coreApiShareOperationsToShares2",
321-
"coreApiSharePublicLink1",
322-
"coreApiShareCreateSpecialToShares1",
323-
"coreApiShareCreateSpecialToShares2",
324-
"coreApiShareUpdateToShares",
325-
],
326-
"skip": False,
327-
"k8s": True,
328-
"withRemotePhp": [True],
329-
},
330-
"5": {
331-
"suites": [
332-
"coreApiTrashbin",
333-
"coreApiTrashbinRestore",
334-
"coreApiWebdavEtagPropagation1",
335-
"coreApiWebdavEtagPropagation2",
336-
],
337-
"skip": False,
338-
"k8s": True,
339-
},
340-
"6": {
341-
"suites": [
342-
"coreApiWebdavDelete",
343-
"coreApiWebdavOperations",
344-
"coreApiWebdavMove2",
345-
],
346-
"skip": False,
347-
},
348-
"7": {
349-
"suites": [
350-
"coreApiWebdavProperties",
351-
],
352-
"skip": False,
353-
"k8s": True,
354-
},
355-
"8": {
356-
"suites": [
357-
"coreApiWebdavMove1",
358-
"coreApiWebdavPreviews",
359-
"coreApiWebdavUpload",
360-
"coreApiWebdavUploadTUS",
361-
],
362-
"skip": False,
363102
},
364103
},
365104
"e2eTests": {
@@ -1087,7 +826,7 @@ def localApiTestPipeline(ctx):
1087826
params[item] = matrix[item] if item in matrix else defaults[item]
1088827
for storage in params["storages"]:
1089828
for run_with_remote_php in params["withRemotePhp"]:
1090-
run_on_k8s = params["k8s"] and ctx.build.event == "cron"
829+
run_on_k8s = params["k8s"]
1091830
ocis_url = OCIS_URL
1092831
if run_on_k8s:
1093832
ocis_url = "https://%s" % OCIS_SERVER_NAME
@@ -1389,7 +1128,7 @@ def coreApiTestPipeline(ctx):
13891128
for run_with_remote_php in params["withRemotePhp"]:
13901129
filter_tags = "~@skipOnGraph&&~@skipOnOcis-%s-Storage" % ("OC" if storage == "owncloud" else "OCIS")
13911130
expected_failures_file = "%s/expected-failures-API-on-%s-storage.md" % (test_dir, storage.upper())
1392-
run_on_k8s = params["k8s"] and ctx.build.event == "cron"
1131+
run_on_k8s = params["k8s"]
13931132
ocis_url = OCIS_URL
13941133
if run_on_k8s:
13951134
ocis_url = "https://%s" % OCIS_SERVER_NAME
@@ -3815,6 +3554,7 @@ def deployOcis():
38153554
"commands": [
38163555
"make -C %s build" % dirs["ocisWrapper"],
38173556
"mv %s/tests/config/drone/k3s/values.yaml %s/ocis-charts/charts/ocis/ci/deployment-values.yaml" % (dirs["base"], dirs["base"]),
3557+
"cat %s/ocis-charts/charts/ocis/ci/deployment-values.yaml" % dirs["base"],
38183558
"cp -r %s/tests/config/drone/k3s/authbasic %s/ocis-charts/charts/ocis/templates/" % (dirs["base"], dirs["base"]),
38193559
"cd %s/ocis-charts" % dirs["base"],
38203560
"sed -i '/{{- define \"ocis.basicServiceTemplates\" -}}/a\\\\ {{- $_ := set .scope \"appNameAuthBasic\" \"authbasic\" -}}' ./charts/ocis/templates/_common/_tplvalues.tpl",
@@ -3825,6 +3565,7 @@ def deployOcis():
38253565
"sed -i '/name: SHARING_PASSWORD_POLICY_BANNED_PASSWORDS_LIST/,+1d' %s/ocis-charts/charts/ocis/templates/sharing/deployment.yaml" % dirs["base"],
38263566
"export KUBECONFIG=%s/kubeconfig-$${DRONE_BUILD_NUMBER}.yaml" % dirs["base"],
38273567
"make helm-install-atomic",
3568+
"curl -kv -X 'POST' 'https://ocis-server/graph/v1.0/drives' -H 'Authorization: Basic YWRtaW46YWRtaW4=' -d '{\"name\":\"Space Nameklkj\"}'",
38283569
],
38293570
"volumes": [
38303571
{
@@ -3844,6 +3585,8 @@ def ociswrapper():
38443585
"until test -f $${KUBECONFIG}; do sleep 1s; done",
38453586
"kubectl get pods -A",
38463587
"kubectl get ingress -A",
3588+
"POD_NAME=$(kubectl get pods -n ocis --no-headers | grep graph | awk '{print $1}')",
3589+
"kubectl describe pod $POD_NAME -n ocis",
38473590
"%s/bin/ociswrapper serve --url https://ocis-server --admin-username admin --admin-password admin --skip-ocis-run" % dirs["ocisWrapper"],
38483591
],
38493592
"detach": True,

tests/acceptance/TestHelpers/GraphHelper.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,7 @@ public static function editUser(
312312
$accountEnabled,
313313
);
314314
$url = self::getFullUrl($baseUrl, 'users/' . $userId);
315+
var_dump($url, $payload);
315316
return HttpRequestHelper::sendRequest(
316317
$url,
317318
$method,
@@ -982,6 +983,8 @@ public static function getMySpaces(
982983
$urlArguments = $urlArguments ? "?$urlArguments" : "";
983984
$url = self::getFullUrl($baseUrl, "me/drives" . $urlArguments);
984985

986+
var_dump("urllllll", $url);
987+
985988
return HttpRequestHelper::get($url, $user, $password, $headers, $body);
986989
}
987990

tests/acceptance/bootstrap/SpacesContext.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -653,14 +653,15 @@ public function listAllMySpaces(
653653
string $query = '',
654654
array $headers = [],
655655
): ResponseInterface {
656-
return GraphHelper::getMySpaces(
656+
$response = GraphHelper::getMySpaces(
657657
$this->featureContext->getBaseUrl(),
658658
$user,
659659
$this->featureContext->getPasswordForUser($user),
660660
$query,
661661
[],
662662
$headers,
663663
);
664+
return $response;
664665
}
665666

666667
/**
@@ -1846,6 +1847,8 @@ public function theUserHasCreatedASpaceByDefaultUsingTheGraphApi(
18461847
string $spaceName,
18471848
): void {
18481849
$space = ["name" => $spaceName];
1850+
$spaces = $this->listAllMySpaces($user);
1851+
var_dump($spaces->getBody()->getContents());
18491852
$response = $this->createSpace($user, $space);
18501853
$this->featureContext->theHTTPStatusCodeShouldBe(
18511854
201,

tests/config/drone/k3s/values.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ features:
3030
- "12345678"
3131
- "ownCloud"
3232
- "owncloud-1"
33+
quotas:
34+
default: "1000000000"
35+
max: "0"
3336

3437
http:
3538
cors:

0 commit comments

Comments
 (0)