-
Notifications
You must be signed in to change notification settings - Fork 80
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
Cleaned up Job assessment and Cluster assessment to improve testing and reduce redundancy. #825
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #825 +/- ##
==========================================
+ Coverage 85.39% 85.61% +0.21%
==========================================
Files 40 41 +1
Lines 5031 5212 +181
Branches 921 950 +29
==========================================
+ Hits 4296 4462 +166
- Misses 523 536 +13
- Partials 212 214 +2 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see #823
a61eb09
to
205fb59
Compare
assert len(result_set) == 1 | ||
assert result_set[0].success == 0 | ||
match = re.findall(fail_regex, result_set[0].failures) | ||
assert len(match) == 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
parse JSON and assert on concrete failures, don't rely tests on regexes. And mark this PR ready for review.
Added tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Beautiful
def test_cluster_assessment(): | ||
ws = workspace_client_mock(clusters="assortment-conf.json") | ||
crawler = ClustersCrawler(ws, MockBackend(), "ucx") | ||
result_set = list(crawler.snapshot()) | ||
|
||
assert len(result_set) == 4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you do assertions on failure messages received? That way we'll be confident in tests doing what they should
assert len(result_set) == 1 | ||
assert result_set[0].success == 0 | ||
failures = json.loads(result_set[0].failures) | ||
assert 'unsupported config: spark.databricks.passthrough.enabled' in failures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest to create some helper function for this, as we'll be doing it a lot
Fixed and issue introduced with PR #825
* Added `databricks labs ucx alias` command to create a view of tables from one schema/catalog in another schema/catalog ([#837](#837)). * Added `databricks labs ucx save-aws-iam-profiles` command to scan instance profiles identify AWS S3 access and save a CSV with permissions ([#817](#817)). * Added total view counts in the assessment dashboard ([#834](#834)). * Cleaned up `assess_jobs` and `assess_clusters` tasks in the `assessment` workflow to improve testing and reduce redundancy.([#825](#825)). * Added documentation for the assessment report ([#806](#806)). * Fixed escaping for SQL object names ([#836](#836)). Dependency updates: * Updated databricks-sdk requirement from ~=0.17.0 to ~=0.18.0 ([#832](#832)).
* Added `databricks labs ucx alias` command to create a view of tables from one schema/catalog in another schema/catalog ([#837](#837)). * Added `databricks labs ucx save-aws-iam-profiles` command to scan instance profiles identify AWS S3 access and save a CSV with permissions ([#817](#817)). * Added total view counts in the assessment dashboard ([#834](#834)). * Cleaned up `assess_jobs` and `assess_clusters` tasks in the `assessment` workflow to improve testing and reduce redundancy.([#825](#825)). * Added documentation for the assessment report ([#806](#806)). * Fixed escaping for SQL object names ([#836](#836)). Dependency updates: * Updated databricks-sdk requirement from ~=0.17.0 to ~=0.18.0 ([#832](#832)).
…nd reduce redundancy. (#825)
Fixed and issue introduced with PR #825
* Added `databricks labs ucx alias` command to create a view of tables from one schema/catalog in another schema/catalog ([#837](#837)). * Added `databricks labs ucx save-aws-iam-profiles` command to scan instance profiles identify AWS S3 access and save a CSV with permissions ([#817](#817)). * Added total view counts in the assessment dashboard ([#834](#834)). * Cleaned up `assess_jobs` and `assess_clusters` tasks in the `assessment` workflow to improve testing and reduce redundancy.([#825](#825)). * Added documentation for the assessment report ([#806](#806)). * Fixed escaping for SQL object names ([#836](#836)). Dependency updates: * Updated databricks-sdk requirement from ~=0.17.0 to ~=0.18.0 ([#832](#832)).
Changes
Linked issues
closes #818
Relates to #823
Resolves #..
Functionality
databricks labs ucx ...
...
...
Tests