Commit 45d9a3ae authored by Vincent Petry's avatar Vincent Petry Committed by Thomas Müller
Browse files

Fix ocs expectation (#27099)

* Fix OCS status code expectation in int test

* OCSController must set both status codes

Set both the HTTP status code and the OCS status code.

* Run one set of integration tests on PRs
parent 39d143c9
......@@ -126,25 +126,26 @@ timestampedNode('SLAVE') {
'''
}
if (isOnReleaseBranch()) {
stage 'Integration Testing'
executeAndReport('build/integration/output/*.xml') {
sh '''phpenv local 7.0
rm -rf config/config.php data/*
./occ maintenance:install --admin-pass=admin
make clean-test-integration
make test-integration
'''
}
executeAndReport('build/integration/output/*.xml') {
sh '''phpenv local 7.0
rm -rf config/config.php data/*
./occ maintenance:install --admin-pass=admin
make clean-test-integration
make test-integration OC_TEST_ALT_HOME=1
'''
}
stage 'Integration Testing'
executeAndReport('build/integration/output/*.xml') {
sh '''phpenv local 7.0
rm -rf config/config.php data/*
./occ maintenance:install --admin-pass=admin
make clean-test-integration
make test-integration
'''
}
if (isOnReleaseBranch()) {
executeAndReport('build/integration/output/*.xml') {
sh '''phpenv local 7.0
rm -rf config/config.php data/*
./occ maintenance:install --admin-pass=admin
make clean-test-integration
make test-integration OC_TEST_ALT_HOME=1
'''
}
executeAndReport('build/integration/output/*.xml') {
sh '''phpenv local 7.0
rm -rf config/config.php data/*
......@@ -161,7 +162,7 @@ timestampedNode('SLAVE') {
make test-integration OC_TEST_ALT_HOME=1 OC_TEST_ENCRYPTION_ENABLED=1
'''
}
}
}
}
def isOnReleaseBranch () {
......
......@@ -169,7 +169,7 @@ Feature: sharees_provisioningapiv2
When getting sharees for
| search | shareegroup |
| itemType | file |
Then the OCS status code should be "100"
Then the OCS status code should be "200"
And the HTTP status code should be "200"
Then "exact users" sharees returned is empty
Then "users" sharees returned is empty
......
......@@ -122,6 +122,9 @@ abstract class OCSController extends ApiController {
if (substr($script, -11) === '/ocs/v2.php') {
$statusCode = \OC_API::mapStatusCodes($resp->getStatusCode());
if (!is_null($statusCode)) {
// HTTP code
$resp->setStatus($statusCode);
// OCS code
$resp->setStatusCode($statusCode);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment