Skip to content

Add tests for private tracker mode #813

@josecelano

Description

@josecelano

Relates to: #812 (comment)

I've fixed a problem with a missing segment of the tracker URL when the tracker and index work in private mode.

As I described here, I would be good to add an E2E test where we test this:

  1. Log in as a normal user
  2. Upload a torrent
  3. Get the torrent details from the API and extract the
  • The torrents should have a private key in the URL
  1. Make an HTTP request to the tracker to get the list of peers.
  • The peers list should be empty, but the HTTP response should be OK.

In the INdex GUI we have a similar test: https://github.com/torrust/torrust-index-gui/blob/develop/cypress/e2e/contexts/torrent/specs/private_download.cy.ts. However,

  • We don't ensure that the torrent contains the tracker key.
  • We don't request the tracker to ensure the tracker key works.
  • It's only executed when the Index GUI changes, so we would detect this type of bug too late (until we make a change in the GUI).

Perhaps we should add a workflow to the Index GUI to run end-to-end (E2E) tests periodically or when the Tracker or Index repository changes. E2E tests in the Inde GUI are the most comprehensive, as they test all three services (Tracker, Index API, and Index GUI).

cc @da2ce7

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions