-
Notifications
You must be signed in to change notification settings - Fork 5
Feature/sws2 18 #583
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
Merged
Merged
Feature/sws2 18 #583
Changes from 10 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
2d1a86e
update: Update .gitignore with /infra/airflow & /libraries
duprijil 03cb423
test!: Init tests for DAGs; make DagBag import without importing errors
duprijil 23d46b0
fix!: Solve problem with libraries folder in container
duprijil 41f02c1
feat+tests: implement scheduled materialisation dag run based on data…
duprijil 79f25ba
test: Add dags folder to tox coverage
duprijil 570332c
feat: Updat init llibs in libraries folder
duprijil a340fb9
fix!: Update Makefile to set currectly libraries path
duprijil 1507655
fix: Fixing problem with dag_tag__fkey in tests
duprijil cdfaeb7
fix!: Fix problem with initdb on tests with use_migration_files param
duprijil dc388f7
fix!: Fix problem with failing dags tests on test all
duprijil ffb8e5c
fix: undo copy libs to opt
duprijil 092a72b
Merge branch 'develop' into feature/SWS2-18
duprijil efeb8aa
fix: Fix tests after merge
duprijil File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -120,3 +120,5 @@ package.json | |
| .DS_Store | ||
| .scannerwork/* | ||
| /infra/alpine/libraries/ | ||
| /infra/airflow | ||
| /libraries | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| from airflow.models import DagBag | ||
|
|
||
|
|
||
| def test_dags_are_loaded_successfully(dag_bag: DagBag): | ||
| assert dag_bag.import_errors == {} | ||
| for dag in dag_bag.dags.values(): | ||
| assert dag is not None | ||
| assert len(dag.tasks) > 0 |
42 changes: 42 additions & 0 deletions
42
tests/unit/dags/test_daily_materialized_views_update_dag.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| from airflow.models import DagBag | ||
|
|
||
|
|
||
| def test_daily_materialized_views_update_dag_loaded(dag_bag: DagBag, daily_materialised_views_dag_id: str): | ||
| assert daily_materialised_views_dag_id in dag_bag.dags | ||
| dag = dag_bag.dags[daily_materialised_views_dag_id] | ||
| assert dag is not None | ||
|
|
||
|
|
||
| def test_daily_materialized_views_update_dag_structure(dag_bag: DagBag, daily_materialised_views_dag_id: str): | ||
| dag = dag_bag.dags[daily_materialised_views_dag_id] | ||
|
|
||
| task_ids = [task.task_id for task in dag.tasks] | ||
| expected_tasks = [ | ||
| "create_materialised_view", | ||
| "create_kpi_collection_for_notices", | ||
| "aggregate_batch_logs" | ||
| ] | ||
| for task_id in expected_tasks: | ||
| assert task_id in task_ids | ||
|
|
||
| assert len(dag.tasks) == 3 | ||
|
|
||
| create_view_task = dag.get_task("create_materialised_view") | ||
| kpi_collection_task = dag.get_task("create_kpi_collection_for_notices") | ||
| aggregate_logs_task = dag.get_task("aggregate_batch_logs") | ||
|
|
||
| assert kpi_collection_task.task_id in [task.task_id for task in create_view_task.downstream_list] | ||
| assert aggregate_logs_task.task_id in [task.task_id for task in kpi_collection_task.downstream_list] | ||
|
|
||
| assert create_view_task.task_id in [task.task_id for task in kpi_collection_task.upstream_list] | ||
| assert kpi_collection_task.task_id in [task.task_id for task in aggregate_logs_task.upstream_list] | ||
|
|
||
|
|
||
| def test_daily_materialized_views_update_dag_default_args(dag_bag: DagBag, daily_materialised_views_dag_id: str): | ||
| assert daily_materialised_views_dag_id in dag_bag.dags | ||
| dag = dag_bag.dags[daily_materialised_views_dag_id] | ||
|
|
||
| assert dag.max_active_runs == 1 | ||
| assert not dag.catchup | ||
| assert "mongodb" in dag.tags | ||
| assert "daily-views-update" in dag.tags |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.