leetup icon indicating copy to clipboard operation
leetup copied to clipboard

bug: leetup test stop working in windows

Open thenicealex opened this issue 2 years ago • 6 comments

In windows 11, when i run : leetup test two-sum.cpp -t "[1,2]\n3"

The error is :

thread '' panicked at 'called Result::unwrap() on an Err value: NotSupported', C:\Users\liran.cargo\registry\src\mirrors.tuna.tsinghua.edu.cn-df7c3c540f42cdbd\spinner-0.5.0\src\lib.rs:164:37 note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

Status: 403 Forbidden

Note: If error status is 4XX, make sure you are logged in!

I made sure I am logged in, but this error is still.

❯ rustc --version rustc 1.72.0 (5680fa18f 2023-08-23) ❯ leetup --version leetup 1.2.4

thanks!

thenicealex avatar Sep 17 '23 18:09 thenicealex

image

thenicealex avatar Sep 17 '23 18:09 thenicealex

Can you try with RUST_LOG=debug leetup test two-sum.cpp -t "[1,2]\n3" and paste the output here?

dragfire avatar Sep 17 '23 21:09 dragfire

sorry, I don't know about rust language. In windows 11, RUST_LOG=debug not recognized. Are there other ways to debug?

i am using PowerShell 7.3.6

image

thenicealex avatar Sep 18 '23 05:09 thenicealex

I don't have a windows machine to reproduce the issue. Can you try this https://stackoverflow.com/questions/18433840/logging-rust-programs

dragfire avatar Sep 19 '23 03:09 dragfire

thanks, i will try it

thenicealex avatar Sep 19 '23 11:09 thenicealex

Two separate points in this issue.

The first one is there seems having bugs in the version (1.2.0) of spinners crate that using by leetup currently. But it's working with 4.1.0 on Windows. Technically, term crate depend by archived spinner-0.5.0 crate is the source where the error msg thread '' panicked at 'called Result::unwrap() on an Err value: NotSupported' comes from and spinner-0.5.0 crate got removed after spinner 2.0 (https://github.com/FGRibreau/spinners/commit/5481120e9).

The second one is testing without -t is not only broken on Windows but Linux. The testdata param in graphql is not proper prepared while unwrapping None for Option<Option<String>> since nothing provided in command line. This data should come with problem info from API or may extract from the first example input I guess.

image

dieterplex avatar Oct 21 '23 18:10 dieterplex