Coder Social home page Coder Social logo

Comments (10)

lizhemingi avatar lizhemingi commented on June 3, 2024 1

/assign

from youki.

yihuaf avatar yihuaf commented on June 3, 2024 1

Sorry I don't follow. For local unit test, you also run cargo test -- --nocapture to see the error output in case test fails when developing. It works exactly the same.

from youki.

yihuaf avatar yihuaf commented on June 3, 2024

@utam0k I wasn't sure if you want to add --nocapture to cargo test on CI as a solution? This issue is asking for that.

from youki.

utam0k avatar utam0k commented on June 3, 2024

@utam0k I wasn't sure if you want to add --nocapture to cargo test on CI as a solution? This issue is asking for that.

That may be fine for CI, but what about local execution unit tests...

from youki.

lizhemingi avatar lizhemingi commented on June 3, 2024

@utam0k @yihuaf

I think nocapture can not meet the requirement of this issue.

https://doc.rust-lang.org/cargo/commands/cargo-test.html#display-options

It seems that the nocapture option means do not capture the output of our tested binary, something like println in our code.

But this issue is looking for the output information by rust test, something like which assert in which file is failed (The difference between two screenshots in the description.)

But maybe add nocapture to CI is also a good advice.

from youki.

utam0k avatar utam0k commented on June 3, 2024

I agree with this. However, I don't think this is the root solution.

But maybe add nocapture to CI is also a good advice.

from youki.

yihuaf avatar yihuaf commented on June 3, 2024

It seems that the nocapture option means do not capture the output of our tested binary, something like println in our code.
But this issue is looking for the output information by rust test, something like which assert in which file is failed (The difference between two screenshots in the description.)

I may be misunderstanding the request for this issue. From the link, I read:
By default the Rust test harness hides output from test execution to keep results readable. Test output can be recovered (e.g., for debugging) by passing --nocapture to the test binaries:

The information about which assert failed in which line is exactly the info outputted by --nocapture, in addition to the logs and println. There is also the -v and -vv flag to output additional info for the test build scripts and etc.

Anyhow, you seem to have a clear idea of what you'd like to accomplish in this issue, so I will leave you to it.

from youki.

lizhemingi avatar lizhemingi commented on June 3, 2024

The information about which assert failed in which line is exactly the info outputted by --nocapture, in addition to the logs and println. There is also the -v and -vv flag to output additional info for the test build scripts and etc.

I do have a try on add nocapture to the test, and it won't help.(I deliberately change the code to make test failed)
image
The output here does not have which assert in which file failed.

And if comment the tests code in tty.rs, the failure message show up again. Just like the failure message is eaten by the tty.

And here is the point I think.

Anyhow, you seem to have a clear idea of what you'd like to accomplish in this issue, so I will leave you to it.

Actually I have no idea how to deal with it right now, any suggestion is welcome.

from youki.

yihuaf avatar yihuaf commented on June 3, 2024

And if comment the tests code in tty.rs, the failure message show up again. Just like the failure message is eaten by the tty.

And here is the point I think.

Somehow I overlooked this line. Stupid me... You are right, what I mentioned is not a solution. The root cause is likely something else isolated to the tty tests.

from youki.

lizhemingi avatar lizhemingi commented on June 3, 2024

And if comment the tests code in tty.rs, the failure message show up again. Just like the failure message is eaten by the tty.

And here is the point I think.

Somehow I overlooked this line. Stupid me... You are right, what I mentioned is not a solution. The root cause is likely something else isolated to the tty tests.

ah never mind, the screen shot is too big to see the words. 😆

from youki.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.