Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/kenherring/ablunit-test-runner

VSCode Extension to integrate OpenEdge ABLUnit tests via the native API
https://github.com/kenherring/ablunit-test-runner

openedge openedge-abl progress-openedge test-runner vscode vscode-extension vscode-test vscode-test-explorer

Last synced: 5 days ago
JSON representation

VSCode Extension to integrate OpenEdge ABLUnit tests via the native API

Awesome Lists containing this project

README

        

# ABLUnit Test Runner ๐Ÿƒโ€โ™‚๏ธ๐Ÿƒ๐Ÿƒโ€โ™€๏ธ

[![CircleCI](https://img.shields.io/circleci/build/github/kenherring/ablunit-test-runner/main?logo=circleci)](https://dl.circleci.com/status-badge/redirect/gh/kenherring/ablunit-test-runner/tree/main)
[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=kenherring_ablunit-test-runner&metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=kenherring_ablunit-test-runner)
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=kenherring_ablunit-test-runner&metric=coverage)](https://sonarcloud.io/summary/new_code?id=kenherring_ablunit-test-runner)
[![VSCode Marketplace Version](https://img.shields.io/visual-studio-marketplace/v/kherring.ablunit-test-runner?include_prereleases&logo=visual%20studio%20code&logoColor=blue&color=blue)](https://marketplace.visualstudio.com/items?itemName=kherring.ablunit-test-runner)

The [ABLUnit Test Runner](https://github.com/kenherring/ablunit-test-runner/) extension for VSCode integrates [ablunit tests](https://docs.progress.com/bundle/openedge-developer-studio-help-122/page/Learn-About-ABLUnit-Test-Framework.html) into the test explorer.

## ๐ŸŒด Features

* Execute ABLUnit tests from the VSCode **Test Explorer View**
* Display test results in the VSCode **Test Results View**
* Color coded line coverage highlighting in the editor

### ๐Ÿ“ท Code Coverage Screenshot

![code coverage example screenshot](https://github.com/kenherring/ablunit-test-runner/raw/main/resources/images/coverage.png)

## ๐Ÿ“ Supported OpenEdge Versions

This project was developed using the [Progress OpenEdge Developers Kit: Classroom Edition](https://www.progress.com/openedge/classroom-edition). It was primarily tested with 12.8.0, but the unit tests are run for 12.2 and 12.8.4 during the CI builds too.

## โ›บ Configuration

Configuration is optional. Many workspaces will work without any configuration. However, there are advanced options available via the VSCode settings and a test profile configuration file (`.vscode/ablunit-test-profile.json`).

### ๐Ÿ“ Settings Configuration

The settings config allows for a few global options, described in more detail below. This example shows a test file glob pattern and another with a path to a dbconnections `.pf` file. The `ablunit.files.include` setting is required for the extension to find tests.

**`.vscode/settings.json` with include and exclude patterns**:

```json
{
"ablunit.files.include": [
"test/**/*Test.{cls,p}"
],
"ablunit.files.exclude": [
"src/sandbox/**"
]
}
```

**`.vscode/settings.json` with dbconnections `.pf` file**:

```json
{
"ablunit.files.include": [
"test/**/*Test.{cls,p}"
],
"ablunit.params": "-pf path/to/dbconnections.pf"
}
```

The following table gives a brief description of the available settings via the UI or `settings.json` files.

| Setting | Default | Description |
| --- | --- | --- |
| `ablunit.discoverAllTestsOnActivate` | `true` | Search all workspace files for tests on extension activation. It may be beneficial to disable this for large workspaces, in which case the extension will find tests as files are accessed. |
| `ablunit.files.include` | `[ "**/*.{cls,p}" ]` | Glob pattern array matching test files. |
| `ablunit.files.exclude` | `[ "**/.builder/**", "**/.pct/** ]` | Glob pattern array to exclude test files. |
| `ablunit.importOpenedgeProjectJson` | `true` | Import configuration settings from \`openedge-project.json\` when possible. |
| `ablunit.test.classlabel` | `classname` | The label format for test classes. Example for class with path `com/example/myClass.cls`:


  • class-type-name example: `com.example.myClass`

  • filename example: `myClass.cls`

|

### ๐Ÿงช Test Profile Configuration

The `.vscode/ablunit-test-profile.json` has additional configuration similar to [launch configurations](https://code.visualstudio.com/docs/editor/debugging#_launch-configurations).

A default profile is created when using the **ABLUnit: Configure Test Profile** command and selecting **ABLUnit - Run Tests**. This configuration has comments describing the options available.

**Note**: Only the first test profile will be imported. In the future this extension will allow for multiple entries.

### VSCode Configuration - Snippets

This extension includes a few snippets for test annotations and other related code you may find helpful. These can be removed from intellisense with standard VSCode functionality. See: [**VSCode Docs -> Snippets in Visual Studio Code
-> Can I remove snippets from intellisense?**](https://code.visualstudio.com/docs/editor/userdefinedsnippets#_can-i-remove-snippets-from-intellisense)

## ๐Ÿ‘ทโ€โ™‚๏ธ Contributing

See [CONTRIBUTING.md](.github/CONTRIBUTING.md)

## ๐Ÿ’ป Development

* `npm install`
* Make any changes you wish
* `npm test` or use the [Extension Test Runner](https://marketplace.visualstudio.com/items?itemName=ms-vscode.extension-test-runner)

## ๐Ÿ”— Links

* [VSCode Marketplace - ABLUnit Test Runner](https://marketplace.visualstudio.com/items?itemName=kherring.ablunit-test-runner)
* Progress Documentation
* [Run test cases from the command prompt](https://docs.progress.com/bundle/openedge-developer-studio-help/page/Run-test-cases-from-the-command-prompt.html)
* [Learn About ABLUnit Test Framework](https://docs.progress.com/bundle/openedge-developer-studio-help/page/Learn-About-ABLUnit-Test-Framework.html)
* [ABLUnit Annotations](https://docs.progress.com/bundle/openedge-developer-studio-help/page/Annotations-supported-with-ABLUnit.html)
* [PROFILER system handle](https://docs.progress.com/bundle/abl-reference/page/PROFILER-system-handle.html)
* [Profiler (-profile) startup parameter](https://docs.progress.com/bundle/openedge-startup-and-parameter-reference/page/Profiler-profile.html)
* GitHub Repo - [progress/ade](https://github.com/progress/ADE) - OpenEdge Source Files
* Docker Hub - Progress Software Corporation - [progresssoftware/prgs-oedb](https://hub.docker.com/r/progresssoftware/prgs-oedb)

## ๐Ÿค“ About Me

This is my first VSCode extension, and my first TypeScript project. I am sure there are many ways to improve the code, and I welcome any feedback. I'm also open to collaboration for anyone who might wish to contribute.

Quality code is my passion. Unit testing is an important component of ensuring code remains functional when future changes are made. I hope this extension helps others to embrace [TDD](https://en.wikipedia.org/wiki/Test-driven_development) and improve their code.