Skip to content
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

Add integration test to run example DAGs #114

Merged
merged 7 commits into from
Feb 22, 2022
Merged

Conversation

dimberman
Copy link
Collaborator

@dimberman dimberman commented Feb 17, 2022

Resolves #100

@dimberman dimberman marked this pull request as draft February 17, 2022 22:15
@dimberman dimberman linked an issue Feb 17, 2022 that may be closed by this pull request
@dimberman dimberman marked this pull request as ready for review February 18, 2022 02:11
"snowflake_animal_adoption_example",
],
)
def test_example_dag(session, dag_id):
Copy link
Collaborator

@utkarsharma2 utkarsharma2 Feb 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We were planning to run this in a periodic manner like a once a day or so, but this looks like part of CI? is this fast enough for CI?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@utkarsharma2 yes this runs fairly quickly. I'm gonna attempt to split up the CI soon which should speed up everything considerably.


@pytest.mark.parametrize(
"dag_id",
[
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be worth listing all the dags in the examples folder (e.g. glob.glob("../../example_dags/*.py) instead of having a hard-coded list?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we might want to pick and choose instead of running all dags?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe all the DAGs in our examples folders should be functional - and my understanding is that this is the way we have to make sure they'll be working. My concern with having a hard-coded list here is that we may forget to update this test when new example DAGs are added - and they may stop working if we don't have an automatic way of validating them.

If we want to run specific tests for local development, we can always do that with pytest -k

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tatiana I have added all DAGs to the test

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tatiana I tried to make it grab all DAGs from the dagbag which would've allowed this to automatically pick up new dags but for some reason that caused the CI to infinitely loop. I suppose we can just make sure that any new dags get added to the list?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a shame. Please, let me know if you'd like to pair on this at some point - with a rubber duck, we may be able to find a way that works.
It is not a blocker, though. You did great work which deserves to be in our main branch! 🎉

Copy link
Collaborator

@tatiana tatiana Feb 21, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

example_dags/steven-dag.py Outdated Show resolved Hide resolved
@tatiana tatiana added this to the 0.6.0a1 milestone Feb 21, 2022
@tatiana tatiana added the priority/critical Critical priority label Feb 21, 2022
@tatiana tatiana changed the title #100 add integration tests around example dags Add integration test to run example DAGs Feb 21, 2022
@tatiana tatiana removed the priority/critical Critical priority label Feb 21, 2022
@dimberman dimberman merged commit 4f11854 into main Feb 22, 2022
@dimberman dimberman deleted the add-integration-tests branch February 22, 2022 17:02
utkarsharma2 pushed a commit that referenced this pull request Mar 30, 2022
* add integration tests around example dags

* Create an integration test that ensures that all example DAGs are runnable

* get save file tests to pass

* get save file tests to pass

* render example now works purely within postgres

* fix tests

* pin deps
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make Example DAGs work
3 participants