Skip to content

Commit

Permalink
updated stable and master commit
Browse files Browse the repository at this point in the history
  • Loading branch information
S-Panta committed Apr 24, 2024
1 parent 157477a commit 5c759e7
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .drone.env
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# The version of OCIS to use in pipelines that test against OCIS
OCIS_COMMITID=2a300190cbccb2b4a93b7aa76abe4f204fb393bf
OCIS_COMMITID=c2ab6666a5b9bbba899fdf9486f8d9bae6bc12b4
OCIS_BRANCH=master
OCIS_STABLE_COMMITID=b8149ede7db9d510e1988ca9fdfe51fd44e7d603
OCIS_STABLE_COMMITID=08c6f41fc8a965b1a1dc83045b673ce1bdfc000e
OCIS_STABLE_BRANCH=stable-5.0
11 changes: 8 additions & 3 deletions .drone.star
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def behattest():
"depends_on": [],
"steps":generateSSLCert() + apacheService() + waitForService("apache",443) + runOcis(branch) + \
waitForService("ocis",9200) + databaseService() + waitForService("postgresql",5432) + \
seleniumService() + waitForService("selenium",4444) + setupMoodle() + runBehatTest() ,
seleniumService() + waitForService("selenium",4444) + setupMoodle() + runBehatTest(branch) ,
"volumes": [
{
"name":"www-moodle",
Expand Down Expand Up @@ -393,7 +393,12 @@ def seleniumService():
}
]

def runBehatTest():
def runBehatTest(branch):
ocis_branch = getBranchName(branch)
if ocis_branch == "stable-5.0":
tags = "@ocis&&~@skipOnStable"
else:
tags = "@ocis"
return [
{
"name":"behat-test",
Expand All @@ -402,7 +407,7 @@ def runBehatTest():
"commands": [
"update-ca-certificates",
"cd /var/www/html/moodle",
"vendor/bin/behat --config /var/www/behatdata/behatrun/behat/behat.yml --tags=@ocis",
"vendor/bin/behat --config /var/www/behatdata/behatrun/behat/behat.yml --tags=%s" %tags,
],
"volumes":[
{
Expand Down
11 changes: 5 additions & 6 deletions tests/behat/behat_repository_ocis.php
Original file line number Diff line number Diff line change
Expand Up @@ -372,14 +372,13 @@ public function user_has_sent_the_following_share_invitation(string $user, Table
* @When user :user disables sync of share :share
*
* @param string $user
* @param string $share
*
* @throws Exception
*/
public function user_disables_sync_of_share(string $user, string $share) {
$response = $this->graphhelper->disable_share_sync($user, $share);
if ($response['statusCode'] !== 204) {
throw new Exception("Error disabling sync of share ");
public function user_disables_sync_of_share(string $user) {
$response = $this->graphhelper->disable_share_sync($user);
if ((!in_array($response['statusCode'], [200, 204]))) {
throw new Exception("Error disabling sync of share " . var_dump($response['statusCode']));
}
}

Expand All @@ -397,7 +396,7 @@ public function user_disables_sync_of_share(string $user, string $share) {
public function user_enables_sync_of_share(string $user, string $share, string $offeredby, string $space) {
$response = $this->graphhelper->enable_share_sync($user, $share, $offeredby, $space);
if ($response['statusCode'] !== 201) {
throw new Exception("Error enabling synv of share");
throw new Exception("Error enabling sync of share");
}
}
}
10 changes: 5 additions & 5 deletions tests/behat/graph_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -287,14 +287,14 @@ public function disable_share_sync(string $user): array {

/**
* send request to disable sync of share
* @param $user
* @param $share
* @param $offeredby
* @param $space
* @param string $user
* @param string $share
* @param string $offeredby
* @param string $space
*
* @return array
*/
public function enable_share_sync($user, $share, $offeredby, $space): array {
public function enable_share_sync(string $user, string $share, string $offeredby, string $space): array {
$itemid = $this->get_resource_id($offeredby, $share, $space);
$body = [
"remoteItem" => [
Expand Down
1 change: 1 addition & 0 deletions tests/behat/uploadFileToMoodle.feature
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ Feature: upload the resource in oCIS to moodle
And I click on "Select this file" "button"
Then I should see "testfile.txt"

@skipOnStable
Scenario: enable/disable sync of shared resource shared from Personal Space
Given user "Brian" has been created with default attributes
And user "Brian" has uploaded a file inside space "Personal" with content "some content" to "/testfile.txt"
Expand Down

0 comments on commit 5c759e7

Please sign in to comment.