Giter Site home page Giter Site logo

Output goes into the wrong tag about cargo2junit HOT 4 OPEN

ctron avatar ctron commented on August 23, 2024
Output goes into the wrong tag

from cargo2junit.

Comments (4)

johnterickson avatar johnterickson commented on August 23, 2024

@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.

ctron avatar ctron commented on August 23, 2024

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.

johnterickson avatar johnterickson commented on August 23, 2024

@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.

ctron avatar ctron commented on August 23, 2024

That could be the case, yes.

from cargo2junit.

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.