Skip to content
Tildev0.6.1

Build and test

This page builds Tilde from the source, runs tcli and tt without installing them, and runs the tests. Do these before you send a change.

  • The .NET 10 SDK and Git.
  • Docker, for the integration tests only. Without it they are skipped.
  • gpg, for the OpenPGP integration tests only. Without it they are skipped.
Terminal window
git clone https://codeberg.org/squidd/Tilde.git
cd Tilde
dotnet build Tilde.slnx

The analyzers are on and the style rules of .editorconfig are part of the build. The CI builds in Release with warnings as errors, so build the same way before a pull request:

Terminal window
dotnet build Tilde.slnx -c Release -warnaserror
Terminal window
dotnet run --project src/Tilde.Cli -- --help
Terminal window
dotnet run --project src/Tilde.Ui.Tui -- --demo

--demo shows made-up accounts and messages instead of the accounts of the configuration. It still needs a config.toml, and an empty one is enough. Both programs take --config <path>: the folder that holds config.toml, the scripts, the themes, the cache and the logs. Use a folder of your own and example domains, never a real server, while you try something:

Terminal window
dotnet run --project src/Tilde.Cli -- --config ~/tilde-try check

There are two test projects.

Project What it runs Needs
tests/Tilde.Tests The unit tests, with fakes for the servers Nothing
tests/Tilde.Tests.Integration The plugins and tcli against real servers: GreenMail (IMAP and SMTP), ejabberd (XMPP) and Ergo (IRC), and the real gpg Docker, gpg
Terminal window
dotnet test tests/Tilde.Tests
Terminal window
dotnet test tests/Tilde.Tests.Integration

The integration tests start the servers with Testcontainers and pull their images the first time. A test whose server cannot start is skipped, not failed, and the reason is in the output.

Run a part of a suite with a filter on the full name:

Terminal window
dotnet test tests/Tilde.Tests --filter "FullyQualifiedName~Tilde.Tests.Cli"

The CI runs the integration tests in four parts, by namespace: Tilde.Tests.Integration.Plugin.Mail, Tilde.Tests.Integration.Plugin.Chat.Xmpp, Tilde.Tests.Integration.Plugin.Chat.Irc and Tilde.Tests.Integration.Plugin.Pgp. Use the same filters to run one part.

Before a pull request into develop I run the unit tests once and the integration tests once. The CI does not run for develop (see Releases and CI), so these runs are the check.

  • A test lives under tests/Tilde.Tests/<Domain>/<Subdomain>/<Subject>Tests.cs, in a namespace that follows the folder.
  • The test is named Method_Scenario_ExpectedResult, has one behavior, and its body has the comments // Arrange, // Act and // Assert.
  • Fakes, builders and helpers go in Support/, never next to the tests.
  • A test that needs a real server goes in tests/Tilde.Tests.Integration and is skipped when Docker is missing.

CODE_CONVENTION.md has the full rules. To test a plugin, read Test a plugin.

Folder What it holds
src/Tilde.Abstraction Contracts and models only
src/Tilde.Core Configuration, accounts, event bus, jobs, plugin loading
src/Tilde.Scripting, Tilde.Cache, Tilde.Pgp, Tilde.Rules The Lua engine, the mail cache, OpenPGP and the rules, each a plugin
plugins/Tilde.Plugin.<Domain>.<Protocol> One project for each protocol
src/Tilde.Ui The widgets, the markup of a screen and the drawing for a terminal
src/Tilde.Ui.ViewModels The view models of the screens of tt
src/Tilde.Ui.Tui tt, the terminal interface
src/Tilde.Cli tcli, the command line tool
src/Tilde.Host The list of plugins that both programs start

The core never depends on a plugin. A plugin references Tilde.Abstraction and Tilde.Core and nothing else in plugins/.

After you add, remove or update a NuGet package, regenerate THIRD-PARTY-NOTICES.md. The script needs jq and nuget-license, and the CI of main runs it with --check.

Terminal window
dotnet tool install -g nuget-license --version 4.0.18
Terminal window
scripts/generate-third-party-notices.sh