# WARNING: do NOT reorder the redmine dependencies or certain tests will fail.
#          autopkgtest seems to revolve dpendency in order, which leads to
#          redmine-sqlite to be installed when trying to test another database.

# Tests that need to start services or open ports require the the
# isolation-container restriction.

# Apache host SQLite.
Test-Command: debian/tests/smoke-test-apache sqlite3 apache2-passenger-host /
Depends: apache2,
         curl,
         libapache2-mod-passenger,
         redmine-sqlite,
         redmine
Restrictions: needs-root isolation-container
Features: test-name=apache-sqlite-passenger-host

# Apache host PostgreSQL.
Test-Command: debian/tests/smoke-test-apache postgresql apache2-passenger-host /
Depends: apache2,
         curl,
         libapache2-mod-passenger,
         postgresql,
         redmine-pgsql,
         redmine
Restrictions: needs-root isolation-container
Features: test-name=apache-postgresql-passenger-host

# Apache host MySQL.
Test-Command: debian/tests/smoke-test-apache mysql2 apache2-passenger-host /
Depends: apache2,
         curl,
         default-mysql-server,
         libapache2-mod-passenger,
         redmine-mysql,
         redmine
Restrictions: needs-root isolation-container
Features: test-name=apache-mysql-passenger-host

# Apache alias SQLite.
Test-Command: debian/tests/smoke-test-apache sqlite3 apache2-passenger-alias /redmine
Depends: apache2,
         curl,
         libapache2-mod-passenger,
         redmine-sqlite,
         redmine
Restrictions: needs-root isolation-container
Features: test-name=apache-sqlite-passener-alias

# Nginx host SQLite.
Test-Command: debian/tests/smoke-test-nginx sqlite3 nginx-host
Depends: curl,
         multiwatch,
         nginx-light,
         redmine-sqlite,
         redmine,
Restrictions: needs-root isolation-container
Features: test-name=nginx-sqlite-host

# Install, break, purge.
Tests: install-break-purge
Depends: redmine
Restrictions: needs-root

# It is no longer possible in Redmine 6.x to test the plugins.
# https://lists.debian.org/debian-ruby/2025/03/msg00046.html
#Test-Command: debian/tests/smoke-test-apache sqlite3 apache2-passenger-host / && debian/tests/plugin-assets
#Depends: apache2,
#         curl,
#         libapache2-mod-passenger,
#         redmine,
#         redmine-plugin-custom-css
#Restrictions: needs-root isolation-container

# There are currently no lighttpd examples.
# https://lists.debian.org/debian-ruby/2025/02/msg00019.html
#Test-Command: debian/tests/smoke-test-lighttpd sqlite3 lighttpd-host / && debian/tests/plugin-assets
#Depends: curl,
#         lighttpd,
#         redmine-sqlite,
#         redmine,
#         redmine-plugin-custom-css,
#         ruby-fcgi
#Restrictions: needs-root isolation-container

# not working because of https://github.com/rails/rails/issues/24393
#Test-Command: debian/tests/smoke-test-lighttpd sqlite3 lighttpd-host-alias /redmine
#Depends: curl,
#         lighttpd,
#         redmine-sqlite,
#         redmine,
#         ruby-fcgi
#Restrictions: needs-root

# This fails because /etc/thin3.1/, referenced in the script, doesn't exist.
# Some investigation is likely required as to what the current command should
# be.
#Test-Command: debian/tests/smoke-test-thin sqlite3 thin-redmine /
#Depends: curl,
#         thin,
#         redmine-sqlite,
#         redmine
#Restrictions: needs-root isolatoin-container

# not working because of https://github.com/rails/rails/issues/24393
#Test-Command: debian/tests/smoke-test-nginx sqlite3 nginx-alias /redmine
#Depends: curl,
#         multiwatch,
#         nginx-light,
#         redmine,
#         ruby-fcgi,
#         spawn-fcgi
#Restrictions: needs-root
