Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

cazacutudor
Copy link
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