Skip to content

Commit ea2d73d

Browse files
committedFeb 11, 2025
Merge torrust#1255: Overhaul core Tracker: add tests for databases mod
2cd1c65 test: [torrust#1251] add tests for database driver error converters (Jose Celano) adb9614 tests: [torrust#1251] add test for loading keys in DB drivers (Jose Celano) 700482d test: [torrust#1251] reset database before running db driver tests (Jose Celano) b9188c7 test: [torrust#1251] add tests for whitelist is DB drivers (Jose Celano) 613efb2 fix: [torrust#1257] bug 3. Expiring auth keys ignore fractions of seconds (Jose Celano) b94179d fix: [torrust#1257] bug 2. Auth keys can't be removed in MySQL (Jose Celano) 595397b fix: [torrust#1257] bug 1. permanent keys can't be created in MySQL (Jose Celano) 7ddacdc test: [torrust#1251] unify test runner for sqlite and mysql drivers (Jose Celano) 46949a6 test: [torrust#1251] add tests for core database driver mysql (Jose Celano) 568d6d3 test: [torrust#1251] add tests for core database driver sqlite (Jose Celano) Pull request description: Overhaul core Tracker: add tests for `databases` mod. Regarding the database drivers these are the methods in the Database trait grouped by context: Schema: - create_database_tables - drop_database_tables (this is only used for testing) Persistent torrents (stats): - [x] load_persistent_torrents - [x] save_persistent_torrent Authentication keys (for private trackers): - [x] load_keys - [x] get_key_from_keys - [x] add_key_to_keys - [x] remove_key_from_keys Whitelist (for listed trackers): - [x] load_whitelist - [x] get_info_hash_from_whitelist - [x] add_info_hash_to_whitelist - [x] remove_info_hash_from_whitelist ### Sub-tasks - [x] `driver` - [x] `mod.rs` (no direct tests added) - [x] `mysql.rs` - [x] `sqlite.rs` - [x] `error.rs` - [x] `mod.rs` (no direct tests added) - [x] `setup.rs` (no direct tests added) ACKs for top commit: josecelano: ACK 2cd1c65 Tree-SHA512: 07e92b5458053ae27b424bbd0d9bd35cf44b0a8a1ac2c16eb4c64016295b6770a5b426a132002d091c0fab7e754d198f2906498f733119f386831bdcac50aa1e
2 parents 24ae70d + 2cd1c65 commit ea2d73d

File tree

12 files changed

+864
-41
lines changed

12 files changed

+864
-41
lines changed
 

‎.github/workflows/testing.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,10 @@ jobs:
146146
name: Run Unit Tests
147147
run: cargo test --tests --benches --examples --workspace --all-targets --all-features
148148

149+
- id: database
150+
name: Run MySQL Database Tests
151+
run: TORRUST_TRACKER_CORE_RUN_MYSQL_DRIVER_TEST=true cargo test --package bittorrent-tracker-core
152+
149153
e2e:
150154
name: E2E
151155
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)
Please sign in to comment.