New process and guidelines for integration tests (replaces `demo-project` and `homepage_sample_code` tests in GitLab CI
See original GitHub issueFrom a call with @tayloramurphy and @DouweM, we started thinking of replacing demo-project
with a set of sample Meltano projects in meltano/meltano
that can serve as integration tests, perhaps along with specific scripts that would run - such as the invoking of specific plugins.
I’m sure there are better and more sophisticated approaches, but one approach would be a convention have a meltano.yml
, a script.sh
, and a meltano.after.yml
which should match to the results. Another approach would be a set of pytest tests that perform a series of operations against (a copy of?) the source meltano.yml
file and confirm the results (or errors), possibly including specific telemetry events that are expected to be sent over the course of those script commands.
Issue Analytics
- State:
- Created a year ago
- Reactions:5
- Comments:17 (11 by maintainers)
Top GitHub Comments
We’ve chatted a bit in the past about having more examples in the docs as well, and we had some issues with doc drift leading up 2.0. I’ve been thinking about that a bit and wanted to float an idea. Using a setup like @aaronsteers described, I think we can actually kill two birds with one stone.
We can get more examples for users - that are actually maintained and always work, and new and improved integration tests. The only real change would be that instead of having a
script.sh
file, we treat our test orchestrations as living and usable Markdown docs. Users can use them as examples, and we can use them as scripts to execute via mdsh.Contrived example, but if you wanted test and document how to transition from using
elt
torun
you might have something like:Compiling this via mdsh will yield a bash script that we can invoke from our integration tests:
So we could structure our tests something like:
Where validation.sh compiles the md, executes it (just like the script.sh in @aaronsteers original proposal), and performs any additional needed validation steps (diffing files, greping log lines for matches, etc).
@aaronsteers @afolson curious how y’all feel about this. It would basically guarantee that our example library always works, and since all these come with a meltano.yml, users can download them and actually follow along.
@pandemicsyn - Ditto what @tayloramurphy said. Your proposal checks all the boxes I was looking for (plus a few more):
meltano.yml
of each case.validation.sh
) that each sample can use for custom validation.meltano.yml
that ensures the project is exactly as we expect it to be after all operations are completed. (For instance, would catchconfig
landing in the wrong place even if all other behaviors were functioning as expected.)meltano.yml
to validate against JSON Schema rules.In short, I love it. I especially love your proposal to use something like
mdsh
, since that basically makes these dual-purpose tests and tutorials. 👌