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 manifest tests #80

Merged
merged 6 commits into from
May 8, 2023
Merged

Add manifest tests #80

merged 6 commits into from
May 8, 2023

Conversation

GeorgesLorre
Copy link
Collaborator

@GeorgesLorre GeorgesLorre commented May 5, 2023

Expanded the tests to reach 100% coverage for all manifest.py code

@GeorgesLorre GeorgesLorre marked this pull request as ready for review May 5, 2023 11:43
Copy link
Member

@RobbeSneyders RobbeSneyders left a comment

Choose a reason for hiding this comment

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

Thanks @GeorgesLorre!

@@ -149,6 +149,10 @@ def add_metadata(self, key: str, value: t.Any) -> None:
def base_path(self) -> str:
return self.metadata["base_path"]

@base_path.setter
Copy link
Member

Choose a reason for hiding this comment

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

If we add a setter specifically for base_path instead of leveraging the add_metadata() method, we probably should do this for the run_id and component_id as well?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I used the add_metadata() in my first version but decided against it since I was updating metadata and not adding it. But I guess we could use it instead of the setter.

fondant/manifest.py Show resolved Hide resolved
tests/test_manifest.py Outdated Show resolved Hide resolved
def test_manifest_copy_and_adapt(valid_manifest):
"""Test that a manifest can be copied and adapted without changing the original."""
manifest = Manifest(valid_manifest)
new_manifest = manifest.copy()
new_manifest.remove_subset("images")
assert manifest._specification == valid_manifest
assert new_manifest._specification != valid_manifest


def test_no_validate_schema(monkeypatch, valid_manifest):
Copy link
Member

Choose a reason for hiding this comment

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

I don't really understand this test. When would this behavior occur?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Probably never but we needed to cover this branch in the logic for coverage.

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

The message being raised mentions component_spec instead of manifest, so you might want to check that 😛

@RobbeSneyders RobbeSneyders changed the title Feature/manifest test coverage Add manifest tests May 5, 2023
@GeorgesLorre GeorgesLorre merged commit 90db5dd into main May 8, 2023
RobbeSneyders added a commit that referenced this pull request May 8, 2023
Pipeline on main was failing after merging #80 en #83 separately.
@RobbeSneyders RobbeSneyders deleted the feature/manifest_test_coverage branch May 15, 2023 16:29
Hakimovich99 pushed a commit that referenced this pull request Oct 16, 2023
Expanded the tests to reach 100% coverage for all `manifest.py` code
Hakimovich99 pushed a commit that referenced this pull request Oct 16, 2023
Pipeline on main was failing after merging #80 en #83 separately.
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.

2 participants