Coder Social home page Coder Social logo

emilyst / vscode-test-explorer-diagnostics Goto Github PK

View Code? Open in Web Editor NEW
4.0 3.0 0.0 1.68 MB

A Visual Studio Code extension for Test Explorer UI which populates test outcomes as diagnostics in the Problems panel

License: MIT License

TypeScript 100.00%
vscode vscode-extension

vscode-test-explorer-diagnostics's Introduction

Test Explorer Diagnostics Controller

This repository contains the source code for the Test Explorer Diagnostics Controller extension for Visual Studio Code. It requires the Test Explorer extension.

Using the test states known to the Test Explorer, it populates diagnostics in Visual Studio Code. These appear in the Problems panel. See the screenshot below as an example.

Status

This extension should be considered early alpha. It should work, but I have barely tested it in various scenarios, and much remains to do.

To do

  • Handle retired test states fully.
  • Add suggestions for preferences in Test Explorer to set.
  • Discover proper ranges to provide diagnostics.
  • Custom extension icon.
  • Allow user to customize formatting of diagnostics.

vscode-test-explorer-diagnostics's People

Contributors

dependabot[bot] avatar emilyst avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

vscode-test-explorer-diagnostics's Issues

show testcases with errors or exceptions

Gratz on your new extension!

It looks like your extension only shows diagnostics for failed tests and not for errored tests (I know it's fresh out of the factory, and you might already have plans for these errors).
Would be nice if they showed up as diagnostics as well.
20200519_TestExplorerDiagnostics

I'm undecided if skipped testcases should show up in diagnostics.

support of tool-specific diagnostics

Thank you very much for your work, Emily! By coincedence this extension solves one of problems I have with my personal project. I've thought to make something similar myself, and it's really nice that I can focus on other tasks instead. Thank you very much indeed.

Would be nice if extension could also adress diagnostics specific for used unit-testing tool. It is especially useful for errored tests because, as I see it, error of test is an inherently tool-specific state. But it would be useful for other outcomes as well - tool can report warnings even if test passed.

Let me explain my use case: I work with ceedling test adapter (C language) and tests could be errored (currently they reported as failed, but I'm planning to fix it) if code syntax is wrong or if compilation or linking failed. Also I can get warnings if code is considered wrong but compiles anyway. All of these problems reported from used toolchain (GCC in my case) to stderr, which is then could be passed in TestEvent message field - as I understood from comment above this field it's intended for this exact purpose - reporting of problems.

VSC already has a mechanism for parsing such tool-specific problems - Tasks with problemMatchers. It's regex-based - output of tool is just scanned with regular expressions to find problems information - file, line, etc. Unfortunately it seems like it's not usable in this case (at least I've not figured a way to use it) - problemMatchers-related code is not accessible directly from extensions and Tasks are not not suitable because tool could be executed multiple times when running test suites - problems reported by Task would be cleared before each execution.

So, as I see it, the most proper way of implementing this would be to copy implementation of problemMatchers from VSC source code (it's in problemMatcher.ts file) to extension and make it configurable from extension settings. Algorithm is something like "if there is problem-matching patterns defined in extension settings, search for them in message field of every TestEvent and report diagnostics accordingly".

Now, why I think this should be in this extension rather than in tool-specific test adapters. First, adapters are not necessarily tool-specific - I use Ceedling tool, but I can swap underlying compiler and messages would be different. Second - if test adapters were handling their diagnostics themselves, this extension would not be needed, but it is - so it's only logical to implement this feature here.

Sorry for wall of text and thanks for your time. I intend to contribute btw.

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.