Automated Testing/Unit testing/Continuous Integration?

Former Member
Former Member
Hi,

What does everyone do about unit testing for their connect IQ apps? Also what about integrating into a CI tool like Jenkins?

Thanks,
Ricky
  • I have unit tested most of my functional modules using a JUnit like framework I have developed.
    As Connect IQ lacks reflection, the tests are very Junit3 like. I have also worked on a new editor that would collect the needed information, but that is currently on pause as I don't have the time for it right now.

    I have also started development of a simple Maven plugin that will invoke monkeybrains to do the compilation. (I would have liked just to use the existing scripts and the ant-runner, but my CI environment in
    on a Linux machine and the scripts are not reporting back the proper information...). My main problem here is that the needed Garmin jars are not found on Maven Central, so they will have to be embedded in the plugin or downloaded on the fly.
  • Former Member
    Former Member over 10 years ago
    I have unit tested most of my functional modules using a JUnit like framework I have developed.
    As Connect IQ lacks reflection, the tests are very Junit3 like. I have also worked on a new editor that would collect the needed information, but that is currently on pause as I don't have the time for it right now.

    I have also started development of a simple Maven plugin that will invoke monkeybrains to do the compilation. (I would have liked just to use the existing scripts and the ant-runner, but my CI environment in
    on a Linux machine and the scripts are not reporting back the proper information...). My main problem here is that the needed Garmin jars are not found on Maven Central, so they will have to be embedded in the plugin or downloaded on the fly.


    How do you invoke the unit tests?
  • Former Member
    Former Member over 10 years ago
    I write my code in EcmaScript 6 and tests it in the browser http://bigheartfield.appspot.com/simulator/tests.html
    When i deploy i translate the ES6 files to monkeyc.
  • How do you invoke the unit tests?


    Well, that is the stupid part...

    Currently I have a separate ConnectIQ project and simply copy over the needed files.

    The unit tests are then invoked directly from App.onStart(state)... I intend to add to this so it will be a proper app in the end.
    If all tests succeed then it writes "SUCCESS" on the stdout.
    Otherwise it writes the exception...

    The mentioned maven plugin will then use a special special directory with the test sources as you normally see when you use Maven for Java projects.

    So the directory structure will something like:

    <base>
    - manifest.mf
    - resources*/*
    - sources/*.mc
    - tests/manifest.mf (auto-generated if not present)
    - tests/sources/*.mc

    I hope I will have the time for this within the next few months...
  • Former Member
    Former Member over 10 years ago
    Well, that is the stupid part...

    Currently I have a separate ConnectIQ project and simply copy over the needed files.

    The unit tests are then invoked directly from App.onStart(state)... I intend to add to this so it will be a proper app in the end.
    If all tests succeed then it writes "SUCCESS" on the stdout.
    Otherwise it writes the exception...

    The mentioned maven plugin will then use a special special directory with the test sources as you normally see when you use Maven for Java projects.

    So the directory structure will something like:

    <base>
    - manifest.mf
    - resources*/*
    - sources/*.mc
    - tests/manifest.mf (auto-generated if not present)
    - tests/sources/*.mc

    I hope I will have the time for this within the next few months...


    Thanks that makes sense.

    Yeah sharing of the sources will be interesting... there's no notion of libraries. I guess symlinking would work in the short term.
  • Former Member
    Former Member over 10 years ago
    How do you translate ES6 to MonkeyC?
  • how do you translate es6 to monkeyc?


    "es6"?
  • Hi!

    I know this is an old thread. But I have written an article on the subject. It doesn't include anything about tests yet, but I'm working on adding support for it.

    You can find the article here: https://jokarls.github.io/post/donkeybrains/