Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New UDP tracker client for testing purposes #627

Merged

Conversation

josecelano
Copy link
Member

@josecelano josecelano commented Jan 18, 2024

You can use it with:

cargo run --bin udp_tracker_client 144.126.245.19:6969 9c38422213e30bff212b30c360d26f9a02136422

and the output should be something like:

AnnounceIpv4(
    AnnounceResponse {
        transaction_id: TransactionId(
            -888840697,
        ),
        announce_interval: AnnounceInterval(
            300,
        ),
        leechers: NumberOfPeers(
            0,
        ),
        seeders: NumberOfPeers(
            4,
        ),
        peers: [
            ResponsePeer {
                ip_address: xx.yy.zz.254,
                port: Port(
                    51516,
                ),
            },
            ResponsePeer {
                ip_address: xx.yy.zz.20,
                port: Port(
                    59448,
                ),
            },
            ResponsePeer {
                ip_address: xx.yy.zz.224,
                port: Port(
                    58587,
                ),
            },
        ],
    },
)

Copy link

codecov bot commented Jan 18, 2024

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (62fddba) 77.56% compared to head (f0710d3) 77.59%.

Files Patch % Lines
src/shared/bit_torrent/tracker/udp/client.rs 93.33% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #627      +/-   ##
===========================================
+ Coverage    77.56%   77.59%   +0.02%     
===========================================
  Files          125      125              
  Lines         8337     8349      +12     
===========================================
+ Hits          6467     6478      +11     
- Misses        1870     1871       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@josecelano josecelano force-pushed the 625-add-a-new-udp-tracker-client-binary branch from 69b80ac to 3c2b531 Compare January 18, 2024 12:58
@josecelano josecelano force-pushed the 625-add-a-new-udp-tracker-client-binary branch from 3c2b531 to 6934338 Compare January 18, 2024 13:13
@josecelano josecelano linked an issue Jan 18, 2024 that may be closed by this pull request
@josecelano
Copy link
Member Author

josecelano commented Jan 18, 2024

This binary prints the Rust struct instead of a JSON object like in the http_tracker_client.

This is because Aquatic does not implement serialize for responses (only bencode format).

I will keep it this way for the time being until I start working on the E2E tests. I plan to use this binary for E2E testing but maybe I can only use the exit code. It depends on the asserts. I can modify it later if the json format fits better or just to keep both clients similar.

It would also be nice to use the domain instead of the IP.

@josecelano
Copy link
Member Author

josecelano commented Jan 18, 2024

ACK afc4731

@josecelano josecelano marked this pull request as ready for review January 18, 2024 13:20
@josecelano josecelano marked this pull request as draft January 18, 2024 13:26
@josecelano josecelano force-pushed the 625-add-a-new-udp-tracker-client-binary branch from 6934338 to b210edc Compare January 18, 2024 15:52
@josecelano josecelano force-pushed the 625-add-a-new-udp-tracker-client-binary branch from b210edc to afc4731 Compare January 18, 2024 15:55
@josecelano josecelano self-assigned this Jan 18, 2024
@josecelano josecelano marked this pull request as ready for review January 18, 2024 16:03
@josecelano
Copy link
Member Author

I don't know why the code coverage report is failing. It's working on my local machine. I have to heck if I'm using the same Rust version.

@josecelano
Copy link
Member Author

I don't know why the code coverage report is failing. It's working on my local machine. I have to heck if I'm using the same Rust version.

By the way @WarmBeer I do not know why we are generating the code coverage report in two workflows. We have a specific workflow for code coverage. SHould we remove that step from the Testing workflow?

@josecelano
Copy link
Member Author

I don't know why the code coverage report is failing. It's working on my local machine. I have to heck if I'm using the same Rust version.

By the way @WarmBeer I do not know why we are generating the code coverage report in two workflows. We have a specific workflow for code coverage. SHould we remove that step from the Testing workflow?

Maybe it was because we wanted to see the report on the workflow execution log. But we can move the step to the coverage wirkflow.

@mickvandijke
Copy link
Member

I don't know why the code coverage report is failing. It's working on my local machine. I have to heck if I'm using the same Rust version.

By the way @WarmBeer I do not know why we are generating the code coverage report in two workflows. We have a specific workflow for code coverage. SHould we remove that step from the Testing workflow?

I did not setup the current workflow, so I do not know the need for two "code coverage" steps.

But it is weird that the first one passed while the second one in the Testing workflow didn't 😅.

@josecelano
Copy link
Member Author

I don't know why the code coverage report is failing. It's working on my local machine. I have to heck if I'm using the same Rust version.

By the way @WarmBeer I do not know why we are generating the code coverage report in two workflows. We have a specific workflow for code coverage. SHould we remove that step from the Testing workflow?

I did not setup the current workflow, so I do not know the need for two "code coverage" steps.

But it is weird that the first one passed while the second one in the Testing workflow didn't 😅.

OK, I've opened a new issue: #628

By the way @WarmBeer, I intended to mention @da2ce7 who was the last one refactoring the workflows :-)

You can use it with:

```console
cargo run --bin udp_tracker_client 144.126.245.19:6969 9c38422213e30bff212b30c360d26f9a02136422
```

and the output should be something like:

```
AnnounceIpv4(
    AnnounceResponse {
        transaction_id: TransactionId(
            -888840697,
        ),
        announce_interval: AnnounceInterval(
            300,
        ),
        leechers: NumberOfPeers(
            0,
        ),
        seeders: NumberOfPeers(
            4,
        ),
        peers: [
            ResponsePeer {
                ip_address: xx.yy.zz.254,
                port: Port(
                    51516,
                ),
            },
            ResponsePeer {
                ip_address: xx.yy.zz.20,
                port: Port(
                    59448,
                ),
            },
            ResponsePeer {
                ip_address: xx.yy.zz.224,
                port: Port(
                    58587,
                ),
            },
        ],
    },
)
```
@josecelano josecelano force-pushed the 625-add-a-new-udp-tracker-client-binary branch from afc4731 to f0710d3 Compare January 19, 2024 15:50
@josecelano josecelano added the Testing Checking Torrust label Jan 19, 2024
@josecelano josecelano added this to the v3.0.0 milestone Jan 19, 2024
@josecelano
Copy link
Member Author

ACK f0710d3

@josecelano josecelano merged commit 410e39e into torrust:develop Jan 19, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Testing Checking Torrust
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

Add a new UDP tracker client binary
2 participants