Skip to content

logmanoriginal/Caraya-JUnit-for-Azure-Pipelines

Repository files navigation

Contributors Forks Stargazers Issues Build Status BSD-3-Clause License


Logo

Caraya JUnit for Azure Pipelines

Use Caraya to generate JUnit test reports for Azure Pipelines.
Explore the docs »

View Demo
Report Bug
Request Feature

About The Project

Caraya JUnit for Azure Pipelines is an extension for Caraya that generates JUnit test reports compatible with Azure Pipelines. Test reports are generated according to the JUnit result format and can be published to Azure Pipelines using the Publish Test Results v2 task.

Caraya already includes JUnit support. Why do we need another JUnit extension for Azure Pipelines?

Here are a few reasons:

  • Azure Pipelines does not display test suites
    This is a known issue and there is a suggestion to fix it. Please vote for it 💖

  • Assertion labels are indistinguishable
    By default Caraya uses the Assertion VI name when the assertion label is empty (which it is by default). For example, "Assert Equal Value_Variant". This label is not very helpful, especially the in the default view.

    Run View

    File view is a little more readable.

    File View

  • Test duration for all test cases is zero
    By default, the test duration of a test case in Caraya is zero unless the user explicitly monitors the test duration and provides it to the assertion function.

  • Error message and stack trace are meaningless
    The default JUnit report produces meaningless error messages and stack traces. A typical failure has the error message "test failure" and stack trace "FAIL".

    Test Details

  • Not executed assertions are reported as skipped
    When an error is passed to an assertion function, it is reported as "skipped" in the default JUnit report. That was probably a design decision. Skipped tests, however, do not count towards failed tests in Azure Pipelines. They simply appear under "others" (just like disabled tests).

    Skipped Tests

Why not improve the JUnit test report of Caraya?

I've thought about it and decided against it because the differences introduced by this project would likely be considered breaking changes by other users.

How does this project improve test reports in Azure Pipelines?

This project is build from scratch and aims at providing useful test reports in Azure Pipelines. Here are a few things it improves:

  • Test results are reported with their fully qualified name
    This makes the default view much more verbose.

    Run View

  • Test duration is calculated for every test case
    Test duration is calculated from the timestamp of each assertion. User specified test durations still take precedence, of course.

  • Meaningful error messages and stack traces are reported
    This extension tries its best to figure out the best error message and stack trace for a failure, based on assertion results and errors.

    Failure Details

  • Any failure is considered a failed test
    This includes errors passed to an assertion function as well as any error reported by an assertion. Tests are only considered skipped when no error occurred and the assertion was not executed.

    Failed Tests

Built With

Getting Started

To get a local copy up and running follow these simple steps.

Prerequisites

  • LabVIEW™ 2013 or later
  • VI Package Manager

Installation

  1. Clone the repo
    git clone https://github.com/logmanoriginal/caraya-junit-for-azure-pipelines.git
  2. Install packages
    start .vipc
    Or apply .vipc manually.

Usage

Here is an example that uses the JUnit report generator to create a test report for a project.

Example

Roadmap

See the open issues for a list of proposed features (and known issues).

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Keep in mind that LabVIEW™ VIs are binary files, which are difficult to merge.

  • Only change a single VI or library.
  • Avoid conflicts with other pull requests (don't work on the same libraries or VIs).
  • Send VI Snippets (via issues) instead of pull requests when possible.

License

Distributed under the BSD-3-Clause License. See LICENSE for more information.

Contact

Project Link: https://github.com/logmanoriginal/caraya-junit-for-azure-pipelines

Acknowledgements