Skip to content

Latest commit

 

History

History
78 lines (62 loc) · 3.06 KB

DEV_README.md

File metadata and controls

78 lines (62 loc) · 3.06 KB

Developing with Visual Studio Code + devcontainer

The easiest way to get started with custom integration development is to use Visual Studio Code with devcontainers. This approach will create a preconfigured development environment with all the tools you need.

Prerequisites

More info about requirements and devcontainer in general

Getting started:

  1. Fork the repository.
  2. Clone the repository to your computer.
  3. Copy the devcontainer-template.json to .devcontainer.json in the root directory
  4. Edit the .devcontainer.json depending on podman or docker
  5. Re-Open the repository using Visual Studio code.

NOTE: Podman requires additional setup to tell VS Code that you are using Podman and not Docker.

When you open this repository with Visual Studio code you are asked to "Reopen in Container", this will start the build of the container.

If you don't see this notification, open the command palette and select Remote-Containers: Reopen Folder in Container.

Step by Step debugging

You can run the Unit Tests or if you open the Main Folder you can use Run->Start Debugging to debug the main folder, but to do this effectively you need to have a launch.json file in your .vscode folder. this is an example for debuging using the main command line function.

This will also disable coverage reporting in the testing within VS Code.

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python: Debug Tests",
            "type": "python",
            "request": "launch",
            "program": "${file}",
            "purpose": [
                "debug-test"
            ],
            "console": "integratedTerminal",
            "justMyCode": true,
            "env": {
                "PYTEST_ADDOPTS": "--no-cov"
            },
            "args": [
                "get",
                "--user",
                "demo",
                "--password",
                "mt-demo",
                "--api-ver",
                "v1",
                "data",
                "0",
                "1"
            ]
        },
        {
            "name": "Python: Attach using Process Id",
            "type": "python",
            "request": "attach",
            "processId": "${command:pickProcess}",
            "justMyCode": true
        }
    ]
}