Hi all, We have a couple taps we’ve developed with...
# singer-tap-development
a
Hi all, We have a couple taps we’ve developed with the SDK. Now we’re at the point that we want to write unit tests for each tap (building on top of
test_core.py
) and have these unit tests run during CI. My question: what is the best way to do this? Ideally, these would all run in the meltano-generated virtual environments so dependencies are clearly defined. Any thoughts?
I was hoping that the meltano cli would allow for executing within respective virtual environments with something like
Copy code
meltano invoke tap-tap:pytest
But I don’t think there’s any other executable/command than the tap producer itself.
a
Hi, @alex_levene - Are you hoping to write integration tests, with a target from another virtual environment, or just unit tests, where you'd be simply invoking the pytest suite?
If you just want to expand the pytest suites in your taps, you can add more tests within the
tests
folder. Otherwise, for keeping virtual environments isolated, the poetry/meltano combo should do that for you automatically if you want to run pipelines which combine multiple tap/target combinations as described in meltano.yml.
a
We’re just focused on unit tests right now. We opted for using a
setup.py
pattern instead of poetry so we could have editable installs for development (and because it’s what we’re used to)
If you just want to expand the pytest suites in your taps, you can add more tests within the 
tests
 folder.
After the tests are added, do you have a recommendation for how to enter the respective virtual env for each custom tap in the project (sourced from project/extract directory) and execute the pytest suite against it?