Skip to content

Testing

Daniel Berger edited this page Nov 20, 2026 · 1 revision

Testing against real Sympa

From a checkout of the repository:

rake docker:build
rake docker:spec

The host needs Ruby, Rake, and a running Docker daemon. Application gems, RSpec, Sympa, and the other test dependencies are installed inside the image; a host bundle install is unnecessary for these tasks.

What runs

The image contains Ruby 3.3, Debian Bookworm's Sympa 6.2.70 package, Apache/FastCGI, and SQLite. Each container provisions a fresh database and list state, starts the actual WWSympa and SOAP entrypoints, and runs the RSpec suite.

docker:spec builds the image first, reusing dependency layers. Current source is copied at build time. The runner prints the installed Sympa package version and waits up to 30 seconds for the WSDL endpoint. Provisioning, startup, and test failures return a nonzero status; startup and test failures print Apache and Sympa logs.

Docker removes the container afterward, including its database, lists, logs, and queued notifications. No host ports, persistent volumes, external database, manual web setup, or ~/.dbirc are needed. The test container uses --network none: localhost remains available, and mail delivery daemons are not started.

Runtime and image overrides

Docker is selected first; Podman is used if Docker is not installed. Select a runtime explicitly with:

CONTAINER_RUNTIME=podman rake docker:spec

The selected runtime must already be running. To change the image tag:

MAIL_SYMPA_IMAGE=mail-sympa-dev rake docker:build docker:spec

To select examples or pass RSpec options after building:

docker run --rm --network none mail-sympa-test spec/mail_sympa_spec.rb --seed 1234

Fixtures

Fixture Value
Domain sympa.test
Listmaster postmaster@sympa.test, password test
Reader reader@example.test, password test
Populated list testlist, containing the reader
Empty list partners
Topic testlist/testlist
Trusted application mail-sympa-tests, password test-app-password, proxying USER_EMAIL
SOAP endpoint http://localhost:8080/sympasoap, inside the container
WSDL endpoint http://localhost:8080/sympa/wsdl, inside the container

These credentials belong to the disposable test environment.

The configuration and provisioning files are in docker/: Dockerfile, run_specs.rb, seed_sympa.pl, test-sympa.conf, test-apache.conf, test-topics.conf, and test-syslog.conf. SQLite is a supported Sympa backend; see its setup instructions.

Coverage and verified result

Verified on November 19, 2026:

88 examples, 0 failures

No examples are excluded. The suite exercises valid and invalid credentials, sessions, the real WSDL contract, topic filters, SOAP arrays and hashes, true and false permissions, trusted applications, subscriber changes, and list creation and closure. Mutation tests check the resulting server state.

A separate check disabled the packaged Sympa SOAP executable in a throwaway container; the valid-login spec then failed with HTTP 404. The standard suite passes with the executable present. The old simulator files are absent from the current image and preserved in the repository's archive/mock-sympa branch.

This verifies the tested SOAP operations and environment. SMTP delivery, other Sympa or Ruby versions, and production database deployments are outside scope.

Host execution

Against a real server provisioned with the fixtures above:

bundle install
bundle exec rake spec

Optional environment variables are SYMPA_ENDPOINT, SYMPA_WSDL_URL, SYMPA_TEST_USER, and SYMPA_TEST_PASSWORD. The suite changes server state, so use a dedicated test installation containing the required lists, topic, reader, and trusted application.

Clone this wiki locally