Skip to content

Commit 832a9e5

Browse files
WIP
1 parent 4292884 commit 832a9e5

6 files changed

Lines changed: 21 additions & 9 deletions

File tree

.devcontainer/devcontainer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
"name": "PHP",
33
"image": "mcr.microsoft.com/devcontainers/php:1-8.4-bullseye",
44
"forwardPorts": [
5-
8080
5+
8080,
6+
8081
67
],
78
"customizations": {
89
"vscode": {

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ unittests:
8080
# Run bats tests
8181
.PHONY: bats
8282
bats:
83-
./run-app.sh "31.0.8" 1
83+
./scripts/run-app.sh "31.0.8" 1
8484
bats --verbose-run --timing --trace ./tests/bats
8585

8686
# Same as clean but also removes dependencies and build related folders

empty-skeleton.config.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
// SPDX-FileCopyrightText: 2025 Lennart Dohmann <lennart.dohmann@gdata.de>
4+
//
5+
// SPDX-License-Identifier: AGPL-3.0-or-later
6+
7+
$CONFIG = [
8+
'skeletondirectory' => '',
9+
'debug' => true,
10+
];

scripts/run-app.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ fi
1818
source .env || echo "No .env file found."
1919

2020
setup_nextcloud () {
21+
docker stop nextcloud-container || true
22+
docker container rm nextcloud-container || true
2123
docker compose -f docker-compose.yaml kill
2224
docker compose -f docker-compose.yaml rm --force --stop --volumes
2325
docker compose -f docker-compose.yaml up --build --quiet-pull --wait -d --force-recreate --renew-anon-volumes --remove-orphans
@@ -28,6 +30,10 @@ setup_nextcloud () {
2830
sleep 2
2931
done
3032

33+
echo "copy config for empty skeleton"
34+
docker cp ./empty-skeleton.config.php nextcloud-container:/var/www/html/config/config.php
35+
docker exec -i nextcloud-container chown www-data:www-data /var/www/html/config/config.php
36+
3137
until docker exec --user www-data -i nextcloud-container php occ maintenance:install --admin-user=admin --admin-pass=admin | grep "Nextcloud was successfully installed"
3238
do
3339
echo "Waiting for installation to finish..."

tests/bats/.env-test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ fi
1414
if [[ "$IS_CI" == "true" ]]; then
1515
export MAIL_HOSTNAME=smtp
1616
else
17-
export MAIL_HOSTNAME=127.0.0.1:8001
17+
export MAIL_HOSTNAME=127.0.0.1:8081
1818
fi
1919

2020
export FOLDER_PREFIX=./tmp/functionality-parallel

tests/bats/functionality-parallel.bats

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
setup_file() {
88
source tests/bats/.env-test || return 1
9-
source .env-local || echo "No .env-local file found."
9+
source .env-local || source .env || echo "No .env files found."
1010
mkdir -p $FOLDER_PREFIX
1111
curl --output $FOLDER_PREFIX/pup.exe http://amtso.eicar.org/PotentiallyUnwanted.exe
1212
$DOCKER_EXEC_WITH_USER --env OC_PASS=$TESTUSER_PASSWORD nextcloud-container php occ user:add $TESTUSER --password-from-env || echo "already exists"
@@ -30,11 +30,6 @@ setup_file() {
3030
@test "test admin clean upload" {
3131
RESULT=$(echo $CLEAN_STRING | curl -w "%{http_code}" -u admin:admin -T - http://$HOSTNAME/remote.php/dav/files/admin/functionality-parallel.clean.txt || echo "curl failed")
3232

33-
if [[ "$RESULT" =~ "curl failed" ]]; then
34-
$DOCKER_EXEC_WITH_USER -i nextcloud-container ls -lha data/admin/files
35-
docker logs nextcloud-container
36-
fi
37-
3833
echo "Actual: $RESULT"
3934
curl --silent -q -u admin:admin -X DELETE http://$HOSTNAME/remote.php/dav/files/admin/functionality-parallel.clean.txt || echo "file not found"
4035
[[ $RESULT -ge 200 && $RESULT -lt 300 ]]

0 commit comments

Comments
 (0)