Adding in test task for nRF Connect with VS Code

Hello!

I am trying to add testing as a task for VS Code.

So far, I have tested with twister. I can add a new nRF Connect terminal and run the python script to test on hardware.

Now, I would like to add this process as a task, but I'm not sure what to do to add the nRF Connect shell as the executable:

Is there anyway to create a task which invokes commands from the nRF Connect terminal?

Or is there a better method of testing which uses nRF Connect for VS Code?

Thanks!

Parents
  • Hi Rahul,

    I have asked internally whether there is a recommended way to invoke Twister through the VS Code extension, but I have yet to receive an answer (there might be nothing better).

    Meanwhile, could you try using the following as the executable?

    C:\ncs\toolchains\v2.3.0\git-bash.exe

    Alternatively: This "generate environment script" option has been added to the nRF Connect Toolchain Manager recently (you might have to update nRF Connect for Desktop first). It creates a shell script that sets your environment variables. So you could try adding your shell of preference as the executable in your task, and then try executing this shell script, with a call to Twister added at the end.

    Let me know if one of those options work!

    Best regards,

    Raoul

Reply
  • Hi Rahul,

    I have asked internally whether there is a recommended way to invoke Twister through the VS Code extension, but I have yet to receive an answer (there might be nothing better).

    Meanwhile, could you try using the following as the executable?

    C:\ncs\toolchains\v2.3.0\git-bash.exe

    Alternatively: This "generate environment script" option has been added to the nRF Connect Toolchain Manager recently (you might have to update nRF Connect for Desktop first). It creates a shell script that sets your environment variables. So you could try adding your shell of preference as the executable in your task, and then try executing this shell script, with a call to Twister added at the end.

    Let me know if one of those options work!

    Best regards,

    Raoul

Children
  • Hello Raoul,

    Thanks for the response. So far, I have found the best approach is within an nRF Terminal instance in VS Code to call a windows script which then invokes Twister to test and provide coverage. 

    I can get it potentially work with the git-bash approach assuming python was setup there, but I didn't want to go through the hassle if I could just use the nRF Connect terminal. At a later time, I will try out the git bash approach and with environment variables with python to see if that can help.

    Thanks!

Related