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

Fixed nightly integration tests run as service principals #52

Merged
merged 1 commit into from
Feb 24, 2024
Merged

Conversation

nfx
Copy link
Collaborator

@nfx nfx commented Feb 24, 2024

This PR clarifies documentation for global/home installations.

This PR clarifies documentation for global/home installations.
Copy link

codecov bot commented Feb 24, 2024

Codecov Report

Attention: Patch coverage is 60.00000% with 8 lines in your changes are missing coverage. Please review.

Project coverage is 76.73%. Comparing base (aa57141) to head (5d09719).

Files Patch % Lines
src/databricks/labs/blueprint/installation.py 60.00% 7 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #52      +/-   ##
==========================================
- Coverage   77.23%   76.73%   -0.50%     
==========================================
  Files          13       13              
  Lines        1278     1294      +16     
  Branches      232      233       +1     
==========================================
+ Hits          987      993       +6     
- Misses        201      209       +8     
- Partials       90       92       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

✅ 10/10 passed, 2 skipped, 30s total

Running from acceptance #44

@nfx nfx merged commit 01d9467 into main Feb 24, 2024
7 of 9 checks passed
@nfx nfx deleted the feat/global branch February 24, 2024 13:12
nfx added a commit that referenced this pull request Mar 2, 2024
* Added automated upgrade framework ([#50](#50)). This update introduces an automated upgrade framework for managing and applying upgrades to the product, with a new `upgrades.py` file that includes a `ProductInfo` class having methods for version handling, wheel building, and exception handling. The test code organization has been improved, and new test cases, functions, and a directory structure for fixtures and unit tests have been added for the upgrades functionality. The `test_wheels.py` file now checks the version of the Databricks SDK and handles cases where the version marker is missing or does not contain the `__version__` variable. Additionally, a new `Application State Migrations` section has been added to the README, explaining the process of seamless upgrades from version X to version Z through version Y, addressing the need for configuration or database state migrations as the application evolves. Users can apply these upgrades by following an idiomatic usage pattern involving several classes and functions. Furthermore, improvements have been made to the `_trim_leading_whitespace` function in the `commands.py` file of the `databricks.labs.blueprint` module, ensuring accurate and consistent removal of leading whitespace for each line in the command string, leading to better overall functionality and maintainability.
* Added brute-forcing `SerdeError` with `as_dict()` and `from_dict()` ([#58](#58)). This commit introduces a brute-forcing approach for handling `SerdeError` using `as_dict()` and `from_dict()` methods in an open-source library. The new `SomePolicy` class demonstrates the usage of these methods for manual serialization and deserialization of custom classes. The `as_dict()` method returns a dictionary representation of the class instance, and the `from_dict()` method, decorated with `@classmethod`, creates a new instance from the provided dictionary. Additionally, the GitHub Actions workflow for acceptance tests has been updated to include the `ready_for_review` event type, ensuring that tests run not only for opened and synchronized pull requests but also when marked as "ready for review." These changes provide developers with more control over the deserialization process and facilitate debugging in cases where default deserialization fails, but should be used judiciously to avoid brittle code.
* Fixed nightly integration tests run as service principals ([#52](#52)). In this release, we have enhanced the compatibility of our codebase with service principals, particularly in the context of nightly integration tests. The `Installation` class in the `databricks.labs.blueprint.installation` module has been refactored, deprecating the `current` method and introducing two new methods: `assume_global` and `assume_user_home`. These methods enable users to install and manage `blueprint` as either a global or user-specific installation. Additionally, the `existing` method has been updated to work with the new `Installation` methods. In the test suite, the `test_installation.py` file has been updated to correctly detect global and user-specific installations when running as a service principal. These changes improve the testability and functionality of our software, ensuring seamless operation with service principals during nightly integration tests.
* Made `test_existing_installations_are_detected` more resilient ([#51](#51)). In this release, we have added a new test function `test_existing_installations_are_detected` that checks if existing installations are correctly detected and retries the test for up to 15 seconds if they are not. This improves the reliability of the test by making it more resilient to potential intermittent failures. We have also added an import from `databricks.sdk.retries` named `retried` which is used to retry the test function in case of an `AssertionError`. Additionally, the test function `test_existing` has been renamed to `test_existing_installations_are_detected` and the `xfail` marker has been removed. We have also renamed the test function `test_dataclass` to `test_loading_dataclass_from_installation` for better clarity. This change will help ensure that the library is correctly detecting existing installations and improve the overall quality of the codebase.
@nfx nfx mentioned this pull request Mar 2, 2024
nfx added a commit that referenced this pull request Mar 2, 2024
* Added automated upgrade framework
([#50](#50)). This
update introduces an automated upgrade framework for managing and
applying upgrades to the product, with a new `upgrades.py` file that
includes a `ProductInfo` class having methods for version handling,
wheel building, and exception handling. The test code organization has
been improved, and new test cases, functions, and a directory structure
for fixtures and unit tests have been added for the upgrades
functionality. The `test_wheels.py` file now checks the version of the
Databricks SDK and handles cases where the version marker is missing or
does not contain the `__version__` variable. Additionally, a new
`Application State Migrations` section has been added to the README,
explaining the process of seamless upgrades from version X to version Z
through version Y, addressing the need for configuration or database
state migrations as the application evolves. Users can apply these
upgrades by following an idiomatic usage pattern involving several
classes and functions. Furthermore, improvements have been made to the
`_trim_leading_whitespace` function in the `commands.py` file of the
`databricks.labs.blueprint` module, ensuring accurate and consistent
removal of leading whitespace for each line in the command string,
leading to better overall functionality and maintainability.
* Added brute-forcing `SerdeError` with `as_dict()` and `from_dict()`
([#58](#58)). This
commit introduces a brute-forcing approach for handling `SerdeError`
using `as_dict()` and `from_dict()` methods in an open-source library.
The new `SomePolicy` class demonstrates the usage of these methods for
manual serialization and deserialization of custom classes. The
`as_dict()` method returns a dictionary representation of the class
instance, and the `from_dict()` method, decorated with `@classmethod`,
creates a new instance from the provided dictionary. Additionally, the
GitHub Actions workflow for acceptance tests has been updated to include
the `ready_for_review` event type, ensuring that tests run not only for
opened and synchronized pull requests but also when marked as "ready for
review." These changes provide developers with more control over the
deserialization process and facilitate debugging in cases where default
deserialization fails, but should be used judiciously to avoid brittle
code.
* Fixed nightly integration tests run as service principals
([#52](#52)). In this
release, we have enhanced the compatibility of our codebase with service
principals, particularly in the context of nightly integration tests.
The `Installation` class in the `databricks.labs.blueprint.installation`
module has been refactored, deprecating the `current` method and
introducing two new methods: `assume_global` and `assume_user_home`.
These methods enable users to install and manage `blueprint` as either a
global or user-specific installation. Additionally, the `existing`
method has been updated to work with the new `Installation` methods. In
the test suite, the `test_installation.py` file has been updated to
correctly detect global and user-specific installations when running as
a service principal. These changes improve the testability and
functionality of our software, ensuring seamless operation with service
principals during nightly integration tests.
* Made `test_existing_installations_are_detected` more resilient
([#51](#51)). In this
release, we have added a new test function
`test_existing_installations_are_detected` that checks if existing
installations are correctly detected and retries the test for up to 15
seconds if they are not. This improves the reliability of the test by
making it more resilient to potential intermittent failures. We have
also added an import from `databricks.sdk.retries` named `retried` which
is used to retry the test function in case of an `AssertionError`.
Additionally, the test function `test_existing` has been renamed to
`test_existing_installations_are_detected` and the `xfail` marker has
been removed. We have also renamed the test function `test_dataclass` to
`test_loading_dataclass_from_installation` for better clarity. This
change will help ensure that the library is correctly detecting existing
installations and improve the overall quality of the codebase.
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.

1 participant