Skip to content

Add integration tests for Database trait#51

Merged
mickvandijke merged 11 commits intodevelopmentfrom
testing/database-trait
Aug 10, 2022
Merged

Add integration tests for Database trait#51
mickvandijke merged 11 commits intodevelopmentfrom
testing/database-trait

Conversation

@mickvandijke
Copy link
Copy Markdown
Member

Tests run for each database implementation individually. The Sqlite3 test database runs in memory. The Mysql test database runs on a Docker image.

I have included a README.md file in the tests folder with instructions on running tests:


Running Tests

Torrust requires Docker to run different database systems for testing. install docker here.

Start the databases with docker-compose before running tests:

$ docker-compose up

Run all tests using:

$ cargo test

Tested functions after this PR:

  • insert_user_and_get_id
  • get_user_from_id
  • get_user_authentication_from_id
  • get_user_profile_from_username
  • get_user_compact_from_id
  • get_user_tracker_key
  • count_users
  • ban_user
  • grant_admin_role
  • verify_email
  • add_tracker_key
  • delete_user
  • insert_category_and_get_id
  • get_category_from_id
  • get_category_from_name
  • get_categories
  • delete_category
  • get_torrents_search_sorted_paginated
  • insert_torrent_and_get_id
  • get_torrent_from_id
  • get_all_torrents_compact
  • update_torrent_title
  • update_torrent_description
  • update_tracker_info
  • delete_torrent
  • delete_all_database_rows

@mickvandijke mickvandijke changed the title Add tests for Database trait Add integration tests for Database trait Aug 10, 2022
@mickvandijke mickvandijke merged commit d6bd2f8 into development Aug 10, 2022
@mickvandijke mickvandijke deleted the testing/database-trait branch August 12, 2022 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

1 participant