Skip to content

[Issue 64] Add support for running multiple unit tests frameworks#65

Open
Cazacu Tudor (cazacutudor) wants to merge 5 commits intowillowtreeapps:masterfrom
cazacutudor:issue-64
Open

[Issue 64] Add support for running multiple unit tests frameworks#65
Cazacu Tudor (cazacutudor) wants to merge 5 commits intowillowtreeapps:masterfrom
cazacutudor:issue-64

Conversation

@cazacutudor
Copy link
Copy Markdown
Contributor

Related to issue #64

This pull request will remove the old test running implementation and adds possibility to create you own by an custom js script. That's add flexibility, so you can make any unit test running configuration you want.

Setup:

  1. You need to define your script:
    /scripts/runTests.js
const child_process = require('child_process')

const args = process.argv.slice(2)
const ip = args[0] // the roku device ip given as an argument by ukor

// main function call
main()

function main() {
    child_process.execSync(`npx rooibosC -c ./.rooibosrc.json`)
    child_process.execSync(`curl -d '' "http://${ip}:8060/launch/dev?RunTests=true"`)
}
  1. Add the path to your script to ukor.properties.yaml
...
buildDir: build
sourceDir: src
preBuild: scripts/preBuild.js

runUnitTestsScript: scripts/runTests.js
  1. Run command
ukor test [flavor] [device]

After running the test command, ukor will deploy the channel on given device.
Once the channel is deployed, ukor starts to run the runTests.js script with the device ip as argument.

You can get ip inside of runTests.js by:

const args = process.argv.slice(2)
const ip = args[0] // the roku device ip given as an argument by ukor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant