Giter Club home page Giter Club logo

Comments (10)

v-lopez avatar v-lopez commented on September 13, 2024 3

With some modifications I have the following behavior, on bold the behaviours that have changed.

The changes:
https://github.com/ros/ros_comm/compare/kinetic-devel...pal-robotics-forks:rostest-screen-output?expand=1
https://github.com/ros/ros/compare/kinetic-devel...pal-robotics:tee-test-output?expand=1

test stdout stderr log info log warn log error
cpp_test terminal terminal terminal terminal terminal
py_test terminal1 terminal1 terminal1 terminal1 terminal1
cpp_rostest terminal terminal terminal terminal terminal
py_rostest terminal1 & rosunit xml terminal1 & rosunit xml terminal1 & rosunit xml terminal1 & rosunit xml terminal1 & rosunit xml
cpp_rostest --text terminal terminal terminal terminal terminal
py_rostest --text terminal terminal terminal terminal terminal

1 The logs have no color, probably related to the py logging macros, haven't looked into it.

While keeping test result output to XML for jenkins.
These changes would satisfy what was requested in this issue.

I see three drawbacks to these fixes:

1. cpp rostests no longer write to log file
I would say that the previous behaviour was not consistent, and difficult to use reliably since a rostest could be writing to 3 different places.

2. Logs colors are missing for python tests
Probably this can be fixed if there's an interest into these changes.

3. Tests are now more verbose
It's true

from ros.

v-lopez avatar v-lopez commented on September 13, 2024 1

I've been looking further into this issue. I've created this repo with examples of different ways of running tests:
https://github.com/pal-robotics/ros_testing_experiments

With the kinetic-devel branch, I'm not seeing a uniform behaviour with regards to the handling of the log output of the tests:

I am testing four cases, the bold text is the name I'll use:
cpp_test: C++ gtest
cpp_rostest: C++ gtest executed within rostest
py_test: Python test
py_rostest: Python test executed within rostest

Running the tests with make run_tests I have the following behaviour:

test stdout stderr log info log warn log error
cpp_test terminal terminal terminal terminal terminal
py_test - terminal - - -
cpp_rostest ~/.ros/log terminal ~/.ros/log ~/.ros/log terminal
py_rostest rosunit xml rosunit xml rosunit xml rosunit xml rosunit xml
cpp_rostest --text terminal terminal terminal terminal terminal
py_rostest --text terminal terminal terminal terminal terminal

The - indicates that the logs could not be found.

With @talhaHavadar changes I see the same behaviour, but the generated XML are invalid (that was the cause of the test failure in #163).

@dirk-thomas Do you know if this is the actual behaviour or am I doing something wrong?
What would be the desired behaviour, and if I fixed it would it make it to kinetic?

From my understanding, at least cpp_rostest and py_rostest should have the same behaviour, and log onto the rosunit (or maybe rostest?) xml file. Regardless of what was requested in this issue.

And cpp_test and py_test should log everything to the terminal.

Finally, what was requested from this issue, it would be that cpp_rostest and py_rostest also logged to the terminal while still creating an xml with the result for parsers such as jenkins.

from ros.

dirk-thomas avatar dirk-thomas commented on September 13, 2024

Please consider to contribute a pull request implementing this feature.

from ros.

talhaHavadar avatar talhaHavadar commented on September 13, 2024

is there any development going on about this issue?

from ros.

v-lopez avatar v-lopez commented on September 13, 2024

Not yet from our side.

We haven't discarded doing it, but it's not on our sights yet.

from ros.

talhaHavadar avatar talhaHavadar commented on September 13, 2024

Then I can start implementation of it if it is ok for you

from ros.

v-lopez avatar v-lopez commented on September 13, 2024

Sure, if you want a tester just let me know.

from ros.

talhaHavadar avatar talhaHavadar commented on September 13, 2024

I changed the super class of _XMLTestResult from 'unittest.TestResult' to 'unittest.TextTestResult'. And also updated the functions like 'startTest', 'stopTest', 'addError' etc. With this change we can write the output to the stdout while creating the xml. I need to do some spot checks to be sure it is working correctly then I will open a PR for this changes.

from ros.

progtologist avatar progtologist commented on September 13, 2024

Are you planning of making a PR with those changes?

from ros.

dirk-thomas avatar dirk-thomas commented on September 13, 2024

Closing due to inactivity.

from ros.

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.