Update supported versions and CI

Signed-off-by: Joas Schilling <coding@schilljs.com>

Fix unit tests

Signed-off-by: Joas Schilling <coding@schilljs.com>

adjust CI config

- NC 15 is EOL
- integration tests need PHP 7.3

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>

add test pipeline for NC 18

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>

go for 18 only

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
This commit is contained in:
Joas Schilling 2019-12-05 13:29:17 +01:00 committed by Arthur Schiwon
parent 292d454e59
commit 005a2fc845
No known key found for this signature in database
GPG key ID: 7424F1874854DF23
8 changed files with 47 additions and 136 deletions

View file

@ -46,7 +46,7 @@ steps:
- cd tests/unit/
- phpunit --configuration phpunit.xml
- name: php7.3
image: nextcloudci/php7.3:php7.3-1
image: nextcloudci/php7.3:php7.3-5
environment:
APP_NAME: user_saml
CORE_BRANCH: master
@ -81,137 +81,48 @@ trigger:
event:
- pull_request
- push
---
kind: pipeline
name: tests-17
name: tests-18
clone:
depth: 1
depth: 1
steps:
- name: php7.2-stable17
image: nextcloudci/php7.2:php7.2-13
environment:
APP_NAME: user_saml
CORE_BRANCH: stable17
DB: sqlite
commands:
- wget https://raw.githubusercontent.com/nextcloud/travis_ci/master/before_install.sh
- bash ./before_install.sh $APP_NAME $CORE_BRANCH $DB
- cd ../server/apps/$APP_NAME
- cd tests/unit/
- phpunit --configuration phpunit.xml
- name: integration-tests-stable16
image: nextcloudci/user_saml_shibboleth-php7.2:user_saml_shibboleth_php7.2-2
environment:
CORE_BRANCH: stable17
commands:
- sed -i 's_/etc/init.d/jetty run \&_sleep 4 \&\& /etc/init.d/jetty run \&_' /start.sh
- /start.sh &
- sleep 7
- rm -rf /var/www/html
- cd /var/www/
- git clone --depth 1 -b $CORE_BRANCH https://github.com/nextcloud/server html
- cd /var/www/html && git submodule update --init
# use local clone
- cp -r /drone/src /var/www/html/apps/user_saml
- scl enable rh-php72 "bash -c 'php /var/www/html/occ maintenance:install --database sqlite --admin-pass password; php /var/www/html/occ app:enable user_saml'"
- chown -R apache:apache /var/www/html/
- scl enable rh-php72 "bash -c 'cd /var/www/html/apps/user_saml/tests/integration && vendor/bin/behat'"
- name: php7.3-stable18
image: nextcloudci/php7.3:php7.3-5
environment:
APP_NAME: user_saml
CORE_BRANCH: stable18
DB: sqlite
commands:
- wget https://raw.githubusercontent.com/nextcloud/travis_ci/master/before_install.sh
- bash ./before_install.sh $APP_NAME $CORE_BRANCH $DB
- cd ../server/apps/$APP_NAME
- cd tests/unit/
- phpunit --configuration phpunit.xml
- name: integration-tests-stable18
image: nextcloudci/user_saml_shibboleth-php7.2:user_saml_shibboleth_php7.2-2
environment:
CORE_BRANCH: stable18
commands:
- sed -i 's_/etc/init.d/jetty run \&_sleep 4 \&\& /etc/init.d/jetty run \&_' /start.sh
- /start.sh &
- sleep 7
- rm -rf /var/www/html
- cd /var/www/
- git clone --depth 1 -b $CORE_BRANCH https://github.com/nextcloud/server html
- cd /var/www/html && git submodule update --init
# use local clone
- cp -r /drone/src /var/www/html/apps/user_saml
- scl enable rh-php72 "bash -c 'php /var/www/html/occ maintenance:install --database sqlite --admin-pass password; php /var/www/html/occ app:enable user_saml'"
- chown -R apache:apache /var/www/html/
- scl enable rh-php72 "bash -c 'cd /var/www/html/apps/user_saml/tests/integration && vendor/bin/behat'"
trigger:
branch:
- master
event:
- pull_request
- push
branch:
- master
event:
- pull_request
- push
---
kind: pipeline
name: tests-16
clone:
depth: 1
steps:
- name: php7.1-stable16
image: nextcloudci/php7.1:php7.1-16
environment:
APP_NAME: user_saml
CORE_BRANCH: stable16
DB: sqlite
commands:
- wget https://raw.githubusercontent.com/nextcloud/travis_ci/master/before_install.sh
- bash ./before_install.sh $APP_NAME $CORE_BRANCH $DB
- cd ../server/apps/$APP_NAME
- cd tests/unit/
- phpunit --configuration phpunit.xml
- name: integration-tests-stable16
image: nextcloudci/user_saml_shibboleth-php7.2:user_saml_shibboleth_php7.2-2
environment:
CORE_BRANCH: stable16
commands:
- sed -i 's_/etc/init.d/jetty run \&_sleep 4 \&\& /etc/init.d/jetty run \&_' /start.sh
- /start.sh &
- sleep 7
- rm -rf /var/www/html
- cd /var/www/
- git clone --depth 1 -b $CORE_BRANCH https://github.com/nextcloud/server html
- cd /var/www/html && git submodule update --init
# use local clone
- cp -r /drone/src /var/www/html/apps/user_saml
- scl enable rh-php72 "bash -c 'php /var/www/html/occ maintenance:install --database sqlite --admin-pass password; php /var/www/html/occ app:enable user_saml'"
- chown -R apache:apache /var/www/html/
- scl enable rh-php72 "bash -c 'cd /var/www/html/apps/user_saml/tests/integration && vendor/bin/behat'"
trigger:
branch:
- master
event:
- pull_request
- push
---
kind: pipeline
name: tests-15
clone:
depth: 1
steps:
- name: php7.0-stable15
image: nextcloudci/php7.0:php7.0-19
environment:
APP_NAME: user_saml
CORE_BRANCH: stable15
DB: sqlite
commands:
- wget https://raw.githubusercontent.com/nextcloud/travis_ci/master/before_install.sh
- bash ./before_install.sh $APP_NAME $CORE_BRANCH $DB
- cd ../server/apps/$APP_NAME
- cd tests/unit/
- phpunit --configuration phpunit.xml
- name: integration-tests-stable15
image: nextcloudci/user_saml_shibboleth-php7:user_saml_shibboleth_php7-5
environment:
CORE_BRANCH: stable15
commands:
- /start.sh &
- sleep 3
- rm -rf /var/www/html
- cd /var/www/
- git clone --depth 1 -b $CORE_BRANCH https://github.com/nextcloud/server html
- cd /var/www/html && git submodule update --init
# use local clone
- cp -r /drone/src /var/www/html/apps/user_saml
- scl enable rh-php70 "bash -c 'php /var/www/html/occ maintenance:install --database sqlite --admin-pass password; php /var/www/html/occ app:enable user_saml'"
- chown -R apache:apache /var/www/html/
- scl enable rh-php70 "bash -c 'cd /var/www/html/apps/user_saml/tests/integration && vendor/bin/behat'"
trigger:
branch:
- master
event:
- pull_request
- push

View file

@ -33,7 +33,7 @@ While theoretically any other authentication provider implementing either one of
<screenshot>https://raw.githubusercontent.com/nextcloud/user_saml/master/screenshots/1.png</screenshot>
<screenshot>https://raw.githubusercontent.com/nextcloud/user_saml/master/screenshots/2.png</screenshot>
<dependencies>
<nextcloud min-version="15" max-version="18" />
<nextcloud min-version="18" max-version="18" />
</dependencies>
<settings>
<admin>OCA\User_SAML\Settings\Admin</admin>

View file

@ -34,7 +34,7 @@ class ApplicationTest extends \Test\TestCase {
/** @var \OCP\AppFramework\IAppContainer */
protected $container;
protected function setUp() {
protected function setUp(): void {
parent::setUp();
$this->app = new Application();
$this->container = $this->app->getContainer();

View file

@ -61,7 +61,7 @@ class SAMLControllerTest extends TestCase {
/** @var SAMLController */
private $samlController;
public function setUp() {
protected function setUp(): void {
parent::setUp();
$this->request = $this->createMock(IRequest::class);

View file

@ -35,7 +35,7 @@ class OnlyLoggedInMiddlewareTest extends \Test\TestCase {
/** @var OnlyLoggedInMiddleware */
private $onlyLoggedInMiddleware;
public function setUp() {
protected function setUp(): void {
$this->reflector = $this->createMock(IControllerMethodReflector::class);
$this->userSession = $this->createMock(IUserSession::class);
$this->onlyLoggedInMiddleware = new OnlyLoggedInMiddleware(
@ -43,7 +43,7 @@ class OnlyLoggedInMiddlewareTest extends \Test\TestCase {
$this->userSession
);
return parent::setUp();
parent::setUp();
}
public function testBeforeControllerWithoutAnnotation() {

View file

@ -37,7 +37,7 @@ class AdminTest extends \Test\TestCase {
/** @var IConfig|\PHPUnit_Framework_MockObject_MockObject */
private $config;
public function setUp() {
protected function setUp(): void {
$this->l10n = $this->createMock(IL10N::class);
$this->defaults = $this->createMock(Defaults::class);
$this->config = $this->createMock(IConfig::class);
@ -48,7 +48,7 @@ class AdminTest extends \Test\TestCase {
$this->config
);
return parent::setUp();
parent::setUp();
}
public function formDataProvider() {

View file

@ -32,7 +32,7 @@ class SectionTest extends \Test\TestCase {
/** @var IURLGenerator|\PHPUnit_Framework_MockObject_MockObject */
private $urlGenerator;
public function setUp() {
protected function setUp(): void {
$this->l10n = $this->createMock(\OCP\IL10N::class);
$this->urlGenerator = $this->createMock(IURLGenerator::class);
$this->section = new \OCA\User_SAML\Settings\Section(
@ -40,7 +40,7 @@ class SectionTest extends \Test\TestCase {
$this->urlGenerator
);
return parent::setUp();
parent::setUp();
}
public function testGetId() {

View file

@ -54,7 +54,7 @@ class UserBackendTest extends TestCase {
/** @var \PHPUnit_Framework_MockObject_MockObject|ILogger */
private $logger;
public function setUp() {
protected function setUp(): void {
parent::setUp();
$this->config = $this->createMock(IConfig::class);