Compare commits

...

34 commits

Author SHA1 Message Date
Tristan Darricau
169de8432f
Merge b95e246b76 into bdbd0be548 2025-05-02 07:16:08 +00:00
Marc Alexander
bdbd0be548
Merge branch '3.3.x' 2025-05-02 08:32:19 +02:00
Marc Alexander
1b2ac50cfd
Merge pull request #6810 from rxu/ticket/17504
[ticket/17504] Fix tests failure caused by ondrej/php PPA repo label changed
2025-04-28 21:17:23 +02:00
rxu
779bec5fcf
[ticket/17504] Run apt-get update on runner lever rather than in bash scripts
PHPBB-17504
2025-04-28 23:28:05 +07:00
rxu
f512af1823
[ticket/17504] Fix tests
Fix the following apt-get update issue with ondrej/php PPA repo:
Repository 'https://ppa.launchpadcontent.net/ondrej/php/ubuntu noble InRelease'
changed its 'Label' value from '***** The main PPA for supported PHP versions
with many PECL extensions *****' to 'PPA for PHP'

Alternative fix might be: sudo apt update && sudo apt full-upgrade -y

PHPBB-17504
2025-04-28 21:17:57 +07:00
Tristan Darricau
b95e246b76 Add Oracle 2016-02-07 12:22:13 +01:00
Tristan Darricau
03988d8155 echo debug 2016-02-05 16:54:22 +01:00
Tristan Darricau
f8b9a4f4b6 echo debug 2016-02-05 16:50:01 +01:00
Tristan Darricau
e486ed0770 func tets 2016-02-05 16:33:23 +01:00
Tristan Darricau
c4a4f35a3a Func tests 2016-02-03 21:21:47 +01:00
Tristan Darricau
d414453527 Fix reporting 2016-02-03 09:05:24 +01:00
Tristan Darricau
9411b6fe28 Increase MySQL disk space 2016-02-03 01:34:25 +01:00
Tristan Darricau
3efbe08ee7 Echo debug 2016-02-03 00:53:09 +01:00
Tristan Darricau
e15c4027d4 Fix mysql recipe 2016-02-03 00:40:35 +01:00
Tristan Darricau
73c621bb5a Fix bamboo env mapping 2016-02-03 00:39:49 +01:00
Tristan Darricau
4b3da8a106 Fix mysql recipe 2016-02-03 00:33:00 +01:00
Tristan Darricau
e131ddda97 Fix unit-tests perms 2016-02-03 00:16:20 +01:00
Tristan Darricau
aeb6fb5742 Github token 2016-02-02 12:58:28 +01:00
Tristan Darricau
8fa531b3c3 Echo set_status 2016-02-02 12:48:23 +01:00
Tristan Darricau
8746bab4af Echo set_status 2016-02-02 12:39:01 +01:00
Tristan Darricau
10b7a94fe8 Echo set_status 2016-02-02 12:04:48 +01:00
Tristan Darricau
2248d59181 Echo set_status 2016-02-02 11:46:33 +01:00
Tristan Darricau
c5ee6efb2b Echo set_status 2016-02-02 11:42:12 +01:00
Tristan Darricau
ead4d7bf2d Reorganize scripts 2016-02-02 11:29:52 +01:00
Tristan Darricau
8947a6f9f6 Set status 2016-02-01 22:58:52 +01:00
Tristan Darricau
cd1f4279f3 Set status 2016-02-01 22:40:49 +01:00
Tristan Darricau
3d29fe29c4 Set status 2016-02-01 22:34:43 +01:00
Tristan Darricau
d37f9f288e Set status 2016-02-01 22:34:35 +01:00
Tristan Darricau
0f2caeff07 Set status 2016-02-01 22:30:26 +01:00
Tristan Darricau
abae70079b Prepare sources 2016-02-01 22:16:08 +01:00
Tristan Darricau
793a7923c2 Prepare sources 2016-02-01 22:13:15 +01:00
Tristan Darricau
6145949c5a Sniffer && generate archive 2016-02-01 22:07:27 +01:00
Tristan Darricau
e3aed4f17c Fix images 2016-02-01 21:44:56 +01:00
Tristan Darricau
e82bbbba14 [TEST] Scripts to run the tests with docker 2016-02-01 21:32:00 +01:00
22 changed files with 309 additions and 4 deletions

View file

@ -10,5 +10,4 @@
#
set -e
sudo apt-get update
sudo apt-get install -y parallel libimage-exiftool-perl

View file

@ -11,7 +11,6 @@
set -e
set -x
sudo apt-get update
sudo apt-get install -q -y sphinxsearch
DIR=$(dirname "$0")

View file

@ -10,5 +10,4 @@
#
set -e
sudo apt-get update
sudo apt-get install -y expect-dev

View file

@ -11,7 +11,6 @@
set -e
set -x
sudo apt-get update
sudo apt-get install -y nginx coreutils
sudo service nginx stop

View file

@ -28,6 +28,10 @@ jobs:
name: PHP ${{ matrix.php }} - ${{ matrix.db }}
steps:
- name: Update Ubuntu package lists
run: |
sudo apt-get update -y --allow-releaseinfo-change
- name: Checkout repository
uses: actions/checkout@v4
with:
@ -169,6 +173,10 @@ jobs:
- 6379:6379
steps:
- name: Update Ubuntu package lists
run: |
sudo apt-get update -y --allow-releaseinfo-change
- name: Checkout repository
uses: actions/checkout@v4
@ -308,6 +316,10 @@ jobs:
- 6379:6379
steps:
- name: Update Ubuntu package lists
run: |
sudo apt-get update -y --allow-releaseinfo-change
- name: Checkout repository
uses: actions/checkout@v4
@ -412,6 +424,10 @@ jobs:
steps:
- name: Update Ubuntu package lists
run: |
sudo apt-get update -y --allow-releaseinfo-change
- name: Checkout repository
uses: actions/checkout@v4

View file

@ -0,0 +1,9 @@
#!/usr/bin/env bash
export IMAGES_TAG=${bamboo_images_tag}
export WORKING_DIR=${bamboo_working_directory}
export PR_NUMBER=${bamboo_PRnumber}
export GITHUB_TOKEN=${bamboo_github_token_password}
export COMPOSER_HOME=${bamboo_composer_home}
export BUILD_RESULT_URL=${bamboo_buildResultsUrl}

View file

@ -0,0 +1,32 @@
#!/usr/bin/env bash
export PHPBB_TEST_DBMS='phpbb\db\driver\mysqli'
export PHPBB_TEST_DBHOST='mysql'
export PHPBB_TEST_DBPORT='3306'
export PHPBB_TEST_DBNAME='phpbb_tests'
export PHPBB_TEST_DBUSER='root'
export PHPBB_TEST_DBPASSWD=''
export PHPBB_TEST_TABLE_PREFIX='phpbb_'
export DOCKER_LINK='--link mysql:mysql'
function start_db {
cat <<EOL > /tmp/phpbb.cnf
[mysqld]
default-storage-engine=MyISAM
default-tmp-storage-engine=MyISAM
tmpdir=/dev/shm/
datadir=/dev/shm/
EOL
docker run \
-d \
--volume /tmp/phpbb.cnf:/etc/mysql/conf.d/phpbb.cnf \
--name mysql \
--shm-size=256M \
--env MYSQL_ROOT_PASSWORD='' \
--env MYSQL_DATABASE='phpbb_tests' \
--env MYSQL_ALLOW_EMPTY_PASSWORD='yes' \
mysql
docker run --rm --link mysql:mysql waisbrot/wait
}

View file

@ -0,0 +1,15 @@
#!/usr/bin/env bash
export PHPBB_TEST_DBMS='phpbb\db\driver\oracle'
export PHPBB_TEST_DBHOST='oracle'
export PHPBB_TEST_DBPORT='1521'
export PHPBB_TEST_DBNAME='xe'
export PHPBB_TEST_DBUSER='system'
export PHPBB_TEST_DBPASSWD='oracle'
export PHPBB_TEST_TABLE_PREFIX='phpbb_'
export DOCKER_LINK='--link oracle:oracle'
function start_db {
docker run -d --name oracle wnameless/oracle-xe-11g
docker run --rm --link oracle:oracle -e TARGETS=oracle:1521 waisbrot/wait
}

View file

@ -0,0 +1,24 @@
#!/usr/bin/env bash
export PHPBB_TEST_DBMS='phpbb\db\driver\postgres'
export PHPBB_TEST_DBHOST='postgres'
export PHPBB_TEST_DBPORT='5432'
export PHPBB_TEST_DBNAME='phpbb_tests'
export PHPBB_TEST_DBUSER='postgres'
export PHPBB_TEST_DBPASSWD=''
export PHPBB_TEST_TABLE_PREFIX='phpbb_'
export DOCKER_LINK='--link postgres:postgres'
function start_db {
docker run \
-d \
--name postgres \
--env POSTGRES_PASSWORD='' \
--env POSTGRES_USER='postgres' \
postgres
docker run --rm --link postgres:postgres waisbrot/wait
sleep 1
docker run --link postgres:postgres --rm postgres sh -c 'exec psql -h "$POSTGRES_PORT_5432_TCP_ADDR" -p "$POSTGRES_PORT_5432_TCP_PORT" -U postgres -c "create database phpbb_tests;"'
}

View file

@ -0,0 +1,14 @@
#!/usr/bin/env bash
export PHPBB_TEST_DBMS='phpbb\db\driver\sqlite3'
export PHPBB_TEST_DBHOST='/dev/shm/phpbb_unit_tests.sqlite3'
export PHPBB_TEST_DBPORT=''
export PHPBB_TEST_DBNAME=''
export PHPBB_TEST_DBUSER=''
export PHPBB_TEST_DBPASSWD=''
export PHPBB_TEST_TABLE_PREFIX='phpbb_'
export DOCKER_LINK=''
function start_db {
true
}

View file

@ -0,0 +1,12 @@
#!/usr/bin/env bash
docker run \
--user $(id -u):$(id -g) \
--volume ${WORKING_DIR}:/data \
--workdir /data \
phpbb/build${IMAGES_TAG} sh -c '
git config user.email "no-reply@phpbb.com" &&
git config user.name "phpBB CI" &&
git remote set-url origin "https://github.com/phpbb/phpbb.git" &&
git fetch origin +refs/pull/'${PR_NUMBER}'/merge &&
git checkout FETCH_HEAD'

View file

@ -0,0 +1,17 @@
#!/usr/bin/env bash
cat <<EOL > generate-archive.sh
git remote set-url origin "https://github.com/phpbb/phpbb.git"
git fetch origin +refs/pull/${PR_NUMBER}/head
last_commit=\$(git rev-parse FETCH_HEAD)
echo "\$last_commit" > build/logs/last_commit
tar --exclude-backups --exclude-vcs --exclude='.git' --exclude='generate-archive.sh' -p -c -z -f source_code.tar.gz *
EOL
docker run \
--user $(id -u):$(id -g) \
--volume ${WORKING_DIR}:/data \
--workdir /data \
phpbb/build${IMAGES_TAG} sh generate-archive.sh
rm generate-archive.sh

View file

@ -0,0 +1,26 @@
#!/usr/bin/env bash
# Ensure the github oauth token is set
docker run \
--user $(id -u):$(id -g) \
--volume ${WORKING_DIR}:/data \
--volume ${COMPOSER_HOME}:/composer/ \
--workdir /data \
phpbb/build${IMAGES_TAG} sh -c "COMPOSER_HOME=/composer php composer.phar config -g github-oauth.github.com ${GITHUB_TOKEN}"
docker run \
--user $(id -u):$(id -g) \
--volume ${WORKING_DIR}:/data \
--volume ${COMPOSER_HOME}:/composer/ \
--workdir /data \
phpbb/build${IMAGES_TAG} sh -c '
git config user.email "no-reply@phpbb.com" &&
git config user.name "phpBB CI" &&
cd phpBB &&
COMPOSER_HOME=/composer php ../composer.phar install --dev'
docker run \
--user $(id -u):$(id -g) \
--volume ${WORKING_DIR}:/data \
--workdir /data \
phpbb/build${IMAGES_TAG} sh -c 'cd build; ../phpBB/vendor/bin/phing clean prepare'

View file

@ -0,0 +1,14 @@
#!/usr/bin/env bash
# We assume the docker daemon is dedicated to the current job (the jobs runs on isolated docker daemon)
# Stop running containers
for container in $(docker ps -q)
do
docker stop $container || true
done
# Removing containers
for container in $(docker ps -a -q)
do
docker rm -v $container || true
done

View file

@ -0,0 +1,7 @@
#!/usr/bin/env bash
docker run \
--user $(id -u):$(id -g) \
--volume ${WORKING_DIR}:/data \
--workdir /data \
debian tar -p -x -z -f source_code.tar.gz

View file

@ -0,0 +1,26 @@
#!/usr/bin/env bash
pwd=$(dirname "$0")
db=$1
php=$2
. ${pwd}/../db/${db}.sh
start_db
docker run \
--env TEST_UID=$(id -u) \
--env TEST_GID=$(id -g) \
${DOCKER_LINK} \
--env PHPBB_TEST_DBMS="${PHPBB_TEST_DBMS}" \
--env PHPBB_TEST_DBHOST="${PHPBB_TEST_DBHOST}" \
--env PHPBB_TEST_DBPORT="${PHPBB_TEST_DBPORT}" \
--env PHPBB_TEST_DBNAME="${PHPBB_TEST_DBNAME}" \
--env PHPBB_TEST_DBUSER="${PHPBB_TEST_DBUSER}" \
--env PHPBB_TEST_DBPASSWD="${PHPBB_TEST_DBPASSWD}" \
--env PHPBB_TEST_TABLE_PREFIX="${PHPBB_TEST_TABLE_PREFIX}" \
--env PHPBB_FUNCTIONAL_URL="http://localhost/" \
--volume ${WORKING_DIR}:/data \
--workdir /data \
phpbb/php-ft-${php}-${db}${IMAGES_TAG} php -d memory_limit=-1 phpBB/vendor/bin/phpunit --group functional --log-junit build/logs/phpunit.xml

11
docker/scripts/jobs/sniffer.sh Executable file
View file

@ -0,0 +1,11 @@
#!/usr/bin/env bash
docker run \
--user $(id -u):$(id -g) \
--volume ${WORKING_DIR}:/data \
--workdir /data \
php:5.6 sh -c '
cd build &&
../phpBB/vendor/bin/phing sniff &&
echo 0 > logs/sniffs_res ||
echo 1 > logs/sniffs_res'

View file

@ -0,0 +1,24 @@
#!/usr/bin/env bash
pwd=$(dirname "$0")
db=$1
php=$2
. ${pwd}/../db/${db}.sh
start_db
docker run \
--user $(id -u):$(id -g) \
${DOCKER_LINK} \
--env PHPBB_TEST_DBMS="${PHPBB_TEST_DBMS}" \
--env PHPBB_TEST_DBHOST="${PHPBB_TEST_DBHOST}" \
--env PHPBB_TEST_DBPORT="${PHPBB_TEST_DBPORT}" \
--env PHPBB_TEST_DBNAME="${PHPBB_TEST_DBNAME}" \
--env PHPBB_TEST_DBUSER="${PHPBB_TEST_DBUSER}" \
--env PHPBB_TEST_DBPASSWD="${PHPBB_TEST_DBPASSWD}" \
--env PHPBB_TEST_TABLE_PREFIX="${PHPBB_TEST_TABLE_PREFIX}" \
--volume ${WORKING_DIR}:/data \
--workdir /data \
phpbb/php-ut-${php}-${db}${IMAGES_TAG} php -d memory_limit=-1 phpBB/vendor/bin/phpunit --group __nogroup__ --log-junit build/logs/phpunit.xml

View file

@ -0,0 +1,9 @@
#!/usr/bin/env bash
export IMAGES_TAG=':latest'
export WORKING_DIR="$(git rev-parse --show-toplevel)"
export PR_NUMBER=''
export GITHUB_TOKEN="$(cd "$WORKING_DIR"/phpBB;php ../composer.phar config github-oauth.github.com)"
export COMPOSER_HOME="$(cd "$WORKING_DIR"/phpBB;php ../composer.phar config home)"
export BUILD_RESULT_URL=''

View file

@ -0,0 +1,16 @@
#!/usr/bin/env bash
if [ -s build/logs/phpunit.xml ]; then
res=$(cat build/logs/sniffs_res 2>/dev/null)
if ( grep 'failures="[^0]"' build/logs/phpunit.xml ); then
res=1
elif ( grep 'errors="[^0]"' build/logs/phpunit.xml ); then
res=2
else
res=0
fi
else
res=2
fi
echo ${res}

View file

@ -0,0 +1,23 @@
#!/usr/bin/env bash
last_commit=$(cat build/logs/last_commit)
result_file=$1
step=$2
if [ -s build/logs/${result_file} ]; then
res=$(cat build/logs/${result_file} 2>/dev/null)
else
res=2
fi
if [ $res -eq 0 ]; then
echo Send success
$(dirname "$0")/set-status.sh 'success' 'The Bamboo build is a success' "${step}"
elif [ $res -eq 1 ]; then
echo Send Failure
$(dirname "$0")/set-status.sh 'failure' 'The Bamboo build failed' "${step}"
else
echo Send error
$(dirname "$0")/set-status.sh 'error' 'The Bamboo build is in error' "${step}"
fi

View file

@ -0,0 +1,14 @@
#!/usr/bin/env bash
last_commit=$(cat build/logs/last_commit)
status=$1
description=$2
step=$3
env
echo '---------------------'
echo curl -H "Authorization: token ${GITHUB_TOKEN}" --request POST --data "{\"state\": \"${status}\", \"description\": \"${description}\", \"target_url\": \"${BUILD_RESULT_URL}\", \"context\": \"phpBB continuous integration - ${step}\"}" https://api.github.com/repos/phpbb/phpbb/statuses/${last_commit}
echo '---------------------'
curl -H "Authorization: token ${GITHUB_TOKEN}" --request POST --data "{\"state\": \"${status}\", \"description\": \"${description}\", \"target_url\": \"${BUILD_RESULT_URL}\", \"context\": \"phpBB continuous integration - ${step}\"}" https://api.github.com/repos/phpbb/phpbb/statuses/${last_commit}