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

cargo test output contains confusing errors #323

Open
rvolosatovs opened this issue Nov 17, 2022 · 3 comments
Open

cargo test output contains confusing errors #323

rvolosatovs opened this issue Nov 17, 2022 · 3 comments
Assignees
Labels

Comments

@rvolosatovs
Copy link
Member

rvolosatovs commented Nov 17, 2022

Ever since #312 was merged (determined by bisecting) cargo test prints confusing errors to the log:

$ cargo test
   Compiling drawbridge-type v0.2.2 (/home/rvolosatovs/src/github.com/profianinc/drawbridge/crates/type)
   Compiling drawbridge-server v0.2.2 (/home/rvolosatovs/src/github.com/profianinc/drawbridge/crates/server)
   Compiling drawbridge-client v0.2.4 (/home/rvolosatovs/src/github.com/profianinc/drawbridge/crates/client)
   Compiling drawbridge v0.2.3 (/home/rvolosatovs/src/github.com/profianinc/drawbridge)
    Finished test [unoptimized + debuginfo] target(s) in 10.20s
     Running unittests src/lib.rs (target/debug/deps/drawbridge-14d727548dbf868b)

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

     Running unittests src/main.rs (target/debug/deps/drawbridge-d1d50076176f8765)

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

     Running tests/mod.rs (target/debug/deps/mod-464ee95f1093a176)

running 1 test
2022-11-17T19:36:32.048772Z ERROR app::auth::oidc: failed to verify token error=Error decoding token

Caused by:
    Base64 error: Encoded text cannot have a 6-bit remainder.
2022-11-17T19:36:32.094596Z ERROR app::auth::oidc: failed to verify token error=Error decoding token

Caused by:
    InvalidAudience
2022-11-17T19:36:32.141511Z ERROR app::auth::oidc: failed to verify token error=Error decoding token

Caused by:
    ExpiredSignature
2022-11-17T19:36:32.287258Z ERROR app::auth::oidc: failed to verify token error=Error decoding token

Caused by:
    InvalidIssuer
test app ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 5.88s

   Doc-tests drawbridge

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

The only reasonable solution seems to be disabling server-side logging, which in turn will complicate debugging.
If the test case was isolated, we could disable logging only for that specific test case.

I'd propose splitting the invalid token tests into a separate auth unit test and disable server-side logging for that specific test case as part of the effort.

@rvolosatovs
Copy link
Member Author

Blocking #322

@rvolosatovs rvolosatovs added the bug Something isn't working label Nov 17, 2022
@puiterwijk
Copy link
Contributor

As far as I can see, all the tests are passing?
It says test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 5.88s, and exits with code 0?

@rvolosatovs
Copy link
Member Author

rvolosatovs commented Nov 17, 2022

nvm, output is just confusing , will fix in #324

@rvolosatovs rvolosatovs changed the title cargo test does not work out-of-the-box cargo test output contains confusing errors Nov 17, 2022
@rvolosatovs rvolosatovs reopened this Nov 17, 2022
@rvolosatovs rvolosatovs added technical debt and removed bug Something isn't working labels Nov 17, 2022
@dpal dpal added the good first issue Good for newcomers label Nov 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants