New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New process and guidelines for integration tests (replaces demo-project
and homepage_sample_code
tests in GitLab CI
#6218
Comments
@pandemicsyn, @WillDaSilva, @edgarrmondragon - This ties back to other conversations we've had recently. Curious for your thoughts/suggestions on this front. |
Relates to: |
I like that, with a good caching setup we should be able to run a bunch of them without waiting too long for results. I was thinking of a similar approach for testing #3322 since settings service unit tests don't seem to capture all the interactions. |
We can use this both to test the impact of certain commands on |
@aaronsteers I'm guessing you didn't intend to open this in the handbook repo, right? I'm quite supportive of this! |
@aaronsteers Yep, even in the simple approach, we can spin up a snowplow-micro instance, and configure meltano to point telemetry at it. Run our This setup can also fairly easily grow to accommodate automated UI browser tests I'd think. Including checking that js fired telemetry gets emitted as expected. |
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 Contrived example, but if you wanted test and document how to transition from using # transition-from-elt-to-run.md
This example shows how to transition an `etl` task with a custom state-id to a `job` executed via `run`.
To follow along with this example, download link to meltano yml to a fresh project and run:
```
meltano install
```
Then assuming you had an `elt` job invoked like so:
```shell
meltano elt --state-id=my-custom-id tap-gitlab target-postgres
```
You would first need to rename the id to match meltano's internal pattern:
```shell
meltano state copy my-custom-id tap-gitlab-to-target-postgres
```
Then you can create a job and execute it using `meltano run`:
```shell
meltano job add my-new-job --task="tap-gitlab target-postgres"
meltano run my-new-job
``` Compiling this via mdsh will yield a bash script that we can invoke from our integration tests: meltano install
meltano elt --state-id=my-custom-id tap-gitlab target-postgres
meltano state copy my-custom-id tap-gitlab-to-target-postgres
meltano job add my-new-job --task="tap-gitlab target-postgres
meltano run my-new-job 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 I love this idea. It would lend itself well to incremental adoption and support from the community as well. I'm supportive 👍 |
@pandemicsyn - Ditto what @tayloramurphy said. Your proposal checks all the boxes I was looking for (plus a few more):
In short, I love it. I especially love your proposal to use something like |
@aaronsteers Perfect, so next week then, I'll put the scaffolding in place and build out a 1st work guide/test. I think doing a kitchen sink/end to end walk through gives us the most bang for our buck testing wise, so I'd vote we start with that one, unless there's a specific scenario you'd prefer me to start with. Also, there's quite a few existing jsonschema validator actions/workflows, and also https://github.com/python-jsonschema/check-jsonschema which looks very robust. So, at first glance, adding a jsonschema check of our kitchen sink yaml seems like it wouldn't be much additional work. |
@pandemicsyn Overall I love this idea! Would it be easier on maintainers to put all of this in the |
@afolson nah, it's not a big deal. At some point, we might also have some tests that are internal to us and that we don't want to pollute the docs space with, and then those can live solely in |
@pandemicsyn Alright, sounds great! Let me know how I can help/review. |
@aaronsteers @afolson (and anyone else interested 😁 ). I've got a working PoC here: #6303 I think its almost a bit easier to grok this by looking at the branch, but tl;dr this ships two PoC integration tests:
Which results in a workflow run like: https://github.com/meltano/meltano/actions/runs/2578001545 When can shift this discussion over to the PR but I've got some open questions. Namely: When should these run ? We've got options!I don't think it makes sense to run these on every commit for every PR by default. I'd vote some combo of:
Optionally:
|
@tayloramurphy @aaronsteers ok so we've got this framework in place and we're running the basic tests for every PR. I've got a list of other tests cases we might want to start adding. Should I convert this issue to a discussion to use as a central place to collect tests cases (that y'all can then seed our backlog with when time permits), or would you prefer something else? |
@pandemicsyn either converting this or closing it and making a new discussion. I don't have a preference 👍 |
👍 closing in favor of: |
From a call with @tayloramurphy and @DouweM, we started thinking of replacing
demo-project
with a set of sample Meltano projects inmeltano/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
, ascript.sh
, and ameltano.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 sourcemeltano.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.The text was updated successfully, but these errors were encountered: