Skip to content

Commit 29bd46a

Browse files
committed
test: check for flaky share-expiration email
1 parent 357b63a commit 29bd46a

File tree

3 files changed

+84
-125
lines changed

3 files changed

+84
-125
lines changed

.drone.star

+25-25
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,13 @@ OCIS_FED_DOMAIN = "%s:10200" % FED_OCIS_SERVER_NAME
6969
# configuration
7070
config = {
7171
"cs3ApiTests": {
72-
"skip": False,
72+
"skip": True,
7373
},
7474
"wopiValidatorTests": {
75-
"skip": False,
75+
"skip": True,
7676
},
7777
"k6LoadTests": {
78-
"skip": False,
78+
"skip": True,
7979
},
8080
"localApiTests": {
8181
"basic": {
@@ -89,13 +89,13 @@ config = {
8989
"apiLocks",
9090
"apiActivities",
9191
],
92-
"skip": False,
92+
"skip": True,
9393
},
9494
"settings": {
9595
"suites": [
9696
"apiSettings",
9797
],
98-
"skip": False,
98+
"skip": True,
9999
"withRemotePhp": [True],
100100
"emailNeeded": True,
101101
"extraEnvironment": {
@@ -116,69 +116,69 @@ config = {
116116
"apiGraph",
117117
"apiServiceAvailability",
118118
],
119-
"skip": False,
119+
"skip": True,
120120
"withRemotePhp": [True],
121121
},
122122
"graphUserGroup": {
123123
"suites": [
124124
"apiGraphUserGroup",
125125
],
126-
"skip": False,
126+
"skip": True,
127127
"withRemotePhp": [True],
128128
},
129129
"spaces": {
130130
"suites": [
131131
"apiSpaces",
132132
],
133-
"skip": False,
133+
"skip": True,
134134
},
135135
"spacesShares": {
136136
"suites": [
137137
"apiSpacesShares",
138138
],
139-
"skip": False,
139+
"skip": True,
140140
},
141141
"spacesDavOperation": {
142142
"suites": [
143143
"apiSpacesDavOperation",
144144
],
145-
"skip": False,
145+
"skip": True,
146146
},
147147
"search1": {
148148
"suites": [
149149
"apiSearch1",
150150
],
151-
"skip": False,
151+
"skip": True,
152152
},
153153
"search2": {
154154
"suites": [
155155
"apiSearch2",
156156
],
157-
"skip": False,
157+
"skip": True,
158158
},
159159
"sharingNg": {
160160
"suites": [
161161
"apiReshare",
162162
"apiSharingNg1",
163163
"apiSharingNg2",
164164
],
165-
"skip": False,
165+
"skip": True,
166166
},
167167
"sharingNgShareInvitation": {
168168
"suites": [
169169
"apiSharingNgShareInvitation",
170170
],
171-
"skip": False,
171+
"skip": True,
172172
},
173173
"sharingNgLinkShare": {
174174
"suites": [
175175
"apiSharingNgLinkSharePermission",
176176
"apiSharingNgLinkShareRoot",
177177
],
178-
"skip": False,
178+
"skip": True,
179179
},
180180
"accountsHashDifficulty": {
181-
"skip": False,
181+
"skip": True,
182182
"suites": [
183183
"apiAccountsHashDifficulty",
184184
],
@@ -208,7 +208,7 @@ config = {
208208
"suites": [
209209
"apiAntivirus",
210210
],
211-
"skip": False,
211+
"skip": True,
212212
"antivirusNeeded": True,
213213
"extraServerEnvironment": {
214214
"ANTIVIRUS_SCANNER_TYPE": "clamav",
@@ -223,14 +223,14 @@ config = {
223223
"suites": [
224224
"apiSearchContent",
225225
],
226-
"skip": False,
226+
"skip": True,
227227
"tikaNeeded": True,
228228
},
229229
"ocm": {
230230
"suites": [
231231
"apiOcm",
232232
],
233-
"skip": False,
233+
"skip": True,
234234
"withRemotePhp": [True],
235235
"federationServer": True,
236236
"emailNeeded": True,
@@ -256,7 +256,7 @@ config = {
256256
"suites": [
257257
"apiCollaboration",
258258
],
259-
"skip": False,
259+
"skip": True,
260260
"collaborationServiceNeeded": True,
261261
"extraServerEnvironment": {
262262
"GATEWAY_GRPC_ADDR": "0.0.0.0:9142",
@@ -266,7 +266,7 @@ config = {
266266
"suites": [
267267
"apiAuthApp",
268268
],
269-
"skip": False,
269+
"skip": True,
270270
"withRemotePhp": [True],
271271
"extraServerEnvironment": {
272272
"OCIS_ADD_RUN_SERVICES": "auth-app",
@@ -300,24 +300,24 @@ config = {
300300
},
301301
"apiTests": {
302302
"numberOfParts": 7,
303-
"skip": False,
303+
"skip": True,
304304
"skipExceptParts": [],
305305
},
306306
"e2eTests": {
307307
"part": {
308-
"skip": False,
308+
"skip": True,
309309
"totalParts": 4, # divide and run all suites in parts (divide pipelines)
310310
"xsuites": ["search", "app-provider", "oidc", "ocm"], # suites to skip
311311
},
312312
"search": {
313-
"skip": False,
313+
"skip": True,
314314
"suites": ["search"], # suites to run
315315
"tikaNeeded": True,
316316
},
317317
},
318318
"e2eMultiService": {
319319
"testSuites": {
320-
"skip": False,
320+
"skip": True,
321321
"suites": [
322322
"smoke",
323323
"shares",

tests/acceptance/bootstrap/SpacesContext.php

+52-23
Original file line numberDiff line numberDiff line change
@@ -2659,29 +2659,7 @@ public function userExpiresTheLastShareOfResourceInsideOfTheSpace(
26592659
string $resource,
26602660
string $spaceName
26612661
): void {
2662-
$dateTime = new DateTime('yesterday');
2663-
$rows['expireDate'] = $dateTime->format('Y-m-d\\TH:i:sP');
2664-
if ($this->featureContext->isUsingSharingNG()) {
2665-
$space = $this->getSpaceByName($user, $spaceName);
2666-
$itemId = $this->getResourceId($user, $spaceName, $resource);
2667-
$body['expirationDateTime'] = $rows['expireDate'];
2668-
$permissionID = $this->featureContext->shareNgGetLastCreatedUserGroupShareID();
2669-
$this->featureContext->setResponse(
2670-
GraphHelper::updateShare(
2671-
$this->featureContext->getBaseUrl(),
2672-
$this->featureContext->getStepLineRef(),
2673-
$user,
2674-
$this->featureContext->getPasswordForUser($user),
2675-
$space["id"],
2676-
$itemId,
2677-
\json_encode($body),
2678-
$permissionID
2679-
)
2680-
);
2681-
} else {
2682-
$rows['permissions'] = (string)$this->featureContext->getLastCreatedUserGroupShare()->permissions;
2683-
$this->featureContext->setResponse($this->updateSharedResource($user, $rows));
2684-
}
2662+
$this->featureContext->setResponse($this->expireResourceShare($user, $resource, $spaceName));
26852663
}
26862664

26872665
/**
@@ -4781,4 +4759,55 @@ public function userHasUpdatedTheSpaceWithSettings(
47814759
$response = $this->shareSpace($user, $spaceName, $rows);
47824760
$this->featureContext->theHTTPStatusCodeShouldBe(200, "", $response);
47834761
}
4762+
4763+
/**
4764+
* @param string $user
4765+
* @param string $resource
4766+
* @param string $spaceName
4767+
*
4768+
* @return ResponseInterface
4769+
* @throws GuzzleException|JsonException
4770+
*/
4771+
public function expireResourceShare(string $user, string $resource, string $spaceName): ResponseInterface {
4772+
$dateTime = new DateTime('yesterday');
4773+
$rows['expireDate'] = $dateTime->format('Y-m-d\\TH:i:sP');
4774+
if ($this->featureContext->isUsingSharingNG()) {
4775+
$space = $this->getSpaceByName($user, $spaceName);
4776+
$itemId = $this->getResourceId($user, $spaceName, $resource);
4777+
$body['expirationDateTime'] = $rows['expireDate'];
4778+
$permissionID = $this->featureContext->shareNgGetLastCreatedUserGroupShareID();
4779+
return GraphHelper::updateShare(
4780+
$this->featureContext->getBaseUrl(),
4781+
$this->featureContext->getStepLineRef(),
4782+
$user,
4783+
$this->featureContext->getPasswordForUser($user),
4784+
$space["id"],
4785+
$itemId,
4786+
\json_encode($body),
4787+
$permissionID
4788+
);
4789+
} else {
4790+
$rows['permissions'] = (string)$this->featureContext->getLastCreatedUserGroupShare()->permissions;
4791+
return $this->updateSharedResource($user, $rows);
4792+
}
4793+
}
4794+
4795+
/**
4796+
* @Given user :user has expired the last share of resource :resource inside of the space :spaceName
4797+
*
4798+
* @param string $user
4799+
* @param string $resource
4800+
* @param string $spaceName
4801+
*
4802+
* @return void
4803+
* @throws GuzzleException|JsonException
4804+
*/
4805+
public function userHasExpiredTheLastShareOfResourceInsideOfTheSpace(
4806+
string $user,
4807+
string $resource,
4808+
string $spaceName
4809+
): void {
4810+
$response = $this->expireResourceShare($user, $resource, $spaceName);
4811+
$this->featureContext->theHTTPStatusCodeShouldBe(200, "", $response);
4812+
}
47844813
}

0 commit comments

Comments
 (0)