Page MenuHomePhabricator

[services/commtest] Tunnelbroker - Adding `deviceID` validation check function
ClosedPublic

Authored by max on Dec 19 2022, 6:47 AM.
Tags
None
Referenced Files
F2137244: D5929.diff
Fri, Jun 28, 5:17 PM
Unknown Object (File)
Tue, Jun 25, 5:48 PM
Unknown Object (File)
Mon, Jun 24, 4:54 PM
Unknown Object (File)
Fri, Jun 14, 7:44 AM
Unknown Object (File)
Tue, Jun 11, 8:54 PM
Unknown Object (File)
Thu, May 30, 9:24 PM
Unknown Object (File)
Thu, May 30, 9:24 PM
Unknown Object (File)
Thu, May 30, 9:24 PM
Subscribers

Details

Summary

This diff introduces a function that makes a call to the Tunnelbroker (get signature API) with the deviceID in the wrong format.
In this case, we are making sure that the Tunnelbroker returns an error on the wrong format deviceID provided.
This function is called during the test in D5931.

Linear task: ENG-1657

Test Plan

The commtest app is successfully built and the tests are successfully passed in the following D5931 where the function is used.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

max held this revision as a draft.
max published this revision for review.Dec 19 2022, 7:17 AM
max edited the summary of this revision. (Show Details)
max edited the test plan for this revision. (Show Details)
max added a reviewer: bartek. max added 1 blocking reviewer(s): jon.
services/commtest/src/tunnelbroker/tunnelbroker_utils.rs
23 ↗(On Diff #19554)

We tend to use anyhow::Result to skip specifying the error type when it's the anyhow::Error

Would really like to see these tests get added to the CI. They are pretty expensive to run locally.

This revision is now accepted and ready to land.Dec 20 2022, 9:55 AM
max edited the test plan for this revision. (Show Details)

Change the Result to be an anyhow.

max added inline comments.
services/commtest/src/tunnelbroker/tunnelbroker_utils.rs
23 ↗(On Diff #19554)

We tend to use anyhow::Result to skip specifying the error type when it's the anyhow::Error

We are not using anyhow::Result globally in this file, so making it use globally doesn't make sense, but it makes sense to change the Result to anyhow::Result in this function. It looks better. Thanks, @bartek !

In D5929#178691, @jon wrote:

Would really like to see these tests get added to the CI. They are pretty expensive to run locally.

Yes, we should start the RabbitMQ and Localstack on the CI machine to do this, I think we are ok with this now, thanks to nix. It's tracked by the ENG-2548

Rebasing and merging with the master changes.