Skip to content

Commit

Permalink
Merge pull request #292 from TypedDevs/release/0-14-0
Browse files Browse the repository at this point in the history
Release 0.14.0
  • Loading branch information
Chemaclass authored Jul 14, 2024
2 parents 8a76271 + a8455b5 commit dace6d9
Show file tree
Hide file tree
Showing 8 changed files with 105 additions and 5 deletions.
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
# Changelog

## [Unreleased](https://github.com/TypedDevs/bashunit/compare/0.13.0...main)
## [Unreleased](https://github.com/TypedDevs/bashunit/compare/0.14.0...main)

- Nothing yet...

## [0.14.0](https://github.com/TypedDevs/bashunit/compare/0.13.0...0.14.0) - 2024-07-14

- Fix echo does not break test execution results
- Add bashunit facade to enable custom assertions
- Document how to verify the `sha256sum` of the final executable
- Generate checksum on build
- Enable display execution time on macOS with `SHOW_EXECUTION_TIME`
- Support for displaying the clock without `perl` (for non-macOS)
- Enable strictmode
- Enable strict mode
- Add `-l|--log-junit <log.xml>` option
- Add `-r|--report-html <report.html>` option
- Add `--debug` option
Expand Down
2 changes: 1 addition & 1 deletion bashunit
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set -euo pipefail

# shellcheck disable=SC2034
declare -r BASHUNIT_VERSION="0.13.0"
declare -r BASHUNIT_VERSION="0.14.0"

# shellcheck disable=SC2155
declare -r BASHUNIT_ROOT_DIR="$(dirname "${BASH_SOURCE[0]}")"
Expand Down
96 changes: 96 additions & 0 deletions docs/blog/2024-07-14-release-0-14.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
---
date: '2024-07-14'
title: 'Release 0.14'
description: 'Adding features such as HTML report, logger (JUnit XML), strict mode, SHA-256 checksum validation, custom asserts, and other improvements.'
coverUrl: '/covers/2024-07-14-release-0-14.png'
coverAlt: 'bashunit integrated into PHPStan'

aside: false
---

# {{ $frontmatter.title }}

<time>{{ $formatDate($frontmatter.date) }}</time>

## 🐛 Bug fixes

- Fixed `SHOW_EXECUTION_TIME` on macOS [#282](https://github.com/TypedDevs/bashunit/pull/282)
- Fix `echo` breaks test execution results [#275](https://github.com/TypedDevs/bashunit/pull/275)

## 🏗️ New features

### Logger (JUnit XML)

- Docs: <a href="/command-line#logging">Command line: Logging</a>
- PR: [#279](https://github.com/TypedDevs/bashunit/pull/279)

`./bashunit -l|--log-junit <log.xml>`

Create a report XML file that follows the JUnit XML format and contains information about the test results of your bashunit tests.

<img src="/imgs/2024-07-14/log-junit-demo.png" width="100%">

### Report HTML

- Docs: <a href="/command-line#report">Command line: Report</a>
- PR: [#281](https://github.com/TypedDevs/bashunit/pull/281)

`./bashunit -r|--report-html <report.html>`

Create a report HTML file that contains information about the test results of your bashunit tests.

<img src="/imgs/2024-07-14/report-html-demo.png" width="100%">

### Debug mode

- Docs: <a href="/command-line#debug">Command line: Debug</a>
- PR: [#290](https://github.com/TypedDevs/bashunit/pull/290)

`./bashunit --debug`

Enables a shell mode in which all executed commands are printed to the terminal. Printing every command as executed may help you visualize the script's control flow if it is not working as expected.

<img src="/imgs/2024-07-14/debug-demo.png" width="100%">

### Custom asserts

- Docs: <a href="/custom-asserts">Custom asserts</a>
- PR: [#276](https://github.com/TypedDevs/bashunit/pull/276)

You can extend the language by building your custom assertions. It is ideal for custom domain assertions, which don't need to be in the core library.

```bash [Example]
# Your custom assert using the bashunit facade
function assert_foo() {
local actual="$1"

if [[ "foo" != "$actual" ]]; then
bashunit::assertion_failed "foo" "$actual"
return
fi

bashunit::assertion_passed
}

# Your test using your custom assert
function test_assert_foo_passed() {
assert_foo "foo"
}
```

### Checksum validation

- Docs: <a href="/installation#verify">Installation: Verify</a>
- PR: [#278](https://github.com/TypedDevs/bashunit/pull/278) [#287](https://github.com/TypedDevs/bashunit/pull/287)

Security is an important aspect of FOSS. Therefore, we will help ensure that there is an easy way to validate the executable for each official release by publishing the SHA-256 hash in a file and on the GitHub release page.

## 🌾 Miscellaneous

- Enable strict mode [#239](https://github.com/TypedDevs/bashunit/pull/239) [#241](https://github.com/TypedDevs/bashunit/pull/241) [#285](https://github.com/TypedDevs/bashunit/pull/285)
- Add `dump` and `dd` functions for local development debugging [#286](https://github.com/TypedDevs/bashunit/pull/286)
- Improve build [#289](https://github.com/TypedDevs/bashunit/pull/289)

---

See the full changelog in <a href="https://github.com/TypedDevs/bashunit/blob/main/CHANGELOG.md">GitHub</a>
Binary file added docs/public/covers/2024-07-14-release-0-14.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/public/imgs/2024-07-14/debug-demo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/public/imgs/2024-07-14/log-junit-demo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/public/imgs/2024-07-14/report-html-demo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "bashunit-docs",
"version": "0.13.0",
"checksum": "6d9f1b49e4cf61d9837277251cce566eaa8b73e0f417474949a48336bd43a901",
"version": "0.14.0",
"checksum": "84822a2f2d3a84646abad5fe26e6d49a952c6e5ea08e3752443d583346cc4d56",
"description": "Docs for bashunit a simple testing library for bash scripts",
"main": "index.js",
"repository": "[email protected]:TypedDevs/bashunit.git",
Expand Down

0 comments on commit dace6d9

Please sign in to comment.