Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/rokucommunity/rooibos int…
Browse files Browse the repository at this point in the history
…o release-6.0.0
  • Loading branch information
TwitchBronBron committed Oct 3, 2024
2 parents 14a5828 + e2d2a57 commit 9d9a1d4
Show file tree
Hide file tree
Showing 8 changed files with 234 additions and 126 deletions.
10 changes: 8 additions & 2 deletions bsc-plugin/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- the versioning for the 6.0.0 alphas will align with the version of brighterscript v1 alpha that it supports.


#### [v5.14.0](https://github.com/rokucommunity/rooibos/compare/v6.0.0-alpha.38...v5.14.0)
> 1 October 2024
#### [5.13.0](https://github.com/rokucommunity/rooibos/compare/5.12.0...5.13.0)
- Adds a CLI to Rooibos (current version) [`#295`](https://github.com/rokucommunity/rooibos/pull/295)

#### [v5.13.0](https://github.com/rokucommunity/rooibos/compare/5.12.0...v5.13.0)

> 12 September 2024
- chore(deps): bump luxon from 1.28.0 to 1.28.1 [`#210`](https://github.com/rokucommunity/rooibos/pull/210)
- Fixed a bug where scope validations where incomplete for node tests [`#280`](https://github.com/rokucommunity/rooibos/pull/280)
Expand All @@ -26,8 +32,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Allow custom test reporter [`#265`](https://github.com/rokucommunity/rooibos/pull/265)
- Fixed logs sometimes getting cut off at the end of running tests [`#279`](https://github.com/rokucommunity/rooibos/pull/279)
- Adjust implementation to fit with new proposal [`599e6ce`](https://github.com/rokucommunity/rooibos/commit/599e6ce0e02bd16f5ca6bc06ab16bb2a7ec8d1e2)
- chore: release v5.13.0 [`6c56e29`](https://github.com/rokucommunity/rooibos/commit/6c56e290073e0b707f174a978c1d7757e834ecb8)
- Switch reporter API to conform to new spec proposal, add `onBegin` and `onEnd` [`54aa936`](https://github.com/rokucommunity/rooibos/commit/54aa936382786b35823406b7d14e9d7a47f8f227)
- Tweak reporter method signature to accept event AA [`c2f0b2f`](https://github.com/rokucommunity/rooibos/commit/c2f0b2fb1ec0e5ebc1dcb164802542636f78499f)

#### [5.12.0](https://github.com/rokucommunity/rooibos/compare/5.11.0...5.12.0)

Expand Down
41 changes: 21 additions & 20 deletions bsc-plugin/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion bsc-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"publish-npm": "npm run test && npm publish",
"publish-npm:beta": "npm run test && npm publish --tag=beta",
"local": "ts-node scripts/install-local.js",
"remote": "ts-node scripts/install-npm.js"
"remote": "ts-node scripts/install-npm.js",
"cli": "ts-node src/cli.ts"
},
"repository": {
"type": "git",
Expand Down
1 change: 0 additions & 1 deletion bsc-plugin/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ let options = yargs
async function main() {
let currentErrorCode = 0;
let bsconfigPath = options.project ?? 'bsconfig.json';

console.log(`Using bsconfig: ${bsconfigPath}`);

const rawConfig: BsConfig = util.loadConfigFile(bsconfigPath);
Expand Down
34 changes: 31 additions & 3 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Simple, mocha-inspired, flexible, fun Brightscript test framework for ROKU apps
- [Incorporate your own util methods](#incorporate-your-own-util-methods)
- [Hook into your global setup mechanisms](#hook-into-your-global-setup-mechanisms)
- [Only show output for failed tests](#only-show-output-for-failed-tests)
- [Simple Command Line Interface](#command-line-interface)
- [Easily integrate into any CI system](#easily-integrate-into-any-ci-system)
- [Generate code coverage](#generate-code-coverage)

Expand All @@ -36,6 +37,7 @@ Simple, mocha-inspired, flexible, fun Brightscript test framework for ROKU apps
- [Using mocks and stubs](#using-mocks-and-stubs)
- [API reference](https://rokucommunity.github.io/rooibos)
- [assertion reference](https://rokucommunity.github.io/rooibos/module-BaseTestSuite.html)
- [Command Line Interface (CLI)](#command-line-interface)
- [Integrating with your CI](#integrating-with-your-ci)
- [Advanced Setup](#advanced-setup)
- [Code coverage](#generate-code-coverage)
Expand Down Expand Up @@ -949,14 +951,40 @@ m.expectCalled(videoService.getVideos, someJson, true)

Note, you can also opt to disable the error at the whole test suite level; by setting `m.allowNonExistingMethods = true` in your test suite code.

## Command Line Interface
<a name="simple-cli"></a>
Rooibos includes a simple CLI that can be used to run the tests on a Roku Device
from the command line.

To use the CLI, you call it with references to the `bsconfig.json` file defining your test project, and the host and password of a Roku device that is in developer mode:

```
npx rooibos --project=<path_to_bsconfig.json> --host=<host> --password=<password>
```

The test runner CLI will:
1. build the app as defined in the given `bsconfig.json` file
2. deploy the app the Roku device specified
3. send the Roku's console output to `stdout`
4. exit with status `0` on success, or `1` on failure.


## Integrating with your CI
<a name="easily-integrate-into-any-ci-system"></a>
Rooibos does not have special test runners for outputting to files, or uploading to servers. However, that will not stop you integrating with your CI system.
Rooibos CLI can be used directly in your CI process.

An example make target might look like

```
continuousIntegration: build
echo "Running Rooibos Unit Tests"
npx rooibos --project=<test project bsconfig.json> --host=${ROKU_DEV_TARGET} --password=${ROKU_DEV_PASSWORD}
```

Because the test output has a convenient status at the end of the output, you can simply parse the last line of output from the telnet session to ascertain if your CI build's test succeeded or failed.
Alternately, you can manually deploy the app after it has been built, and check the output. Because the test output has a convenient status at the end of the output, you can simply parse the last line of output from the telnet session to ascertain if your CI build's test succeeded or failed.

Note that rooibos doesn't need any special parameters to run. If you follow the standard setup the tests will run. Simply ensure that your build system includes, or does not include rooibosDist.brs (and better still, _all_ of your tests), depending on whether you wish to run the tests or not.
Note that Rooibos doesn't need any special parameters to run. If you follow the standard setup the tests will run. Simply ensure that your build system includes, or does not include rooibosDist.brs (and better still, _all_ of your tests), depending on whether you wish to run the tests or not.

An example make target might look like

Expand Down
Loading

0 comments on commit 9d9a1d4

Please sign in to comment.