Comments (4)
@ctron thanks for the pointers! Hmm, this is odd because my code is calling set_system_out
. It appears the library I am using only uses system-out
for successes: https://github.com/bachp/junit-report-rs/blob/36c3093e7c3c049fb5dc4aa77657938ea8c5ea1e/src/reports.rs#L104-L149
Could you share a sample input/expected-output pair?
from cargo2junit.
Sure, here is an example: test-output.zip
It contains the raw output (mostly JSON). The markdown of our report generator (with the expected output rendered) and the file generated by cargo2junit.
from cargo2junit.
@ctron Happy New Year! I looked at the output from your zip (thanks!) and I'm only seeing the string stderr
inside the stdout
field from cargo. Reformatted:
{
"type": "test",
"name": "tests::registry::test_registry_create_and_delete",
"event": "failed",
"exec_time": 7.918437536,
"stdout": "[2021-09-17T08:19:49Z INFO drogue_cloud_tests::init::drg] Endpoints: Object({\n \"api\": String(\n \"http://api.172.18.0.2.nip.io\",\n ),\n \"console\": String(\n \"http://console.172.18.0.2.nip.io\",\n ),\n \"issuer_url\": String(\n \"http://sso.172.18.0.2.nip.io/auth/realms/drogue\",\n ),\n \"registry\": Object({\n \"url\": String(\n \"http://api.172.18.0.2.nip.io\",\n ),\n }),\n \"sso\": String(\n \"http://sso.172.18.0.2.nip.io\",\n ),\n })\n[2021-09-17T08:19:53Z INFO drogue_cloud_tests::init::drg] Refresh token: REDACTED\n[2021-09-17T08:19:53Z INFO drogue_cloud_tests::init::drg] Running: \"drg\" \"context\" \"delete\" \"system-tests\"\n[2021-09-17T08:19:53Z INFO drogue_cloud_tests::init::drg] Output: Ok(Output { status: ExitStatus(ExitStatus(0)), stdout: \"\", stderr: \"\" })\n[2021-09-17T08:19:53Z INFO drogue_cloud_tests::init::drg] Running: \"drg\" \"login\" \"http://api.172.18.0.2.nip.io/\" \"-t\" \"REDACTED\" \"--context\" \"system-tests\"\n[2021-09-17T08:19:53Z INFO drogue_cloud_tests::init::drg] Output: Ok(Output { status: ExitStatus(ExitStatus(0)), stdout: \"\\nSuccessfully authenticated to drogue cloud : http://api.172.18.0.2.nip.io/\\nSwitched active context to: system-tests\\n\", stderr: \"\" })\n[2021-09-17T08:19:54Z INFO drogue_cloud_tests::resources::apps] Create application: fbdc3442-654f-4f1e-b5d0-dbdd09966c88\n[2021-09-17T08:19:54Z INFO drogue_cloud_tests::init::drg] Running: \"drg\" \"create\" \"app\" \"fbdc3442-654f-4f1e-b5d0-dbdd09966c88\"\n[2021-09-17T08:19:54Z INFO drogue_cloud_tests::init::drg] Output: Ok(Output { status: ExitStatus(ExitStatus(0)), stdout: \"App fbdc3442-654f-4f1e-b5d0-dbdd09966c88 created.\\n\", stderr: \"\" })\n[2021-09-17T08:19:54Z INFO drogue_cloud_tests::init::drg] Running: \"drg\" \"get\" \"app\" \"fbdc3442-654f-4f1e-b5d0-dbdd09966c88\"\n[2021-09-17T08:19:54Z INFO drogue_cloud_tests::init::drg] Output: Ok(Output { status: ExitStatus(ExitStatus(0)), stdout: \"{\\n \\\"metadata\\\": {\\n \\\"creationTimestamp\\\": \\\"2021-09-17T08:19:54.540768Z\\\",\\n \\\"generation\\\": 0,\\n \\\"name\\\": \\\"fbdc3442-654f-4f1e-b5d0-dbdd09966c88\\\",\\n \\\"resourceVersion\\\": \\\"c180b095-f016-4293-bd14-389fd64acefc\\\",\\n \\\"uid\\\": \\\"4e554a97-8ede-4a5b-9efd-ad1182a69767\\\"\\n }\\n}\", stderr: \"\" })\n[2021-09-17T08:19:55Z INFO drogue_cloud_tests::init::drg] Running: \"drg\" \"get\" \"app\" \"fbdc3442-654f-4f1e-b5d0-dbdd09966c88\"\n[2021-09-17T08:19:55Z INFO drogue_cloud_tests::init::drg] Output: Ok(Output { status: ExitStatus(ExitStatus(0)), stdout: \"{\\n \\\"metadata\\\": {\\n \\\"creationTimestamp\\\": \\\"2021-09-17T08:19:54.540768Z\\\",\\n \\\"finalizers\\\": [\\n \\\"kafka\\\"\\n ],\\n \\\"generation\\\": 9,\\n \\\"name\\\": \\\"fbdc3442-654f-4f1e-b5d0-dbdd09966c88\\\",\\n \\\"resourceVersion\\\": \\\"b5b074e2-1d05-4bc3-ae22-6e047e058337\\\",\\n \\\"uid\\\": \\\"4e554a97-8ede-4a5b-9efd-ad1182a69767\\\"\\n },\\n \\\"status\\\": {\\n \\\"conditions\\\": [\\n {\\n \\\"lastTransitionTime\\\": \\\"2021-09-17T08:19:54.911921639Z\\\",\\n \\\"status\\\": \\\"True\\\",\\n \\\"type\\\": \\\"Ready\\\"\\n },\\n {\\n \\\"lastTransitionTime\\\": \\\"2021-09-17T08:19:54.911883970Z\\\",\\n \\\"status\\\": \\\"True\\\",\\n \\\"type\\\": \\\"KafkaReady\\\"\\n }\\n ],\\n \\\"kafka\\\": {\\n \\\"conditions\\\": [\\n {\\n \\\"lastTransitionTime\\\": \\\"2021-09-17T08:19:54.609800578Z\\\",\\n \\\"status\\\": \\\"True\\\",\\n \\\"type\\\": \\\"HasFinalizer\\\"\\n },\\n {\\n \\\"lastTransitionTime\\\": \\\"2021-09-17T08:19:54.618243467Z\\\",\\n \\\"status\\\": \\\"True\\\",\\n \\\"type\\\": \\\"CreateTopics\\\"\\n },\\n {\\n \\\"lastTransitionTime\\\": \\\"2021-09-17T08:19:54.691776793Z\\\",\\n \\\"status\\\": \\\"True\\\",\\n \\\"type\\\": \\\"TopicsReady\\\"\\n },\\n {\\n \\\"lastTransitionTime\\\": \\\"2021-09-17T08:19:54.709395537Z\\\",\\n \\\"status\\\": \\\"True\\\",\\n \\\"type\\\": \\\"CreateUser\\\"\\n },\\n {\\n \\\"lastTransitionTime\\\": \\\"2021-09-17T08:19:54.911855667Z\\\",\\n \\\"status\\\": \\\"True\\\",\\n \\\"type\\\": \\\"UserReady\\\"\\n },\\n {\\n \\\"lastTransitionTime\\\": \\\"2021-09-17T08:19:54.911857600Z\\\",\\n \\\"reason\\\": \\\"AsExpected\\\",\\n \\\"status\\\": \\\"True\\\",\\n \\\"type\\\": \\\"Reconciled\\\"\\n }\\n ],\\n \\\"observedGeneration\\\": 8,\\n \\\"user\\\": {\\n \\\"mechanism\\\": \\\"SCRAM-SHA-512\\\",\\n \\\"password\\\": \\\"azZ3Zl3y6j4J\\\",\\n \\\"username\\\": \\\"user-fbdc3442-654f-4f1e-b5d0-dbdd09966c88\\\"\\n }\\n }\\n }\\n}\", stderr: \"\" })\n[2021-09-17T08:19:55Z INFO drogue_cloud_tests::init::drg] Running: \"drg\" \"get\" \"app\" \"fbdc3442-654f-4f1e-b5d0-dbdd09966c88\"\n[2021-09-17T08:19:55Z INFO drogue_cloud_tests::init::drg] Output: Ok(Output { status: ExitStatus(ExitStatus(0)), stdout: \"{\\n \\\"metadata\\\": {\\n \\\"creationTimestamp\\\": \\\"2021-09-17T08:19:54.540768Z\\\",\\n \\\"finalizers\\\": [\\n \\\"kafka\\\"\\n ],\\n \\\"generation\\\": 9,\\n \\\"name\\\": \\\"fbdc3442-654f-4f1e-b5d0-dbdd09966c88\\\",\\n \\\"resourceVersion\\\": \\\"b5b074e2-1d05-4bc3-ae22-6e047e058337\\\",\\n \\\"uid\\\": \\\"4e554a97-8ede-4a5b-9efd-ad1182a69767\\\"\\n },\\n \\\"status\\\": {\\n \\\"conditions\\\": [\\n {\\n \\\"lastTransitionTime\\\": \\\"2021-09-17T08:19:54.911921639Z\\\",\\n \\\"status\\\": \\\"True\\\",\\n \\\"type\\\": \\\"Ready\\\"\\n },\\n {\\n \\\"lastTransitionTime\\\": \\\"2021-09-17T08:19:54.911883970Z\\\",\\n \\\"status\\\": \\\"True\\\",\\n \\\"type\\\": \\\"KafkaReady\\\"\\n }\\n ],\\n \\\"kafka\\\": {\\n \\\"conditions\\\": [\\n {\\n \\\"lastTransitionTime\\\": \\\"2021-09-17T08:19:54.609800578Z\\\",\\n \\\"status\\\": \\\"True\\\",\\n \\\"type\\\": \\\"HasFinalizer\\\"\\n },\\n {\\n \\\"lastTransitionTime\\\": \\\"2021-09-17T08:19:54.618243467Z\\\",\\n \\\"status\\\": \\\"True\\\",\\n \\\"type\\\": \\\"CreateTopics\\\"\\n },\\n {\\n \\\"lastTransitionTime\\\": \\\"2021-09-17T08:19:54.691776793Z\\\",\\n \\\"status\\\": \\\"True\\\",\\n \\\"type\\\": \\\"TopicsReady\\\"\\n },\\n {\\n \\\"lastTransitionTime\\\": \\\"2021-09-17T08:19:54.709395537Z\\\",\\n \\\"status\\\": \\\"True\\\",\\n \\\"type\\\": \\\"CreateUser\\\"\\n },\\n {\\n \\\"lastTransitionTime\\\": \\\"2021-09-17T08:19:54.911855667Z\\\",\\n \\\"status\\\": \\\"True\\\",\\n \\\"type\\\": \\\"UserReady\\\"\\n },\\n {\\n \\\"lastTransitionTime\\\": \\\"2021-09-17T08:19:54.911857600Z\\\",\\n \\\"reason\\\": \\\"AsExpected\\\",\\n \\\"status\\\": \\\"True\\\",\\n \\\"type\\\": \\\"Reconciled\\\"\\n }\\n ],\\n \\\"observedGeneration\\\": 8,\\n \\\"user\\\": {\\n \\\"mechanism\\\": \\\"SCRAM-SHA-512\\\",\\n \\\"password\\\": \\\"azZ3Zl3y6j4J\\\",\\n \\\"username\\\": \\\"user-fbdc3442-654f-4f1e-b5d0-dbdd09966c88\\\"\\n }\\n }\\n }\\n}\", stderr: \"\" })\n[2021-09-17T08:19:55Z INFO drogue_cloud_tests::init::drg] Running: \"drg\" \"delete\" \"app\" \"fbdc3442-654f-4f1e-b5d0-dbdd09966c88\"\n[2021-09-17T08:19:55Z INFO drogue_cloud_tests::init::drg] Output: Ok(Output { status: ExitStatus(ExitStatus(0)), stdout: \"App fbdc3442-654f-4f1e-b5d0-dbdd09966c88 deleted.\\n\", stderr: \"\" })\n[2021-09-17T08:19:55Z INFO drogue_cloud_tests::init::drg] Running: \"drg\" \"delete\" \"app\" \"fbdc3442-654f-4f1e-b5d0-dbdd09966c88\"\n[2021-09-17T08:19:55Z INFO drogue_cloud_tests::init::drg] Output: Ok(Output { status: ExitStatus(ExitStatus(0)), stdout: \"App fbdc3442-654f-4f1e-b5d0-dbdd09966c88 deleted.\\n\", stderr: \"\" })\nthread 'main' panicked at 'assertion failed: r.is_err()', src/tests/registry/mod.rs:53:5\n[2021-09-17T08:19:55Z INFO drogue_cloud_tests::resources::apps] Destroy application 'fbdc3442-654f-4f1e-b5d0-dbdd09966c88'\n[2021-09-17T08:19:55Z INFO drogue_cloud_tests::init::drg] Running: \"drg\" \"delete\" \"app\" \"fbdc3442-654f-4f1e-b5d0-dbdd09966c88\"\n[2021-09-17T08:19:55Z INFO drogue_cloud_tests::init::drg] Output: Ok(Output { status: ExitStatus(ExitStatus(0)), stdout: \"App fbdc3442-654f-4f1e-b5d0-dbdd09966c88 deleted.\\n\", stderr: \"\" })\n"
}
It looks like the test is running a process, collecting it's stdout
and stderr
and then outputting both of those to stdout
which cargo test
collects and reports. That is, cargo test
never sees anything output to stderr
. Am I reading that right?
from cargo2junit.
That could be the case, yes.
from cargo2junit.
Related Issues (20)
- Propagate exit code HOT 1
- Parse error on windows HOT 2
- Use Pipeline Caching in the build HOT 3
- Add execution time support HOT 3
- Can't navigate test cases in Jenkins
- JSON output format seems to have changed with Rust/Cargo 1.50 HOT 1
- No newline at the end of the XML output HOT 1
- Precompiled binaries HOT 2
- Also report file names HOT 3
- Please tag releases HOT 1
- Breaking change in v0.1.12 HOT 3
- Capability to sort by time?
- Error on tracing::info! event in unit tests HOT 1
- cargo2junit returns error if no tests are found HOT 1
- Breaking unit tests in test cases based on module. HOT 1
- Missing tags? HOT 1
- cargo2junit will stop working with Rust 1.70 HOT 11
- Problem with install HOT 1
- cargo2junit panics because of a failed assertion HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cargo2junit.