In creating new Singer Taps using the Meltano SDK, it's not always clear how to setup testing in VS Code.
What's the best way to get the VS Code test features working?
In creating new Singer Taps using the Meltano SDK, it's not always clear how to setup testing in VS Code.
What's the best way to get the VS Code test features working?
Copyright © 2021 Jogjafile Inc.
First Method: Unit testing with VS Code "Tests" pane
This method makes unit tests (
pytesttests) easy to run in the VS Code "Tests" pane.Prereqs:
poetry installat least once.Once the above are complete, the "tests" pane should populate with the list of unit tests and you'll have an option in the VS Code GUI to "Run" or "Debug" each test.
Second Method: Integration test by actually invoking the tap
This method actually runs your tap and sends the output to
target-jsonor a similar sample target.Prereqs:
mainto the bottom of yourtap.pyto make it invocable:target-jsonlviapipx install target-jsonlor similar.Replace
tap_foobarwith the actual name of your tap's library and then paste this into VS Code'slaunch.json: