From 3c13b68dc9c4cffeb97a08e60c76b4e89c03fdbf Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sat, 21 Nov 2026 22:40:40 +0100 Subject: [PATCH] Improve test-all-php-versions for PostgreSQL (#9606) To avoid skipped tests. Follow-up of: * https://github.com/FreshRSS/FreshRSS/pull/9576 * https://github.com/FreshRSS/FreshRSS/pull/9535 --- .github/ISSUE_TEMPLATE/feed-report-form.yml | 2 +- .github/workflows/tests.yml | 2 +- CHANGELOG.md | 1 + Docker/README.md | 2 +- Docker/freshrss/docker-compose-db.yml | 2 +- Makefile | 21 ++++++++++++++++++++- 6 files changed, 25 insertions(+), 5 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/feed-report-form.yml b/.github/ISSUE_TEMPLATE/feed-report-form.yml index bb5fcebfc..c602291a9 100644 --- a/.github/ISSUE_TEMPLATE/feed-report-form.yml +++ b/.github/ISSUE_TEMPLATE/feed-report-form.yml @@ -49,7 +49,7 @@ body: attributes: label: System information description: Please complete the following information - value: "- Database version: [e.g. PostgreSQL 18, MySQL 8.4, SQLite]\n- PHP version: [e.g. PHP 8.2]\n- Installation type: [e.g. Docker, Docker image source, git, YunoHost]\n- Web server type: [e.g. Apache, nginx]\n- Device: [e.g. iPhone13]\n- OS: [e.g. Ubuntu 24.04, Win11, macOS 27]\n- Browser: [e.g. Firefox 157]" + value: "- Database version: [e.g. PostgreSQL 19, MySQL 8.4, SQLite]\n- PHP version: [e.g. PHP 8.2]\n- Installation type: [e.g. Docker, Docker image source, git, YunoHost]\n- Web server type: [e.g. Apache, nginx]\n- Device: [e.g. iPhone13]\n- OS: [e.g. Ubuntu 24.04, Win11, macOS 27]\n- Browser: [e.g. Firefox 157]" validations: required: true - type: textarea diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0baf7e4dc..a8bc33b6a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -22,7 +22,7 @@ jobs: services: postgres: - image: postgres:18-alpine@sha256:eaef288f54a90a909e49f0121d5d047a5e974e922699de4249625cf7cde34f36 + image: postgres:19-alpine@sha256:8b0ff4cdf221f0c53d7fcda681d3b461be725c492cd881c5ec9c0ad25023f188 env: POSTGRES_HOST_AUTH_METHOD: trust ports: diff --git a/CHANGELOG.md b/CHANGELOG.md index 711335228..fcf876be3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -61,6 +61,7 @@ See also [the FreshRSS releases](https://github.com/FreshRSS/FreshRSS/releases). * Treat https Atom 1.0 namespace as Atom * Deployment * Docker: dev image `freshrss/freshrss:oldest` updated to Alpine 3.18 with PHP 8.2.16 and Apache 2.4.62 [#9470](https://github.com/FreshRSS/FreshRSS/pull/9470) + * Docker: dev image `freshrss/freshrss:newest` updated with PHP 8.6.0 and Apache 2.4.71 * Docker: dev image `freshrss/freshrss:newest` updated to use HTTPs for downloading packages [#9584](https://github.com/FreshRSS/FreshRSS/pull/9584) * UI * Add option to open articles on their original website by default [#9554](https://github.com/FreshRSS/FreshRSS/pull/9554) diff --git a/Docker/README.md b/Docker/README.md index ceccc0e83..5021b4c28 100644 --- a/Docker/README.md +++ b/Docker/README.md @@ -128,7 +128,7 @@ docker compose -f docker-compose.yml -f docker-compose-db.yml pull docker compose -f docker-compose.yml -f docker-compose-db.yml -f docker-compose-local.yml up -d --remove-orphans ``` -> ⚠️ Keep the same major version of your database image (e.g. `postgres:17`) when updating FreshRSS, even if our example Compose files use a newer one: +> ⚠️ Keep the same major version of your database image (e.g. `postgres:19`) when updating FreshRSS, even if our example Compose files use a newer one: > a new major version of PostgreSQL refuses to start with the data of a previous one. To change it, see [Migrate database](#migrate-database). > If you replace your Compose files with newer copies of ours, also check that your `.env` file still uses the same variable names. diff --git a/Docker/freshrss/docker-compose-db.yml b/Docker/freshrss/docker-compose-db.yml index 85fb6f7c0..4490b2ee1 100644 --- a/Docker/freshrss/docker-compose-db.yml +++ b/Docker/freshrss/docker-compose-db.yml @@ -3,7 +3,7 @@ volumes: services: freshrss-db: - image: postgres:18 + image: postgres:19 container_name: freshrss-db hostname: freshrss-db restart: unless-stopped diff --git a/Makefile b/Makefile index d74ccbd6c..0b8aaca91 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,10 @@ PORT ?= 8080 NETWORK ?= freshrss-network # PHP versions tested by test-all-php-versions -PHP_VERSIONS ?= 8.2 8.3 8.4 8.5 8.6-rc +PHP_VERSIONS ?= 8.2 8.3 8.4 8.5 8.6 + +# PostgreSQL database used by test-all-php-versions +TESTS_PGSQL_IMAGE ?= postgres:19-alpine # detect docker or podman DOCKER ?= $(shell which docker 2>/dev/null || which podman 2>/dev/null) @@ -149,6 +152,20 @@ test-all: composer-test npm-test typos-test ## Run all tests .PHONY: test-all-php-versions test-all-php-versions: ## Run the test suite with every supported PHP version (Docker) @set -eu; \ + i=0; \ + $(DOCKER) rm --force freshrss-tests-db >/dev/null 2>&1 || true; \ + $(DOCKER) network create freshrss-tests-db-network >/dev/null 2>&1 || true; \ + cleanup() { $(DOCKER) rm --force freshrss-tests-db >/dev/null 2>&1 || true; $(DOCKER) network rm freshrss-tests-db-network >/dev/null 2>&1 || true; }; \ + trap cleanup EXIT INT TERM; \ + $(DOCKER) run --detach --rm \ + --name freshrss-tests-db \ + --network freshrss-tests-db-network \ + --env POSTGRES_HOST_AUTH_METHOD=trust \ + $(TESTS_PGSQL_IMAGE) >/dev/null; \ + until $(DOCKER) exec freshrss-tests-db pg_isready >/dev/null 2>&1; do \ + i=$$((i + 1)); [ $$i -lt 30 ] || { echo 'PostgreSQL database did not become ready in time.' >&2; exit 1; }; \ + sleep 1; \ + done; \ for v in $(PHP_VERSIONS); do \ echo "===== PHP $$v ====="; \ $(DOCKER) build --quiet \ @@ -156,6 +173,8 @@ test-all-php-versions: ## Run the test suite with every supported PHP version (D --tag docker.io/freshrss/tests:php$$v \ --file Docker/Dockerfile-tests . ; \ $(DOCKER) run --rm \ + --network freshrss-tests-db-network \ + --env FRESHRSS_TEST_PGSQL_DSN='pgsql:host=freshrss-tests-db;dbname=postgres;user=postgres' \ --volume $(shell pwd):/var/www/FreshRSS:z \ --workdir /var/www/FreshRSS \ docker.io/freshrss/tests:php$$v \