Development Testing Release - Kozea/Radicale GitHub Wiki

Development

(TODO)

Github Workflows

Issue with "Coveralls.io"

Error running coveralls: Could not submit coverage: 405 Client Error: Method Not Allowed for url: https://coveralls.io/api/v1/jobs

Check for announced downtime: https://coveralls.io/ -> restart workflow after external service is up again.

Testing

Preparation

Installation of dependencies

  • Fedora / Enterprise Linux
dnf install python3-ldap3 python3-waitress python3-pam python3-bcrypt python3-argon2-cffi

(TODO: other OS/distributions)

Installation of test frameworks

  • Fedora / Enterprise Linux
## base tests
dnf install python3-pytest python-tox python-typeguard python-flake8 python3-isort python3-mypy
## integ_test (required by "chromium_headless_shell")
dnf install mesa-libgbm

(TODO: other OS/distributions)

Execution

Run in main source directory

Directory Cleanup (optional)

Note: will remove everything untracked, even ignored

git clean -fdx

Syntax check

flake8

Run tests

All defined tests

pytest

Particular defined test

Option -k can be used to select specific sub-tests

Example:

pytest radicale/tests/test_base.py -k test_overwrite_collection

Verbose logging

logging on debug level

Example:

pytest -v --log-cli-level=DEBUG radicale/tests/test_base.py -k test_overwrite_collection
logging on trace level
PYTEST_RADICALE_LOGLEVEL=trace pytest -v --log-cli-level=5 --log-level 5 radicale/tests/test_sharing.py -k test_sharing_api_token_ics_bday

Run "default" test suite

Note: in case of strange errors add option -r for recreation of environment

tox -c pyproject.toml

List all defined test suites

(>= 3.8.2)

tox list
default environments:
flake8                     -> Server: test code style
isort                      -> Server: test import sort order
mypy                       -> Server: test static types
py_loglevel_info           -> Server: run 'pytest' with log level 'INFO'
py_radicale_loglevel_info  -> Server: run 'pytest' with radicale on log level 'INFO'
py_radicale_loglevel_trace -> Server: run 'pytest' with radicale on log level 'TRACE'
py                         -> Server: run 'pytest' (incl. coverage report)
integ_test                 -> Server+WebUI: run 'playwright' integration tests (with 'chromium')
caldav_compat_test         -> Server: run caldav compatibility tests
html5validator             -> WebUI: validate HTML

additional environments:
py_filesystem_vfat         -> Server: run 'pytest' with collection storage filesystem 'vfat' (on Linux)
py_filesystem_vfat_utf8    -> Server: run 'pytest' with collection storage filesystem 'vfat+utf8' (on Linux)
py_filesystem_hfsplus      -> Server: run 'pytest' with collection storage filesystem 'hfsplus' (on Linux)
py_filesystem_ntfs         -> Server: run 'pytest' with collection storage filesystem 'ntfs' (on Linux)
js                         -> WebUI: validate JavaScript

Select only test suites

tox -c pyproject.toml -e flake8
tox -c pyproject.toml -e isort
tox -c pyproject.toml -e mypy
tox -c pyproject.toml -e py
tox -c pyproject.toml -e integ_test
tox -c pyproject.toml -e html5validator

or combine some in one run

tox -c pyproject.toml -e flake8,isort,mypy

There are more internal tests defined not executed automatically

Example:

tox -c pyproject.toml -e js  # >= 3.8.2

Hints

Run tests on a different mounted file system

## Example for running test on a mounted VFAT system on Linux
TEMP=/srv/vfat-coll/ pytest ...

Release

Verifications

  • All last actions successfully executed
  • CHANGELOG.md is up-to-date
  • No important issues still pending
  • Local repository is up-to-date: git pull
  • All issues assigned to related milestone are closed

Preparation

Milestones

  • Update date of current milestone
  • Close current milestone
  • Create new milestone

Files

Pull latest changes from upstream

git pull

Define version

VERSION="x.y.z"
File Action
CHANGELOG.md replace 3.*.dev with $VERSION
setup.py.legacy replace 3.*.dev with $VERSION
pyproject.toml replace 3.*.dev with $VERSION

Commit changes

git commit -a -m "Release $VERSION"

Create release tag

git tag v$VERSION

Push

git push
git push --tags

Build RPMs for Fedora/EL

Build RPMs for Fedora/EL: https://koji.fedoraproject.org/koji/packageinfo?packageID=16893

Release

Draft new release

  • Release title: VERSION (depending on changes)
  • Description: (copy part from CHANGELOG.md and sort by section)
  • Set it as release (except it should be a pre-release)

Note: in case something needs to be corrected, create a new tag v$VERSION-SEQ and change tag of release

Rebase major version

  • Rebase major version branch (currently "v3") with "master"
git checkout v3
git rebase v$VERSION
git push
git checkout master

Turn back master to devel

Define version

VERSION_DEV="x.y.z"
File Action
CHANGELOG.md add new section with $VERSION_DEV.dev
setup.py.legacy replace $VERSION with $VERSION_DEV.dev
pyproject.toml replace $VERSION with $VERSION_DEV.dev

Commit changes

git commit -a -m "Development $VERSION_DEV"

Push

git push
⚠️ **GitHub.com Fallback** ⚠️