Skip to content

Commit 005a2fc

Browse files
nickvergessenblizzz
authored andcommitted
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>
1 parent 292d454 commit 005a2fc

File tree

8 files changed

+47
-136
lines changed

8 files changed

+47
-136
lines changed

.drone.yml

Lines changed: 37 additions & 126 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ steps:
4646
- cd tests/unit/
4747
- phpunit --configuration phpunit.xml
4848
- name: php7.3
49-
image: nextcloudci/php7.3:php7.3-1
49+
image: nextcloudci/php7.3:php7.3-5
5050
environment:
5151
APP_NAME: user_saml
5252
CORE_BRANCH: master
@@ -81,137 +81,48 @@ trigger:
8181
event:
8282
- pull_request
8383
- push
84-
85-
---
86-
kind: pipeline
87-
name: tests-17
88-
89-
clone:
90-
depth: 1
91-
92-
steps:
93-
- name: php7.2-stable17
94-
image: nextcloudci/php7.2:php7.2-13
95-
environment:
96-
APP_NAME: user_saml
97-
CORE_BRANCH: stable17
98-
DB: sqlite
99-
commands:
100-
- wget https://raw.githubusercontent.com/nextcloud/travis_ci/master/before_install.sh
101-
- bash ./before_install.sh $APP_NAME $CORE_BRANCH $DB
102-
- cd ../server/apps/$APP_NAME
103-
- cd tests/unit/
104-
- phpunit --configuration phpunit.xml
105-
- name: integration-tests-stable16
106-
image: nextcloudci/user_saml_shibboleth-php7.2:user_saml_shibboleth_php7.2-2
107-
environment:
108-
CORE_BRANCH: stable17
109-
commands:
110-
- sed -i 's_/etc/init.d/jetty run \&_sleep 4 \&\& /etc/init.d/jetty run \&_' /start.sh
111-
- /start.sh &
112-
- sleep 7
113-
- rm -rf /var/www/html
114-
- cd /var/www/
115-
- git clone --depth 1 -b $CORE_BRANCH https://github.com/nextcloud/server html
116-
- cd /var/www/html && git submodule update --init
117-
# use local clone
118-
- cp -r /drone/src /var/www/html/apps/user_saml
119-
- 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'"
120-
- chown -R apache:apache /var/www/html/
121-
- scl enable rh-php72 "bash -c 'cd /var/www/html/apps/user_saml/tests/integration && vendor/bin/behat'"
122-
123-
trigger:
124-
branch:
125-
- master
126-
event:
127-
- pull_request
128-
- push
129-
13084
---
13185
kind: pipeline
132-
name: tests-16
86+
name: tests-18
13387

13488
clone:
135-
depth: 1
89+
depth: 1
13690

13791
steps:
138-
- name: php7.1-stable16
139-
image: nextcloudci/php7.1:php7.1-16
140-
environment:
141-
APP_NAME: user_saml
142-
CORE_BRANCH: stable16
143-
DB: sqlite
144-
commands:
145-
- wget https://raw.githubusercontent.com/nextcloud/travis_ci/master/before_install.sh
146-
- bash ./before_install.sh $APP_NAME $CORE_BRANCH $DB
147-
- cd ../server/apps/$APP_NAME
148-
- cd tests/unit/
149-
- phpunit --configuration phpunit.xml
150-
- name: integration-tests-stable16
151-
image: nextcloudci/user_saml_shibboleth-php7.2:user_saml_shibboleth_php7.2-2
152-
environment:
153-
CORE_BRANCH: stable16
154-
commands:
155-
- sed -i 's_/etc/init.d/jetty run \&_sleep 4 \&\& /etc/init.d/jetty run \&_' /start.sh
156-
- /start.sh &
157-
- sleep 7
158-
- rm -rf /var/www/html
159-
- cd /var/www/
160-
- git clone --depth 1 -b $CORE_BRANCH https://github.com/nextcloud/server html
161-
- cd /var/www/html && git submodule update --init
162-
# use local clone
163-
- cp -r /drone/src /var/www/html/apps/user_saml
164-
- 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'"
165-
- chown -R apache:apache /var/www/html/
166-
- scl enable rh-php72 "bash -c 'cd /var/www/html/apps/user_saml/tests/integration && vendor/bin/behat'"
92+
- name: php7.3-stable18
93+
image: nextcloudci/php7.3:php7.3-5
94+
environment:
95+
APP_NAME: user_saml
96+
CORE_BRANCH: stable18
97+
DB: sqlite
98+
commands:
99+
- wget https://raw.githubusercontent.com/nextcloud/travis_ci/master/before_install.sh
100+
- bash ./before_install.sh $APP_NAME $CORE_BRANCH $DB
101+
- cd ../server/apps/$APP_NAME
102+
- cd tests/unit/
103+
- phpunit --configuration phpunit.xml
104+
- name: integration-tests-stable18
105+
image: nextcloudci/user_saml_shibboleth-php7.2:user_saml_shibboleth_php7.2-2
106+
environment:
107+
CORE_BRANCH: stable18
108+
commands:
109+
- sed -i 's_/etc/init.d/jetty run \&_sleep 4 \&\& /etc/init.d/jetty run \&_' /start.sh
110+
- /start.sh &
111+
- sleep 7
112+
- rm -rf /var/www/html
113+
- cd /var/www/
114+
- git clone --depth 1 -b $CORE_BRANCH https://github.com/nextcloud/server html
115+
- cd /var/www/html && git submodule update --init
116+
# use local clone
117+
- cp -r /drone/src /var/www/html/apps/user_saml
118+
- 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'"
119+
- chown -R apache:apache /var/www/html/
120+
- scl enable rh-php72 "bash -c 'cd /var/www/html/apps/user_saml/tests/integration && vendor/bin/behat'"
167121

168122
trigger:
169-
branch:
170-
- master
171-
event:
172-
- pull_request
173-
- push
174-
175-
---
176-
kind: pipeline
177-
name: tests-15
178-
179-
clone:
180-
depth: 1
181-
182-
steps:
183-
- name: php7.0-stable15
184-
image: nextcloudci/php7.0:php7.0-19
185-
environment:
186-
APP_NAME: user_saml
187-
CORE_BRANCH: stable15
188-
DB: sqlite
189-
commands:
190-
- wget https://raw.githubusercontent.com/nextcloud/travis_ci/master/before_install.sh
191-
- bash ./before_install.sh $APP_NAME $CORE_BRANCH $DB
192-
- cd ../server/apps/$APP_NAME
193-
- cd tests/unit/
194-
- phpunit --configuration phpunit.xml
195-
- name: integration-tests-stable15
196-
image: nextcloudci/user_saml_shibboleth-php7:user_saml_shibboleth_php7-5
197-
environment:
198-
CORE_BRANCH: stable15
199-
commands:
200-
- /start.sh &
201-
- sleep 3
202-
- rm -rf /var/www/html
203-
- cd /var/www/
204-
- git clone --depth 1 -b $CORE_BRANCH https://github.com/nextcloud/server html
205-
- cd /var/www/html && git submodule update --init
206-
# use local clone
207-
- cp -r /drone/src /var/www/html/apps/user_saml
208-
- 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'"
209-
- chown -R apache:apache /var/www/html/
210-
- scl enable rh-php70 "bash -c 'cd /var/www/html/apps/user_saml/tests/integration && vendor/bin/behat'"
123+
branch:
124+
- master
125+
event:
126+
- pull_request
127+
- push
211128

212-
trigger:
213-
branch:
214-
- master
215-
event:
216-
- pull_request
217-
- push

appinfo/info.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ While theoretically any other authentication provider implementing either one of
3333
<screenshot>https://raw.githubusercontent.com/nextcloud/user_saml/master/screenshots/1.png</screenshot>
3434
<screenshot>https://raw.githubusercontent.com/nextcloud/user_saml/master/screenshots/2.png</screenshot>
3535
<dependencies>
36-
<nextcloud min-version="15" max-version="18" />
36+
<nextcloud min-version="18" max-version="18" />
3737
</dependencies>
3838
<settings>
3939
<admin>OCA\User_SAML\Settings\Admin</admin>

tests/unit/AppInfo/ApplicationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class ApplicationTest extends \Test\TestCase {
3434
/** @var \OCP\AppFramework\IAppContainer */
3535
protected $container;
3636

37-
protected function setUp() {
37+
protected function setUp(): void {
3838
parent::setUp();
3939
$this->app = new Application();
4040
$this->container = $this->app->getContainer();

tests/unit/Controller/SAMLControllerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class SAMLControllerTest extends TestCase {
6161
/** @var SAMLController */
6262
private $samlController;
6363

64-
public function setUp() {
64+
protected function setUp(): void {
6565
parent::setUp();
6666

6767
$this->request = $this->createMock(IRequest::class);

tests/unit/Middleware/OnlyLoggedInMiddlewareTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ class OnlyLoggedInMiddlewareTest extends \Test\TestCase {
3535
/** @var OnlyLoggedInMiddleware */
3636
private $onlyLoggedInMiddleware;
3737

38-
public function setUp() {
38+
protected function setUp(): void {
3939
$this->reflector = $this->createMock(IControllerMethodReflector::class);
4040
$this->userSession = $this->createMock(IUserSession::class);
4141
$this->onlyLoggedInMiddleware = new OnlyLoggedInMiddleware(
4242
$this->reflector,
4343
$this->userSession
4444
);
4545

46-
return parent::setUp();
46+
parent::setUp();
4747
}
4848

4949
public function testBeforeControllerWithoutAnnotation() {

tests/unit/Settings/AdminTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class AdminTest extends \Test\TestCase {
3737
/** @var IConfig|\PHPUnit_Framework_MockObject_MockObject */
3838
private $config;
3939

40-
public function setUp() {
40+
protected function setUp(): void {
4141
$this->l10n = $this->createMock(IL10N::class);
4242
$this->defaults = $this->createMock(Defaults::class);
4343
$this->config = $this->createMock(IConfig::class);
@@ -48,7 +48,7 @@ public function setUp() {
4848
$this->config
4949
);
5050

51-
return parent::setUp();
51+
parent::setUp();
5252
}
5353

5454
public function formDataProvider() {

tests/unit/Settings/SectionTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ class SectionTest extends \Test\TestCase {
3232
/** @var IURLGenerator|\PHPUnit_Framework_MockObject_MockObject */
3333
private $urlGenerator;
3434

35-
public function setUp() {
35+
protected function setUp(): void {
3636
$this->l10n = $this->createMock(\OCP\IL10N::class);
3737
$this->urlGenerator = $this->createMock(IURLGenerator::class);
3838
$this->section = new \OCA\User_SAML\Settings\Section(
3939
$this->l10n,
4040
$this->urlGenerator
4141
);
4242

43-
return parent::setUp();
43+
parent::setUp();
4444
}
4545

4646
public function testGetId() {

tests/unit/UserBackendTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class UserBackendTest extends TestCase {
5454
/** @var \PHPUnit_Framework_MockObject_MockObject|ILogger */
5555
private $logger;
5656

57-
public function setUp() {
57+
protected function setUp(): void {
5858
parent::setUp();
5959

6060
$this->config = $this->createMock(IConfig::class);

0 commit comments

Comments
 (0)