Continuous Integration
It is important that all changes pass unit and integration testing. Continuous integration (CI) is implemented using GitHub Actions workflows, which run tests on various platforms for each commit.Running Tests Locally
Unit and Integration Tests
Run the test suite using Python’s unittest module:Tests are defined in the
pynicotine/tests/ folder and should be expanded to cover larger parts of the client when possible.Code Style Checks
Verify code follows style guidelines using pycodestyle:Code Linting
Perform static code analysis using Pylint:Build Testing
Test that the application builds correctly:Test Categories
- Unit Tests
- Integration Tests
- Code Quality
Unit tests verify individual components and functions in isolation.Location: Tests cover:
pynicotine/tests/Run Command:- Protocol message parsing
- Configuration management
- Data structure operations
- Utility functions
Creating Tests
When adding new functionality or fixing bugs, expand the test coverage:1
Identify test location
Find or create the appropriate test file in
pynicotine/tests/ that corresponds to your changes2
Write test cases
Create test methods that verify the expected behavior:
3
Run tests locally
Verify your tests pass:
4
Push and verify CI
Ensure GitHub Actions runs all tests successfully
Manual Testing Platforms
Before releases, maintainers ensure Nicotine+ works on these platforms:- Windows - Latest version
- macOS - Latest version
- Ubuntu 18.04 - Oldest supported GTK 3 and Python 3 versions
- Ubuntu 22.04 - Oldest supported GTK 4 version
- Latest Ubuntu/Fedora - Current stable releases
You don’t need to test on all platforms for typical contributions, but be aware that CI tests across multiple operating systems and Python versions.
Testing Development Builds
Test your changes using various installation methods:Git Development Build
The recommended method for active development:1
Clone and navigate
2
Make your changes
Edit source files as needed
3
Run directly
4
Update and test again
Pip Install from Git
Test installation from Git:Profiling and Performance Testing
Use py-spy for real-time performance profiling:1
Install py-spy
2
Run with profiling
3
Analyze output
- Press
Lto aggregate by line number - Press
Rto reset the view - Identify performance bottlenecks
Profiler output shows real-time CPU usage by function, helping identify performance issues before they become problems.
Debug Testing
Enable verbose debug logging during testing:1
Show log pane
Click the ellipsis icon in the bottom right corner of the main window
2
Enable log categories
Right-click the log pane and select categories:
- Connections - Network operations
- Messages - Protocol messages
- Transfers - File transfers
- Miscellaneous - General debug messages
3
Log to file (optional)
Menu -> Preferences -> Logging -> Log debug messages to filePre-Commit Checklist
Before committing changes, verify:1
All tests pass
2
Code style is correct
3
No linting errors
4
Application runs
Testing Translation Updates
When modifying translatable strings:1
Update translation template
2
Verify template
Check
po/nicotine.pot for new/modified strings3
Test in different locales
Run the application with different language settings if possible
Weblate handles translation updates automatically via pull requests. Use “Create a merge commit” when merging to preserve translator attribution.
Continuous Integration Details
GitHub Actions automatically runs:- Unit tests on multiple Python versions
- Integration tests across Windows, macOS, and Linux
- Code style checks with pycodestyle
- Linting with Pylint
- Build tests to verify packaging
- Platform-specific installers for Windows and macOS
CI test results appear on pull requests and commits. All checks must pass before changes can be merged.
Unstable Build Testing
Test the latest unstable builds across platforms:GNU/Linux
Windows and macOS
Unstable installers are built automatically after each commit:- Windows x64/ARM64 installers and portable packages
- macOS Intel/Apple Silicon installers
Next Steps
- Review Development Overview for best practices
- Understand the Architecture for deeper insights
- Check Setup for dependency information