Skip to content

Commit 42f8b0b

Browse files
committed
Merge branch 'main' into simonLeary42-patch-3
2 parents e9466f3 + 5a92fdb commit 42f8b0b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+918
-220
lines changed

.github/workflows/functional.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: docker-compose-phpunit-functional
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [main]
7+
8+
jobs:
9+
docker-compose-phpunit-functional:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
- name: setup PHP
14+
uses: shivammathur/setup-php@v2
15+
with:
16+
php-version: "8.3"
17+
tools: composer
18+
- name: install composer dependencies
19+
run: composer update
20+
- name: Run docker compose
21+
uses: hoverkraft-tech/[email protected]
22+
with:
23+
compose-file: "./tools/docker-dev/docker-compose.yml"
24+
- name: Execute tests in the running services
25+
run: docker compose -f ./tools/docker-dev/docker-compose.yml exec -w '/var/www/unity-web-portal' web ./vendor/bin/phpunit --testsuite=functional

.github/workflows/lint.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.

.github/workflows/phpunit.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,14 @@ jobs:
77
runs-on: ubuntu-latest
88
steps:
99
- uses: actions/checkout@v3
10-
- uses: php-actions/composer@v6
11-
- uses: php-actions/phpunit@v3
10+
- name: setup PHP
11+
uses: shivammathur/setup-php@v2
12+
with:
13+
php-version: "8.3"
14+
# php extensions also listed in tools/docker-dev/web/Dockerfile
15+
extensions: curl,mysql,ldap,pdo,redis
16+
tools: composer:v2
17+
- name: Install dependencies
18+
run: composer install --prefer-dist --no-progress
19+
- name: Run PHPUnit tests
20+
run: vendor/bin/phpunit --colors=always --testsuite unit

.github/workflows/pre-commit.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: pre-commit
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [main]
7+
8+
jobs:
9+
pre-commit:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
- uses: actions/setup-python@v3
14+
- name: setup PHP
15+
uses: shivammathur/setup-php@v2
16+
with:
17+
php-version: "8.3"
18+
tools: composer, phpcs, phpcbf
19+
- uses: pre-commit/[email protected]

.pre-commit-config.yaml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,7 @@
22
# pre-commit automatically excludes submodules
33
exclude: |
44
(?x)^(
5-
.*\.dist|
6-
roles/ood-head/files/auto-copy/var/www/ood/apps/common/common_attributes.yml|
7-
roles/ood-head/files/auto-copy/var/www/ood/apps/sys/dashboard/config/locales/en.yml|
8-
inventory.d/ipv4.py|
9-
files/shibboleth/filtered-incommon-metadata.xml.j2|
5+
test/.*|
106
)$
117
128
repos:
@@ -46,3 +42,9 @@ repos:
4642
language: system
4743
files: \.php$
4844
args: [--standard=PSR2, --colors]
45+
- id: php-l
46+
name: php -l
47+
entry: php
48+
language: system
49+
files: \.php$
50+
args: [-l]

composer.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
{
22
"require": {
33
"psr/log": "1.1.4",
4-
"phpseclib/phpseclib": "3.0.16",
4+
"phpseclib/phpseclib": "3.0.43",
55
"phpmailer/phpmailer": "6.6.4",
6-
"hakasapl/phpopenldaper": "1.0.5"
6+
"hakasapl/phpopenldaper": "1.0.6"
7+
},
8+
"require-dev": {
9+
"phpunit/phpunit": "<12.1"
710
}
811
}

defaults/config.ini.default

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ name = "Unity Cluster" ; Name of the website
1111
url = "https://127.0.0.1:8000/" ; URL of the website
1212
description = "The Unity Web Portal is a lightweight HPC cluster front-end" ; Description of the website
1313
logo = "logo.png" ; path to logo file, in the webroot/assets/branding folder
14+
terms_of_service_url = "https://github.com" ; this can be external or a portal page created with "content management"
1415

1516
[ldap]
1617
uri = "ldap://identity" ; URI of remote LDAP server
@@ -100,4 +101,3 @@ url = "https://hooks.slack.com/services/T04BB3N3M26/B050A55CBNX/IGm1YA0VhjczAfs5
100101
[page] ; which sql objects to use for the content on these pages
101102
home = "home"
102103
support = "support"
103-
policy = "policy"

phpunit.xml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1+
<!-- restrictWarnings="true" -->
12
<phpunit
2-
bootstrap="test/unit/bootstrap.php"
3+
bootstrap="test/phpunit-bootstrap.php"
34
failOnWarning="true"
45
failOnDeprecation="true"
56
failOnNotice="true"
6-
restrictWarnings="true"
77
>
88
<testsuites>
99
<testsuite name="unit">
1010
<directory>test/unit</directory>
1111
</testsuite>
12+
<testsuite name="functional">
13+
<directory>test/functional</directory>
14+
</testsuite>
1215
</testsuites>
1316
</phpunit>

resources/autoload.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
require_once __DIR__ . "/lib/UnityConfig.php";
2020
require_once __DIR__ . "/lib/UnityWebhook.php";
2121
require_once __DIR__ . "/lib/UnityRedis.php";
22+
require_once __DIR__ . "/lib/UnityGithub.php";
2223

2324
// run init script
2425
require __DIR__ . "/init.php";

resources/init.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use UnityWebPortal\lib\UnityUser;
1313
use UnityWebPortal\lib\UnityRedis;
1414
use UnityWebPortal\lib\UnityWebhook;
15+
use UnityWebPortal\lib\UnityGithub;
1516

1617
//
1718
// Initialize Session
@@ -84,6 +85,8 @@
8485
$CONFIG["site"]["url"] . $CONFIG["site"]["prefix"]
8586
);
8687

88+
$GITHUB = new UnityGithub();
89+
8790
//
8891
// SSO Init
8992
//

0 commit comments

Comments
 (0)